---
openapi: 3.0.3
info:
  title: Braze REST API – Trigger a sync
  description: 'Use this endpoint to start a sync for a given integration right
    away, for example when your warehouse load finishes. On-demand syncs run in
    addition to any recurring schedule and don''t change it. If a sync is already
    running for the integration, the request returns `429`.

    '
  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}/sync":
    post:
      summary: Trigger a sync
      description: |
        > Use this endpoint to start a sync for a given integration right away, for example when your warehouse load finishes. On-demand syncs run in addition to any recurring schedule and don't change it. If a sync is already running for the integration, the request returns `429`.

        **Note:**
        To use this endpoint, you must generate an API key with the `cdi.integration_sync` permission.


        ## Rate limit

        For rate limit details, see [API rate limits]({{site.baseurl}}/api/api_limits/).

        ## Path parameters

        The following table lists the path parameters for this endpoint.

        | Parameter | Required | Data Type | Description |
        |---|---|---|---|
        | `integration_id` | Required | String | Integration ID. This is found in the URL when viewing an integration in the Braze dashboard. The URL format is `https://[instance].braze.com/integrations/cloud_data_ingestion/[integration_id]`. |


        ## Example request

        The following sample request shows an example of how to trigger a sync.

        ```
        curl --location --request POST 'https://rest.iad-03.braze.com/cdi/integrations/00000000-0000-0000-0000-000000000000/sync' \
        --header 'Content-Type: application/json' \
        --header 'Authorization: Bearer YOUR_REST_API_KEY'
        ```

        ## Response

        ### Example success response

        The status code `202` could return the following response body:

        ```json
        {
          "message": "success"
        }
        ```

        ## Response status codes

        The following table lists the responses for this endpoint, the error message you may receive, and how to resolve it.

        | Status code | Meaning | Error message | How to resolve |
        | --- | --- | --- | --- |
        | `202 Accepted` | The sync request was accepted and queued. | `success` | No action needed. |
        | `400 Bad Request` | The `integration_id` isn't valid. | `Invalid integration ID` | Pass a valid `integration_id`. Find it with the [List integrations endpoint]({{site.baseurl}}/api/endpoints/cdi/get_integration_list/). |
        | `404 Not Found` | No integration exists for the given integration ID. | `Integration not found` | Pass a valid `integration_id`. Find it with the [List integrations endpoint]({{site.baseurl}}/api/endpoints/cdi/get_integration_list/). |
        | `409 Conflict` | The integration isn't active. This can happen when the sync is paused. | `Integration must be active to trigger a sync` | Resume the sync in the Braze dashboard, then try again. |
        | `429 Too Many Requests` | A sync is already running for this integration. | `Another job is in progress` | Wait for the in-progress sync to finish, then retry. |
        | `401 Unauthorized` | The REST API key is missing, malformed, or sent to the wrong REST endpoint. | `Invalid API key` | 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). |
        | `403 Access Denied` | The REST API key doesn't have the required permission. | `Access Denied` | Use a REST API key that has the `cdi.integration_sync` permission. |
        | `429 Rate Limited` | You exceeded the rate limit for this endpoint. | `Over rate limit` | Slow your request rate and retry with exponential backoff. See [API rate limits]({{site.baseurl}}/api/api_limits/). |
        | `5XX Internal Server Error` | An unexpected error occurred on the Braze server. | `Internal Server Error` | Retry with exponential backoff. If the error persists, contact [Support]({{site.baseurl}}/braze_support/). |
      operationId: post_cdi_integrations_integration_id_sync_post_job_sync
      tags:
      - Cdi
      responses:
        '202':
          description: The sync request was accepted and queued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobSyncResponse'
        '400':
          description: The `integration_id` isn't valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: No integration exists for the given integration ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: The integration isn't active. This can happen when the sync is paused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: |-
            Too Many Requests. Causes include:

            - `Another job is in progress` — A sync is already running for this integration.
            - `Over rate limit` — You exceeded the rate limit for this endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: The REST API key is missing, malformed, or sent to the wrong REST endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: The REST API key doesn't have the required permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '5XX':
          description: An unexpected error occurred on the Braze server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      parameters:
      - name: integration_id
        in: path
        required: true
        description: Path parameter `integration_id`.
        schema:
          type: string
components:
  schemas:
    JobSyncResponse:
      type: object
      properties:
        message:
          type: string
    ErrorResponse:
      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.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: REST API key
