Calls
Call a Workflow or Function
Create one or more calls to execute workflows or functions.
This endpoint provides a unified way to invoke either workflows or functions. You can submit a single call or batch multiple calls in one request.
Calling a Workflow vs Function
Each call in the request can target either:
- A Workflow: Specify
workflowIDorworkflowNameto execute a multi-step workflow - A Function: Specify
functionIDorfunctionNameto call a single function directly
Input Options
Each call accepts input through the input object with two modes:
- Single File (
singleFile): Process one file per call - Batch Files (
batchFiles): Process multiple files in a single call, each with optionalitemReferenceID
Response and Tracking
The API returns immediately with call IDs. Processing happens asynchronously.
Use the callReferenceID field to track calls with your own identifiers.
Poll GET /v2/calls/{callID} to check status and retrieve results.
Authorization
API Key x-api-key<token>
Authenticate using API Key in request header
In: header
Request Body
application/json
calls?array<>
Response Body
application/json
curl -X POST "https://api.bem.ai/v2/calls" \ -H "Content-Type: application/json" \ -d '{}'{
"calls": [
{
"callID": "string",
"callType": "string",
"status": "pending",
"createdAt": "2019-08-24T14:15:22Z",
"finishedAt": "2019-08-24T14:15:22Z",
"workflowID": "string",
"workflowName": "string",
"workflowVersionNum": 0,
"functionID": "string",
"functionName": "string",
"functionType": "string",
"functionVersionNum": 0,
"callReferenceID": "string",
"functionCalls": [
{
"functionCallID": "string",
"functionID": "string",
"functionName": "string",
"type": "transform",
"referenceID": "string",
"status": "pending",
"functionVersionNum": 0,
"activity": [
{
"displayName": "string",
"status": "pending"
}
],
"sourceFunctionCallID": "string",
"workflowCallID": "string",
"inputType": "string",
"s3URL": "string",
"inputs": [
{
"inputType": "string",
"itemReferenceID": "string",
"s3URL": "string"
}
]
}
],
"input": {
"singleFile": {
"inputType": "string",
"s3URL": "string"
},
"batchFiles": {
"inputs": [
{
"inputType": "string",
"itemReferenceID": "string",
"s3URL": "string"
}
]
}
}
}
],
"error": "string"
}