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

# Post Ofac Batch

> Submit a CSV for batch OFAC search, no larger than 5MB.
Expects two columns with the headers `entity_name` and `reference_id`. Supports an optional `date_of_birth` column (YYYY-MM-DD format) with optional values. See sample template [here](https://storage.googleapis.com/osiris-public-assets-prod/schemas/ofac_batch_csv_example.csv)



## OpenAPI

````yaml /api-reference/openapi.json post /ofac/searches/batches
openapi: 3.1.0
info:
  title: baselayer-api-service
  version: 0.1.0
servers:
  - url: https://api.baselayer.com/
security: []
paths:
  /ofac/searches/batches:
    post:
      tags:
        - OFAC
      summary: Post Ofac Batch
      description: >-
        Submit a CSV for batch OFAC search, no larger than 5MB.

        Expects two columns with the headers `entity_name` and `reference_id`.
        Supports an optional `date_of_birth` column (YYYY-MM-DD format) with
        optional values. See sample template
        [here](https://storage.googleapis.com/osiris-public-assets-prod/schemas/ofac_batch_csv_example.csv)
      operationId: post_ofac_batch_ofac_searches_batches_post
      parameters:
        - name: similarity_threshold
          in: query
          required: false
          schema:
            type: number
            maximum: 1
            minimum: 0
            description: The similarity threshold for the OFAC search.
            default: 0.9
            title: Similarity Threshold
          description: The similarity threshold for the OFAC search.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_post_ofac_batch_ofac_searches_batches_post
      responses:
        '202':
          description: Batch accepted for processing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1.OFACBatchResponse'
        '400':
          description: >-
            Invalid request due to missing required headers, invalid file
            format, or invalid similarity threshold.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
                title: InvalidCSVHeaders
                description: >-
                  Cannot process CSV file due to missing required headers.
                  Please ensure your CSV includes all required headers.
                examples:
                  - code: 600
                    message: >-
                      Cannot process CSV file due to missing required headers.
                      Please ensure your CSV includes all required headers.
                    metadata: {}
        '413':
          description: The file is too large. Please upload a smaller file.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
                title: FileTooLarge
                description: The file is too large. Please upload a smaller file.
                examples:
                  - code: 900
                    message: The file is too large. Please upload a smaller file.
                    metadata: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    Body_post_ofac_batch_ofac_searches_batches_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
      type: object
      required:
        - file
      title: Body_post_ofac_batch_ofac_searches_batches_post
    v1.OFACBatchResponse:
      properties:
        id:
          type: string
          format: uuid
          title: OFAC Batch ID
          description: The unique identifier of the OFAC batch.
          examples:
            - a2e702a1-34b6-4401-bc1c-2d5d07b2a957
        name:
          type: string
          title: Name
          description: The name of the ofac batch file
          examples:
            - ofac_batch_1.csv
        similarity_threshold:
          type: number
          maximum: 1
          minimum: 0
          title: Similarity Threshold
          description: The similarity threshold for the OFAC search
          examples:
            - 0.9
            - 0.95
            - 0.99
        state:
          $ref: '#/components/schemas/TaskState'
          description: The current processing state of the ofac batch
          examples:
            - COMPLETED
        entities_count:
          type: integer
          title: Entities Count
          description: Total number of entities in the batch
          examples:
            - 100
        valid_entities_count:
          type: integer
          title: Valid Entities Count
          description: Total number of valid entities in the batch
          examples:
            - 100
        entities_with_match_count:
          type: integer
          title: Entities With Match Count
          description: Total number of entities with a match in the batch
          examples:
            - 10
        invalid_entities_count:
          type: integer
          title: Invalid Entities Count
          description: Total number of invalid entities in the batch
          examples:
            - 10
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the ofac batch was created
          examples:
            - '2026-08-31T10:31:07.823202'
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Updated At
          description: When the ofac batch was updated
          examples:
            - '2026-08-31T10:31:07.823211'
      type: object
      required:
        - id
        - name
        - similarity_threshold
        - state
        - entities_count
        - valid_entities_count
        - entities_with_match_count
        - invalid_entities_count
        - created_at
      title: OFACBatchResponse (v1)
    APIError:
      properties:
        code:
          type: integer
          title: Code
        message:
          type: string
          title: Message
        uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Uri
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
      type: object
      required:
        - code
        - message
      title: APIError
      description: >-
        APIError is a Pydantic model for standardizing error responses from the
        API.


        This class is used internally by APIException for JSON serialization.

        Users should typically work with APIException directly in exception
        catalogs.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TaskState:
      enum:
        - PENDING
        - EXECUTING
        - COMPLETED
        - FAILED
        - CANCELLED
      title: TaskState
      type: string
    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
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````