> ## 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.

# A consumer's recent previews

> One page of the consumer's previews, the latest first: `size=1` gives the latest.



## OpenAPI

````yaml get /consumers/{consumer_id}/syncs/{syncid}/previews
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:
    get:
      tags:
        - Syncs
      summary: A consumer's recent previews
      description: >-
        One page of the consumer's previews, the latest first: `size=1` gives
        the latest.
      operationId: agentic_syncs_get_previews
      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: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
            title: Page
        - name: size
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
            title: Size
        - 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/ChiftPage_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
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ChiftPage_Preview_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Preview'
          type: array
          title: Items
        total:
          type: integer
          minimum: 0
          title: Total
        page:
          type: integer
          minimum: 1
          title: Page
        size:
          type: integer
          minimum: 1
          title: Size
      type: object
      required:
        - items
        - total
        - page
        - size
      title: ChiftPage[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'
    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
    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
    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
  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.