---
openapi: 3.0.3
info:
  title: Braze REST API – Delete data objects in bulk
  description: |
    ## Prerequisites

    To use this endpoint, you'll need an [API key]({{site.baseurl}}/api/basics#rest-api-key-permissions) with the `data_objects.bulk_delete` permission. The bulk endpoints use their own permissions: the single-record Data Objects permissions, such as `data_objects.create`, don't grant access to them.

    ## Rate limit

    We apply a shared rate limit of 1,000 requests per minute per workspace to this endpoint. The limit is shared across all six Data Objects bulk endpoints and with Cloud Data Ingestion syncs of data objects. It's separate from the 1,000 requests per minute limit on the single-record Data Objects write endpoints.

    Every response includes the `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. A `429` response also includes `X-RateLimit-Retry-After`, the number of seconds to wait before you retry. For more information, see [API rate limits]({{site.baseurl}}/api/api_limits).

    ## Validation is all-or-nothing

    Braze checks the shape of every record when it receives the request. If any record fails, Braze rejects the whole request with `400` and stores nothing. Braze checks the request in stages and lists every error it finds at the stage that fails. After you fix those errors and resend the whole request, a later stage can still return new errors.

    ## Processing is asynchronous

    A `202` response means Braze accepted the batch and queued it for processing. It doesn't mean the records were applied. Braze runs lookups, such as whether the type exists and whether the object exists, when it processes the batch, so a request that returns `202` can still produce failures for individual records later. For the codes Braze records, see [Processing failure codes](#processing-failure-codes).

    ## Ordering

    Braze stamps every record with the time it received the request. Don't send `updated_at` in a record; Braze rejects it. When two requests change the same object, the request Braze received later wins, and an older write that arrives afterward is skipped.

    ## Waiting on dependencies

    A delete of an object that doesn't exist yet waits instead of failing right away, because a request that creates the object might still be processing. Braze retries for about 40 hours (10 attempts). If the object still doesn't exist after that, the record fails with `data-object-dependency-not-found`.

    ## Deletes and later upserts

    An upsert that Braze receives after a delete of the same object recreates the object.

    ## Product limits

    The same limits as the single-record Data Objects endpoints apply: 50,000 data object records per company, 1,000 data objects per user, 10,000 users per data object, 1,000 related objects per data object, and 255 characters per attribute value. For details, see [Product limits]({{site.baseurl}}/api/endpoints/data_objects#product-limits).
  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:
  /data_objects/objects:
    delete:
      summary: Delete data objects in bulk
      operationId: bulkDeleteDataObjects
      description: |
        ## Processing failure codes

        These codes aren't returned by the endpoint. Braze records them for each record that fails when it processes a queued batch. The codes are stable, so you can rely on their exact values.

        | Code | Meaning |
        |---|---|
        | `data-object-type-not-found` | `type_name` names no active data object type in the workspace. |
        | `data-object-ingestion-rejected` | Any other rejection, such as a refused `object_id`. |
        | `data-object-dependency-not-found` | The object the record depends on was still missing after about 40 hours of retries. |
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkDeleteDataObjectsRequest'
            examples:
              one_type:
                summary: Delete objects of one type
                value:
                  records:
                  - type_name: account
                    object_id: acct-001
                  - type_name: account
                    object_id: acct-002
              mixed_types:
                summary: Delete objects of two types in one request
                value:
                  records:
                  - type_name: account
                    object_id: acct-001
                  - type_name: opportunity
                    object_id: opp-001
      responses:
        '202':
          description: |
            Accepted. Braze queued the batch for processing. Records are applied later, and individual records can still fail during processing. See [Processing failure codes](#processing-failure-codes).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AcceptedResponse'
              examples:
                queued:
                  summary: Batch queued
                  value:
                    source_import_id: api-20261022T153012123456-9f3a1c2b
                    status: queued
                    record_count: 2
        '400':
          description: |
            Bad request. Braze stored nothing. Each error has an `id`, a `message`, the `parameter` at fault when there is one, and, for record-level errors, the record's `index` (its 0-based position in `records`). Fix every error and resend the whole request.

            - **`invalid-request`:** The body isn't a JSON object or is malformed JSON, `records` is missing or has fewer than 1 or more than 50 entries, or the body has a top-level field other than `records`, including a field Braze sets (`source_type`, `source_import_id`, `source_chunk_id`, or `record_type`). Send a JSON object whose only field is `records`, with 1 to 50 entries.
            - **`schema-mismatch`:** A record is missing a required field, has an unrecognized field (including `updated_at`), has a field of the wrong type or an empty string, or has a value or field name that isn't valid UTF-8 or contains the null character. Correct the record named by `index` and `parameter`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorsResponse'
              examples:
                missing_field:
                  summary: Record missing a required field
                  value:
                    errors:
                    - index: 0
                      id: schema-mismatch
                      parameter: object_id
                      message: object_id is required
                attributes_sent:
                  summary: Record includes attributes
                  value:
                    errors:
                    - index: 0
                      id: schema-mismatch
                      parameter: attributes
                      message: attributes is not a recognized field
                too_many_records:
                  summary: records has more than 50 entries
                  value:
                    errors:
                    - id: invalid-request
                      parameter: records
                      message: records must contain between 1 and 50 entries
                missing_records:
                  summary: records is missing
                  value:
                    errors:
                    - id: invalid-request
                      parameter: records
                      message: records is required
                unrecognized_top_level_field:
                  summary: Unrecognized top-level field
                  value:
                    errors:
                    - id: invalid-request
                      parameter: batch_name
                      message: batch_name is not a recognized field
                server_set_field:
                  summary: Field that Braze sets
                  value:
                    errors:
                    - id: invalid-request
                      parameter: source_import_id
                      message: source_import_id is not a recognized field
                malformed_json:
                  summary: Malformed JSON
                  value:
                    errors:
                    - id: invalid-request
                      message: The request contains malformed JSON.
                body_not_object:
                  summary: Body isn't a JSON object
                  value:
                    errors:
                    - id: invalid-request
                      message: The request body must be a JSON object
                record_not_object:
                  summary: Record isn't a JSON object
                  value:
                    errors:
                    - index: 0
                      id: schema-mismatch
                      message: The record must be a JSON object
                updated_at_sent:
                  summary: Record includes updated_at
                  value:
                    errors:
                    - index: 0
                      id: schema-mismatch
                      parameter: updated_at
                      message: updated_at is not a recognized field
                empty_string:
                  summary: Empty string
                  value:
                    errors:
                    - index: 0
                      id: schema-mismatch
                      parameter: object_id
                      message: object_id must not be empty
                wrong_type:
                  summary: Field of the wrong type
                  value:
                    errors:
                    - index: 0
                      id: schema-mismatch
                      parameter: object_id
                      message: object_id must be string
                invalid_characters:
                  summary: Record value that isn't valid UTF-8
                  value:
                    errors:
                    - index: 0
                      id: schema-mismatch
                      parameter: object_id
                      message: object_id must be valid UTF-8
        '401':
          description: |
            Unauthorized. The REST API key is missing or invalid. Send the key as `Authorization: Bearer YOUR-REST-API-KEY` to the correct [REST endpoint]({{site.baseurl}}/api/basics/#endpoints).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthErrorResponse'
              examples:
                invalid_api_key:
                  summary: Missing or invalid API key
                  value:
                    error: Error authenticating credentials
        '403':
          description: |
            Forbidden. To resolve it:

            - **The API key doesn't have the required permission:** Use a REST API key with the `data_objects.bulk_delete` permission.
            - **The request came from an IP address the key doesn't allow:** Send the request from an IP address on the key's allowlist, or update the allowlist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthErrorResponse'
              examples:
                missing_permission:
                  summary: Missing permission
                  value:
                    error: You do not have permission to access this resource
                ip_not_allowed:
                  summary: IP address not on the allowlist
                  value:
                    error: IP address 192.0.2.10 is not whitelisted
        '404':
          description: |
            Not found. Data Objects isn't enabled for your company. Your workspace must be provisioned for Accounts. See [Enable Accounts]({{site.baseurl}}/user_guide/data/activation/accounts#step-1-enable-accounts).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
              examples:
                not_enabled:
                  summary: Data Objects not enabled
                  value:
                    message: Invalid URL
        '429':
          description: |
            Rate limited. You exceeded the shared limit of 1,000 requests per minute for the Data Objects bulk endpoints. Wait the number of seconds in the `X-RateLimit-Retry-After` header, then retry at a lower rate. See [API rate limits]({{site.baseurl}}/api/api_limits).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorsResponse'
              examples:
                over_rate_limit:
                  summary: Over rate limit
                  value:
                    errors:
                    - id: rate-limit-exceeded
                      message: You have exceeded your limit of 1000 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/.
        '500':
          description: |
            Internal server error. Braze didn't accept the batch, so nothing was queued. Retrying the request is safe.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorsResponse'
              examples:
                internal_error:
                  summary: Batch not accepted
                  value:
                    errors:
                    - id: internal-error
                      message: The batch could not be accepted. Retry the request.
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 `data_objects.bulk_delete` permission. Pass the key as `Authorization: Bearer YOUR-REST-API-KEY`.
  schemas:
    DataObjectDeleteRecord:
      title: Data object delete record
      type: object
      required:
      - type_name
      - object_id
      additionalProperties: false
      properties:
        type_name:
          type: string
          minLength: 1
          description: 'Name of the object''s type. The type must already exist: the bulk endpoints never create types.'
          example: account
        object_id:
          type: string
          minLength: 1
          description: Your identifier for the object. This is the same value as `object_id` in the single-record endpoint paths.
          example: acct-001
    BulkDeleteDataObjectsRequest:
      title: Delete data objects in bulk request
      type: object
      required:
      - records
      additionalProperties: false
      properties:
        records:
          type: array
          minItems: 1
          maxItems: 50
          description: 1 to 50 data object records, of any mix of types. Any other top-level field is rejected.
          items:
            $ref: '#/components/schemas/DataObjectDeleteRecord'
    RecordError:
      title: Error
      type: object
      required:
      - id
      - message
      properties:
        index:
          type: integer
          minimum: 0
          description: The 0-based position of the record in `records`. Present on record-level errors only.
          example: 0
        id:
          type: string
          description: The error ID.
          example: schema-mismatch
        parameter:
          type: string
          description: The field at fault, when there is one.
          example: object_id
        message:
          type: string
          description: A description of the error.
          example: object_id is required
    ErrorsResponse:
      title: Errors response
      type: object
      required:
      - errors
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/RecordError'
    AuthErrorResponse:
      title: Authorization error
      type: object
      properties:
        error:
          type: string
          description: A description of the error.
    NotFoundResponse:
      title: Not found
      type: object
      properties:
        message:
          type: string
          example: Invalid URL
    AcceptedResponse:
      title: Accepted response
      type: object
      required:
      - source_import_id
      - status
      - record_count
      properties:
        source_import_id:
          type: string
          description: The ID Braze generated for this request. Every request is its own import.
          example: api-20261022T153012123456-9f3a1c2b
        status:
          type: string
          enum:
          - queued
          description: 'Always `queued`: the batch was accepted and queued for processing.'
          example: queued
        record_count:
          type: integer
          minimum: 1
          maximum: 50
          description: The number of records accepted.
          example: 2
