Transformations

Create a batch of Transformations

Creates a batch of new transformations, each with a content and input type, and queues them up in bem's servers. Bem supports both application/json and multipart/form-data requests, where the latter is useful for large files. Creates a batch of new transformations, each with a content and input type, and queues them up in bem's servers. Bem supports both application/json and multipart/form-data requests, where the latter is useful for large files.

Request Examples

Send a file directly using multipart/form-data. This is recommended for large files as it avoids the overhead of base64 encoding.

curl -X POST https://api.bem.ai/v1-beta/transformations \
  -H "x-api-key: YOUR_API_KEY" \
  -F "pipelineID=YOUR_PIPELINE_ID" \
  -F "referenceID=ref-001" \
  -F "file=@/path/to/document.pdf"

Note: With multipart/form-data, each request creates a single transformation. To process multiple files, send separate requests for each file.

Send file contents as base64-encoded strings in a JSON body. This approach supports batching multiple transformations in a single request.

curl -X POST https://api.bem.ai/v1-beta/transformations \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "pipelineID": "YOUR_PIPELINE_ID",
    "transformations": [
      {
        "referenceID": "ref-001",
        "inputType": "pdf",
        "inputContent": "JVBERi0xLjQKJeLjz9..."
      },
      {
        "referenceID": "ref-002",
        "inputType": "pdf",
        "inputContent": "JVBERi0xLjUKJeLjz9..."
      }
    ]
  }'
POST
/v1-beta/transformations
x-api-key<token>

Authenticate using API Key in request header

In: header

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://api.bem.ai/v1-beta/transformations" \  -H "Content-Type: application/json" \  -d '{    "pipelineID": "string",    "transformations": [      {        "referenceID": "string",        "inputType": "csv",        "inputContent": "string"      }    ]  }'
{
  "transformations": [
    {
      "referenceID": "string",
      "task_create_status": "string"
    }
  ]
}