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

# Batch Delete Resources

> Deletes resources within a schema via the event processor for asynchronous processing. Pass externalIds to delete specific resources. Set cascade to true to also delete referencing resources in other schemas. Set deleteAll to true (externalIds must be empty) to target all resources for the schema — without cascade, any resource referenced by another schema is left in place (not deleted); with cascade, referencing resources in other schemas are also deleted. The batch ID can be used to retrieve the status of the batch using the /api/batches/:batchId endpoint.



## OpenAPI

````yaml DELETE /api/resources/{schemaDefinitionNameOrId}/batch
openapi: 3.0.0
info:
  title: Reach API
  version: 1.0.0
  description: API documentation for Reach platform
servers:
  - url: https://api.embedreach.com
    description: Production server
security: []
paths:
  /api/resources/{schemaDefinitionNameOrId}/batch:
    delete:
      tags:
        - Partner Resources
      summary: Batch Delete Resources
      description: >-
        Deletes resources within a schema via the event processor for
        asynchronous processing. Pass externalIds to delete specific resources.
        Set cascade to true to also delete referencing resources in other
        schemas. Set deleteAll to true (externalIds must be empty) to target all
        resources for the schema — without cascade, any resource referenced by
        another schema is left in place (not deleted); with cascade, referencing
        resources in other schemas are also deleted. The batch ID can be used to
        retrieve the status of the batch using the /api/batches/:batchId
        endpoint.
      parameters:
        - name: reach-tenant-id
          in: header
          required: false
          schema:
            type: string
            description: >-
              If using a platform scoped JWT, you can pass in a header to
              impersonate a specific tenant to impersonate the request as.
        - schema:
            type: string
            description: The name or id of the schema definition the resources belong to
          required: true
          description: The name or id of the schema definition the resources belong to
          name: schemaDefinitionNameOrId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                externalIds:
                  type: array
                  items:
                    type: string
                  default: []
                  description: >-
                    Array of external IDs to delete. Required (non-empty) unless
                    deleteAll is true.
                cascade:
                  type: boolean
                  default: false
                  description: >-
                    When true, also deletes resources in other schemas that
                    reference the deleted resources.
                deleteAll:
                  type: boolean
                  default: false
                  description: >-
                    Must be true to delete ALL resources for the schema. Without
                    cascade, any resource that is referenced by a resource in
                    another schema is left in place (neither it nor the
                    referencing resource is deleted). With cascade, referencing
                    resources in other schemas are also deleted. externalIds
                    must be empty or omitted when deleteAll is true.
                dryRun:
                  type: boolean
                  default: false
                  description: >-
                    When true, returns a synchronous preview of what would be
                    deleted without queueing the job or touching any data.
                    Per-schema deletion counts and the number of resources that
                    would be skipped due to references are included.
      responses:
        '202':
          description: Status 202 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      batchId:
                        type: string
                        description: The batch ID for tracking the processing status
                      message:
                        type: string
                        description: Status message about the processing request
                      recordCount:
                        type: number
                        description: The number of records sent for processing
                      schemaDefinitionId:
                        type: string
                        description: The schema definition ID used for processing
                    required:
                      - batchId
                      - message
                      - recordCount
                      - schemaDefinitionId
                required:
                  - success
        '400':
          description: Bad Request - Validation or request error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    default: false
                  message:
                    type: string
                    description: Error message describing what went wrong
                  errors:
                    type: array
                    items:
                      type: string
                    description: Optional array of specific validation errors
                required:
                  - message
        '404':
          description: Status 404 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      error:
                        type: string
                    required:
                      - error
                required:
                  - success

````