> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chift.eu/llms.txt
> Use this file to discover all available pages before exploring further.

# One preview: where it stands, what it would create and what would fail

> What would fail is grouped by cause; a missing mapping, by table, with the rows to fill. `refill_suggested` says mappings are missing: fill them (`POST …/ai-fill`), then preview again.



## OpenAPI

````yaml get /consumers/{consumer_id}/syncs/{syncid}/previews/{preview_id}
openapi: 3.1.0
info:
  title: Chift API
  description: >-
    The Chift API is a universal API giving you access to financial data from
    the software of your clients. It helps software companies to offer native
    integrations to their clients without the effort needed to maintain those
    native integrations. By using the APIs (Accounting, POS, eCommerce) of
    Chift, you connect once and allow your clients to use their software
    packages.
  version: 1.0.0
servers:
  - url: https://api.chift.eu
    description: Chift
security:
  - bearerAuth: []
paths:
  /consumers/{consumer_id}/syncs/{syncid}/previews/{preview_id}:
    get:
      tags:
        - Syncs
      summary: 'One preview: where it stands, what it would create and what would fail'
      description: >-
        What would fail is grouped by cause; a missing mapping, by table, with
        the rows to fill. `refill_suggested` says mappings are missing: fill
        them (`POST …/ai-fill`), then preview again.
      operationId: agentic_syncs_get_preview
      parameters:
        - name: consumer_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Consumer Id
        - name: syncid
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Syncid
        - name: preview_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Preview Id
        - name: language
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              ISO 639-1 code of the language of the texts (en, fr, nl, de, es;
              any case), falling back to English. Without it, translation keys.
            title: Language
          description: >-
            ISO 639-1 code of the language of the texts (en, fr, nl, de, es; any
            case), falling back to English. Without it, translation keys.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Preview'
        '404':
          content:
            application/json:
              examples:
                Sync not found:
                  value:
                    message: The sync does not exist
                    status: error
                Not configured:
                  value:
                    message: The consumer is not configured for this sync
                    status: error
                Preview not found:
                  value:
                    message: The preview does not exist
                    status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Preview:
      properties:
        preview_id:
          type: string
          format: uuid
          title: Preview Id
          description: The preview's id.
        status:
          type: string
          enum:
            - pending
            - ready
            - failed
          title: Status
          description: Pending while it is queued or running, then ready or failed.
        started_at:
          type: string
          format: date-time
          title: Started At
          description: When it was asked for.
        finished_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Finished At
          description: When it ended. Null until it does.
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Why it failed. Null unless it did.
        counts:
          items:
            $ref: '#/components/schemas/PreviewCount'
          type: array
          title: Counts
          description: How many objects of each kind it would create.
        issues:
          items:
            $ref: '#/components/schemas/PreviewIssue'
          type: array
          title: Issues
          description: >-
            What would fail, one entry per cause; a missing mapping, one entry
            per table.
        refill_suggested:
          type: boolean
          title: Refill Suggested
          description: >-
            Mappings are missing: `POST …/ai-fill` may fill them, then preview
            again.
      type: object
      required:
        - preview_id
        - status
        - started_at
        - finished_at
        - error
        - counts
        - issues
        - refill_suggested
      title: Preview
    ChiftError:
      properties:
        message:
          type: string
          title: Message
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          default: error
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          default: ''
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      required:
        - message
      title: ChiftError
    HTTPValidationError:
      title: Validation Error
      required:
        - message
      type: object
      properties:
        message:
          title: Message
          type: string
          default: Validation error
        status:
          title: Status
          type: string
          default: error
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    PreviewCount:
      properties:
        kind:
          type: string
          title: Kind
          description: What would be created.
          examples:
            - invoice
        title:
          type: string
          title: Title
          description: >-
            Name to show, in the requested language; its translation key without
            one.
          examples:
            - Invoice
        count:
          type: integer
          title: Count
          description: How many.
      type: object
      required:
        - kind
        - title
        - count
      title: PreviewCount
    PreviewIssue:
      properties:
        kind:
          type: string
          title: Kind
          description: What kind of problem it is, and so who acts on it.
          examples:
            - configuration
        code:
          type: string
          title: Code
          description: The error code.
          examples:
            - ERROR_SYNC_MISSING_MAPPING_VALUE
        message:
          type: string
          title: Message
          description: What would fail.
        cause:
          additionalProperties: true
          type: object
          title: Cause
          description: What the objects it holds up have in common.
        source_ids:
          items:
            type: string
          type: array
          title: Source Ids
          description: The source objects it would hold up.
        table_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Table Key
          description: >-
            For a missing mapping: the table to fill, `GET
            …/mappings/{table_key}`.
        table_title:
          anyOf:
            - type: string
            - type: 'null'
          title: Table Title
          description: 'For a missing mapping: the table''s name.'
        source_keys:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Source Keys
          description: 'For a missing mapping: the rows without a value.'
      type: object
      required:
        - kind
        - code
        - message
        - cause
        - source_ids
      title: PreviewIssue
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        This access token needs to be included in each of your request to the
        Chift API.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.