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

# Sync first-party CRM audiences (asynchronous: returns a task id)



## OpenAPI

````yaml /openapi/buyer.yaml post /api/v2/buyer/advertisers/{id}/audiences/sync
openapi: 3.1.0
info:
  title: Semicola Exchange buyer API
  version: 2.0.0
  description: >-
    Buyer endpoints: advertisers, storefronts and connections, product
    discovery, campaigns, proposals, media buys, creatives and reporting. Every
    write accepts an Idempotency-Key header.
servers:
  - url: https://api.semicola.com
security:
  - bearerAuth: []
  - sessionCookie: []
tags:
  - name: Advertisers
  - name: Storefronts
  - name: Product Discovery
  - name: Campaigns
  - name: Media Buys
  - name: Update Proposals
  - name: Optimization Suggestions
  - name: Creatives
  - name: Catalogs
  - name: Property Lists
  - name: Audiences
  - name: Reporting
  - name: Event Sources
  - name: Webhooks
  - name: Tasks
  - name: Audit Logs
  - name: Activity
paths:
  /api/v2/buyer/advertisers/{id}/audiences/sync:
    post:
      tags:
        - Audiences
      summary: 'Sync first-party CRM audiences (asynchronous: returns a task id)'
      operationId: postBuyerAdvertisersByIdAudiencesSync
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            exclusiveMinimum: 0
            maximum: 9007199254740991
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
            minLength: 16
            maxLength: 255
            pattern: ^[A-Za-z0-9_.:-]+$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                audiences:
                  minItems: 1
                  type: array
                  items:
                    type: object
                    properties:
                      audienceId:
                        type: string
                        minLength: 1
                        maxLength: 255
                      name:
                        type: string
                        maxLength: 255
                      consentBasis:
                        type: string
                        enum:
                          - consent
                          - legitimate_interest
                          - contract
                          - legal_obligation
                      add:
                        maxItems: 100000
                        type: array
                        items:
                          type: object
                          properties:
                            externalId:
                              type: string
                              minLength: 1
                              maxLength: 255
                            email:
                              type: string
                              maxLength: 320
                            phone:
                              type: string
                              maxLength: 32
                            hashedEmail:
                              type: string
                              pattern: ^[0-9a-fA-F]{64}$
                            hashedPhone:
                              type: string
                              pattern: ^[0-9a-fA-F]{64}$
                            uids:
                              maxItems: 20
                              type: array
                              items:
                                type: object
                                properties:
                                  type:
                                    type: string
                                    minLength: 1
                                    maxLength: 64
                                  value:
                                    type: string
                                    minLength: 1
                                    maxLength: 512
                                required:
                                  - type
                                  - value
                          required:
                            - externalId
                      remove:
                        maxItems: 100000
                        type: array
                        items:
                          type: object
                          properties:
                            externalId:
                              type: string
                              minLength: 1
                              maxLength: 255
                          required:
                            - externalId
                          additionalProperties: {}
                      delete:
                        type: boolean
                    required:
                      - audienceId
                deleteMissing:
                  type: boolean
                pushNotificationConfig:
                  type: object
                  properties:
                    url:
                      type: string
                      format: uri
                    operation_id:
                      type: string
                    token:
                      type: string
                    authentication:
                      type: object
                      propertyNames:
                        type: string
                      additionalProperties: {}
                  required:
                    - url
              required:
                - audiences
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    anyOf:
                      - type: object
                        properties:
                          success:
                            type: boolean
                          accountId:
                            type: string
                          operationId:
                            type: string
                          taskId:
                            type: string
                        required:
                          - success
                          - accountId
                          - operationId
                          - taskId
                        additionalProperties: false
                      - type: 'null'
                  error:
                    anyOf:
                      - type: object
                        properties:
                          code:
                            type: string
                          message:
                            type: string
                          field:
                            type: string
                          details: {}
                        required:
                          - code
                          - message
                        additionalProperties: false
                      - type: 'null'
                required:
                  - data
                  - error
                additionalProperties: false
        default:
          description: >-
            Error envelope `{data: null, error: {code, message, field?,
            details?}}`.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key or OAuth access token.
    sessionCookie:
      type: apiKey
      in: cookie
      name: sc_session

````