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

# Create or update catalog records by external id

> Up to 100 records. A row whose `external_id` is already in the catalog updates that record (a property left out is untouched, a null clears it); any other row creates one and needs `name`. Each row succeeds or fails on its own: the answer is 200 with one result per row, in request order. An `external_id` on two rows of the request fails both. Records created here produce one `catalog.records.bulk_created` webhook, not one per record. A property's `value_datetime` is ISO 8601. Without an offset (`2026-11-10T15:00`) it is read in the organization's time zone, or UTC when none is set.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/catalogs/{catalog_id}/records/batch
openapi: 3.1.0
info:
  title: Ciarem API
  version: v1
  description: >
    The Ciarem public API. Authenticate every request with an org-bound API key

    (created in Settings → API keys; Growth or Scale plan, or free trial) sent
    as a bearer token:

    `Authorization: Bearer oak_…`.


    Compatibility: this is an early, fast-moving API. Most changes are

    additive (new endpoints, new optional params, new response fields, new

    enum/string values) — clients must tolerate unknown fields and unknown

    string values. Every contract change is listed in the changelog at

    help.ciarem.ai.
servers:
  - url: https://api.ciarem.ai
security:
  - apiKey: []
tags:
  - name: Account
    description: The organization behind the API key.
  - name: Contacts
    description: People in the CRM — create, read, update, delete.
  - name: CRM
    description: 'The shape of the CRM: custom properties and funnel stages.'
  - name: Catalogs
    description: 'Products and services: catalogs, their properties, records and variants.'
  - name: Conversations
    description: Read conversations and their messages, and assign them to members.
  - name: WhatsApp numbers
    description: The connected numbers a send can go out from.
  - name: WhatsApp templates
    description: Message templates, and what each one needs filled before it can be sent.
  - name: Broadcasts
    description: Send a template, and follow what happened to every recipient.
  - name: Webhooks
    description: Have Ciarem POST events to your server as they happen, instead of polling.
paths:
  /v1/catalogs/{catalog_id}/records/batch:
    post:
      tags:
        - Catalogs
      summary: Create or update catalog records by external id
      description: >-
        Up to 100 records. A row whose `external_id` is already in the catalog
        updates that record (a property left out is untouched, a null clears
        it); any other row creates one and needs `name`. Each row succeeds or
        fails on its own: the answer is 200 with one result per row, in request
        order. An `external_id` on two rows of the request fails both. Records
        created here produce one `catalog.records.bulk_created` webhook, not one
        per record. A property's `value_datetime` is ISO 8601. Without an offset
        (`2026-11-10T15:00`) it is read in the organization's time zone, or UTC
        when none is set.
      operationId: batch_records_endpoint_v1_catalogs__catalog_id__records_batch_post
      parameters:
        - name: catalog_id
          in: path
          required: true
          schema:
            type: string
            title: Catalog Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicRecordBatchRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicRecordBatchResponse'
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
        '401':
          description: >-
            No usable credential: `missing_bearer_token` (no `Authorization:
            Bearer`) or `invalid_api_key` (unknown or revoked key).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '403':
          description: >-
            The credential is real but not allowed here: `api_key_required` (a
            session token rather than an `oak_` key), `plan_upgrade_required`
            (the plan doesn't include API access — upgrade to Growth or Scale),
            `trial_expired` (the free trial ended without a card — subscribe to
            keep the key working), or `subscription_required` (the subscription
            is canceled or suspended).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: >-
            Over the organization's request budget (`rate_limited`); the budget
            depends on the plan. Or the API key already has 8 requests running
            (`too_many_concurrent_requests`); that request was not run and does
            not count against the budget, `Retry-After` is a fixed 1 s and the
            `X-RateLimit-*` headers are absent. `Retry-After` says how many
            seconds to wait.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
          headers:
            Retry-After:
              description: >-
                Seconds to wait before retrying: until the window resets for
                `rate_limited`, a fixed 1 s for `too_many_concurrent_requests`.
              schema:
                type: integer
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
        '503':
          description: >-
            The API is at capacity (`server_busy`). The request was not run and
            does not count against the budget; retry after `Retry-After`
            seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
components:
  schemas:
    PublicRecordBatchRequest:
      properties:
        records:
          items:
            $ref: '#/components/schemas/PublicRecordBatchRow'
          type: array
          maxItems: 100
          minItems: 1
          title: Records
      additionalProperties: false
      type: object
      required:
        - records
      title: PublicRecordBatchRequest
    PublicRecordBatchResponse:
      properties:
        created:
          type: integer
          title: Created
        updated:
          type: integer
          title: Updated
        failed:
          type: integer
          title: Failed
        results:
          items:
            $ref: '#/components/schemas/PublicRecordBatchResult'
          type: array
          title: Results
      type: object
      required:
        - created
        - updated
        - failed
        - results
      title: PublicRecordBatchResponse
    PublicError:
      description: An error whose `detail` is a stable, machine-readable code.
      properties:
        detail:
          title: Detail
          type: string
      required:
        - detail
      title: PublicError
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PublicRecordBatchRow:
      properties:
        external_id:
          type: string
          maxLength: 255
          minLength: 1
          title: External Id
          description: >-
            Your own id for the record, unique in its catalog and
            case-sensitive.
        name:
          anyOf:
            - type: string
              maxLength: 200
              minLength: 1
            - type: 'null'
          title: Name
        properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - $ref: '#/components/schemas/PropertyValueShape'
                  - type: 'null'
              type: object
            - type: 'null'
          title: Properties
      additionalProperties: false
      type: object
      required:
        - external_id
      title: PublicRecordBatchRow
    PublicRecordBatchResult:
      properties:
        external_id:
          type: string
          title: External Id
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        status:
          type: string
          enum:
            - created
            - updated
            - failed
          title: Status
        error:
          anyOf:
            - $ref: '#/components/schemas/PublicRecordBatchError'
            - type: 'null'
      type: object
      required:
        - external_id
        - id
        - status
      title: PublicRecordBatchResult
    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
    PropertyValueShape:
      properties:
        property_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Property Id
        kind:
          $ref: '#/components/schemas/CrmPropertyKind'
        value_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Value Text
        value_number:
          anyOf:
            - type: number
            - type: 'null'
          title: Value Number
        value_bool:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Value Bool
        value_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Value Date
        value_datetime:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Value Datetime
        value_json:
          anyOf:
            - {}
            - type: 'null'
          title: Value Json
      type: object
      required:
        - kind
      title: PropertyValueShape
      description: |-
        A custom property value as projected onto / read off a contact.

        Mirrors the typed-column layout in `crm_property_values` so the
        consumer can dispatch on `kind` and pick the matching `value_*` slot.
        For PATCH input the writer ignores columns irrelevant to the kind.
    PublicRecordBatchError:
      properties:
        code:
          type: string
          enum:
            - duplicate_in_file
            - not_found
            - unknown_property_key
            - invalid_property_value
            - missing_required_property
            - database_error
          title: Code
        field:
          anyOf:
            - type: string
            - type: 'null'
          title: Field
        message:
          type: string
          title: Message
      type: object
      required:
        - code
        - field
        - message
      title: PublicRecordBatchError
    CrmPropertyKind:
      type: string
      enum:
        - TEXT
        - NUMBER
        - RADIO
        - DROPDOWN
        - BOOLEAN
        - DATE
        - TEXTAREA
        - MULTI_SELECT
        - EMAIL
        - MONEY
        - FILE
        - URL
        - MULTI_FILE
        - DATETIME
      title: CrmPropertyKind
      description: >-
        Type of a user-defined custom property on a contact.


        The order mirrors the Postgres `crm_property_kind_enum`: TEXTAREA was

        appended in 0014 (alongside MULTI_SELECT), EMAIL and MONEY in 0025, FILE

        in 0065, URL in 0167, MULTI_FILE in 0186, DATETIME in 0300. `EMAIL` and
        `URL` store into

        `value_text` (like TEXT) and `MONEY` into `value_number` (like NUMBER) —

        they're presentation/validation refinements of those base columns, not
        new

        storage shapes. `FILE` and `MULTI_FILE` both store an array of S3 file

        references in `value_json` (see `ciarem_crm.file_property`); they differ

        only in cardinality — FILE holds at most one file, MULTI_FILE a capped

        gallery. Pre-0186, FILE meant the gallery; 0186 renamed those rows to

        MULTI_FILE and repurposed FILE as the single-file kind (it was

        catalogs-only, so no contact data existed). The bytes live in the

        `record-media` bucket.
  headers:
    X-RateLimit-Limit:
      description: Requests allowed per window, shared across the org's keys.
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests left in the current window.
      schema:
        type: integer
    X-RateLimit-Reset:
      description: When the window resets, as a Unix timestamp in seconds.
      schema:
        type: integer
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: 'An org API key: `Authorization: Bearer oak_…`.'

````

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