---
openapi: 3.0.3
info:
  title: Braze REST API – List job sync status
  description: |
    ## Rate limit

    This endpoint has a rate limit of 100 requests per minute.
  version: 1.0.0
  contact:
    name: Braze Support
    url: https://www.braze.com/docs/braze_support/
  license:
    name: Braze Documentation
    url: https://www.braze.com/docs/api/home/
servers:
  - url: https://rest.iad-01.braze.com
    description: US-01
  - url: https://rest.iad-02.braze.com
    description: US-02
  - url: https://rest.iad-03.braze.com
    description: US-03
  - url: https://rest.iad-04.braze.com
    description: US-04
  - url: https://rest.iad-05.braze.com
    description: US-05
  - url: https://rest.iad-06.braze.com
    description: US-06
  - url: https://rest.iad-07.braze.com
    description: US-07
  - url: https://rest.iad-08.braze.com
    description: US-08
  - url: https://rest.us-10.braze.com
    description: US-10
  - url: https://rest.fra-01.braze.eu
    description: EU-01
  - url: https://rest.fra-02.braze.eu
    description: EU-02
  - url: https://rest.au-01.braze.com
    description: AU-01
  - url: https://rest.id-01.braze.com
    description: ID-01
  - url: https://rest.jp-01.braze.com
    description: JP-01
  - url: https://rest.kr-01.braze.com
    description: KR-01
security:
- BearerAuth: []
paths:
  /cdi/integrations/{integration_id}/job_sync_status:
    get:
      summary: List job sync status
      operationId: get_cdi_integrations_integration_id_job_sync_status_get_job_sync_status
      parameters:
        - name: integration_id
          in: path
          required: true
          description: Integration ID.
          schema:
            type: string
            format: uuid
          example: 00000000-0000-0000-0000-000000000000
        - name: cursor
          in: query
          required: false
          description: Determines the pagination of the sync status.
          schema:
            type: string
          example: cGFnZToy
      responses:
        "200":
          description: |
            The request succeeded and the response body lists the job sync statuses. No action needed.

            The status code `200` could return the following response body.

            Each call to this endpoint will return 10 items. For an integration with more than 10 syncs, use the `Link` header to retrieve the data on the next page as shown in the following example response.

            **Note:**
            The `Link` header won't exist if there are less than or equal to 10 syncs in total. For calls without a cursor, `prev` will not show. When looking at the last page of items, `next` will not show.
          headers:
            Link:
              description: |
                Links to the previous and next pages of syncs, when they exist, in the format `<URL>; rel="prev"` and `<URL>; rel="next"`, separated by a comma. Each URL includes the `cursor` query parameter for that page.

                The `Link` header won't exist if there are less than or equal to 10 syncs in total. For calls without a cursor, `prev` will not show. When looking at the last page of items, `next` will not show.
              schema:
                type: string
              example: '</cdi/integrations/00000000-0000-0000-0000-000000000000/job_sync_status?cursor=cGFnZTox>; rel="prev",</cdi/integrations/00000000-0000-0000-0000-000000000000/job_sync_status?cursor=cGFnZToz>; rel="next"'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobSyncStatusResponse'
              examples:
                success:
                  summary: Job sync statuses listed
                  value:
                    results:
                      - job_status: success
                        sync_start_time: "2023-08-01T17:30:01.255000Z"
                        sync_finish_time: "2023-08-01T17:40:01.255000Z"
                        last_timestamp_synced: "2023-08-01T17:25:00.000000Z"
                        rows_synced: 1000
                        rows_failed_with_errors: 0
                    message: success
        "400":
          description: |
            Bad request. To resolve it:

            - **The `cursor` value isn't valid:** Pass a valid `cursor` from the `Link` header of a previous response, or omit it.
            - **The `integration_id` isn't valid:** Pass a valid `integration_id`. Find it with the [List integrations endpoint]({{site.baseurl}}/api/endpoints/cdi/get_integration_list/).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_cursor:
                  summary: Invalid cursor
                  value:
                    message: Invalid cursor
                invalid_integration_id:
                  summary: Invalid integration ID
                  value:
                    message: Invalid integration ID
        "401":
          description: |
            Unauthorized. The REST API key is missing, malformed, or sent to the wrong REST endpoint. Send the key as `Authorization: Bearer YOUR_REST_API_KEY` to the correct [REST endpoint]({{site.baseurl}}/api/basics/#endpoints). For more causes, see [Errors and responses]({{site.baseurl}}/api/errors/#fatal-errors).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_api_key:
                  summary: Invalid API key
                  value:
                    message: 'Invalid API key: YOUR_REST_API_KEY'
        "403":
          description: Access denied. The REST API key doesn't have the required permission. Use a REST API key that has the `cdi.integration_job_status` permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                access_denied:
                  summary: Missing permission
                  value:
                    message: Access Denied
        "404":
          description: Not found. No job status was found for the given integration. Confirm the `integration_id` is correct and that syncs have run for it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                job_status_not_found:
                  summary: Job status not found
                  value:
                    message: Job status not found
        "429":
          description: |
            Rate limited. You exceeded the rate limit for this endpoint. Slow your request rate and retry with exponential backoff. See [API rate limits]({{site.baseurl}}/api/api_limits/).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                over_rate_limit:
                  summary: Over rate limit
                  value:
                    message: You have exceeded your limit of 100 requests per minute. Please contact your account executive to increase your limit. If you do not have their info, you may contact Braze directly at https://www.braze.com/contact/.
        5XX:
          description: |
            Internal server error. An unexpected error occurred on the Braze server. Retry with exponential backoff. If the error persists, contact [Support]({{site.baseurl}}/braze_support/).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: REST API key
      description: |
        REST API keys are created in the Braze dashboard at **Settings → APIs and
        Identifiers → API Keys**. The key must include the `cdi.integration_job_status` permission.
        Pass the key as `Authorization: Bearer YOUR_REST_API_KEY`.
  schemas:
    JobSyncStatus:
      title: Job sync status
      type: object
      properties:
        job_status:
          type: string
          description: |
            Status of the sync, see below for explanation of different statuses.

            | job_status | Explanation |
            | --- | --- |
            | `running` | The job is currently running. |
            | `success` | All rows synced successfully. |
            | `partial` | Some rows failed to sync due to errors. |
            | `error` | No rows were synced. |
            | `config_error` | There was an error in integration configuration. Check your integration setup. |
          example: success
        sync_start_time:
          type: string
          description: Time the sync started in ISO 8601.
          example: "2023-08-01T17:30:01.255000Z"
        sync_finish_time:
          type: string
          description: Time the sync finished in ISO 8601.
          example: "2023-08-01T17:40:01.255000Z"
        last_timestamp_synced:
          type: string
          description: Last UPDATED_AT timestamp processed by the sync in ISO 8601.
          example: "2023-08-01T17:25:00.000000Z"
        rows_synced:
          type: integer
          description: Number of rows successfully synced to Braze.
          example: 1000
        rows_failed_with_errors:
          type: integer
          description: Number of rows failed because of errors.
          example: 0
    JobSyncStatusResponse:
      title: List job sync status response
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/JobSyncStatus'
        message:
          type: string
          example: success
    ErrorResponse:
      title: Error
      type: object
      properties:
        message:
          type: string
          description: The error message describing why the request failed.
        errors:
          type: array
          description: Non-fatal errors encountered while processing the request. Data unaffected by these errors is still processed.
          items:
            type: object
            properties:
              type:
                type: string
                description: The error type.
