Skip to main content
POST
/
v2
/
workflows
curl -X POST 'https://api.anyformat.ai/v2/workflows/' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
    "name": "Invoice Processing",
    "description": "Extract data from invoice documents",
    "fields": [
      {
        "name": "invoice_number",
        "description": "The unique invoice identifier",
        "data_type": "string"
      },
      {
        "name": "total_amount",
        "description": "Total invoice amount including tax",
        "data_type": "float"
      }
    ]
  }'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Invoice Processing",
  "description": "Extract data from invoice documents",
  "created_at": "2024-03-24T12:00:00.000Z",
  "updated_at": "2024-03-24T12:00:00.000Z",
  "fields": [
    {
      "name": "invoice_number",
      "description": "The unique invoice identifier",
      "data_type": "string"
    },
    {
      "name": "total_amount",
      "description": "Total invoice amount including tax",
      "data_type": "float"
    }
  ]
}
We recommend creating workflows in the anyformat platform where you can visually configure fields, test with sample documents, and iterate faster. Once your workflow is ready, copy its ID and use it with the API to run workflows programmatically.

Request Body

FieldTypeRequiredDescription
namestringYesName of the workflow
descriptionstringNoDescription of what this workflow extracts
fieldsField[]YesArray of field definitions (at least one required)

Field Object

FieldTypeRequiredDescription
namestringYesField name (used as the key in extraction results)
descriptionstringYesDescription to guide the extraction model
data_typestringYesOne of: string, integer, float, date, datetime, boolean, list, object, enum, multi_select
enum_optionsstring[]ConditionalRequired when data_type is enum or multi_select
nested_fieldsField[]ConditionalRequired when data_type is object
curl -X POST 'https://api.anyformat.ai/v2/workflows/' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
    "name": "Invoice Processing",
    "description": "Extract data from invoice documents",
    "fields": [
      {
        "name": "invoice_number",
        "description": "The unique invoice identifier",
        "data_type": "string"
      },
      {
        "name": "total_amount",
        "description": "Total invoice amount including tax",
        "data_type": "float"
      }
    ]
  }'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Invoice Processing",
  "description": "Extract data from invoice documents",
  "created_at": "2024-03-24T12:00:00.000Z",
  "updated_at": "2024-03-24T12:00:00.000Z",
  "fields": [
    {
      "name": "invoice_number",
      "description": "The unique invoice identifier",
      "data_type": "string"
    },
    {
      "name": "total_amount",
      "description": "Total invoice amount including tax",
      "data_type": "float"
    }
  ]
}

Headers

authorization
string | null

Response

Successful Response

Workflow detail — used for get, create, and list items.

id
string
required
name
string
required
description
string | null
created_at
string<date-time> | null
updated_at
string<date-time> | null
fields
Fields · object[] | null