Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.anyformat.ai/llms.txt

Use this file to discover all available pages before exploring further.

Uses the text input method, which sends raw email body text directly to the API without a file upload.

Workflow fields

We recommend creating this workflow in the anyformat platform where you can test with sample emails and iterate on field descriptions. Copy the workflow ID to use with the API.
FieldTypeDescription
sender_namestringName of the person who sent the email
sender_emailstringEmail address of the sender
company_namestringCompany or organization the sender represents
inquiry_typeenumCategory of the inquiry
urgencyenumHow urgent the request seems
topicsmulti_selectProducts or areas mentioned
summarystringBrief summary of the email

End-to-end

Python package + class names are provisional. pip install anyformat-sdk and from anyformat.sdk import Client work today, but both are expected to change before the official launch — pin the version you ship with.
# 1. Create the workflow
curl -X POST 'https://api.anyformat.ai/v2/workflows/' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ANYFORMAT_API_KEY" \
  -d '{
    "name": "Email Lead Extractor",
    "description": "Triage inbound sales emails into structured leads",
    "nodes": [
      {"id": "parse_1", "type": "parse"},
      {
        "id": "extract_1",
        "type": "extract",
        "extraction_schema": {
          "fields": [
            {"name": "sender_name",  "description": "Full name of the person who sent the email",       "data_type": "string"},
            {"name": "sender_email", "description": "Email address of the sender",                       "data_type": "string"},
            {"name": "company_name", "description": "Company or organization the sender represents",     "data_type": "string"},
            {
              "name": "inquiry_type",
              "description": "The primary category of this inquiry",
              "data_type": "enum",
              "enum_options": [
                {"name": "pricing",      "description": "Pricing or cost inquiry"},
                {"name": "demo_request", "description": "Request for a product demo"},
                {"name": "support",      "description": "Technical support or help request"},
                {"name": "partnership",  "description": "Partnership or integration inquiry"},
                {"name": "other",        "description": "Other inquiry type"}
              ]
            },
            {
              "name": "urgency",
              "description": "How urgent this request appears based on language and deadlines mentioned",
              "data_type": "enum",
              "enum_options": [
                {"name": "low",    "description": "No urgency signals"},
                {"name": "medium", "description": "Moderate urgency or soft deadline"},
                {"name": "high",   "description": "Explicit deadline or urgent language"}
              ]
            },
            {
              "name": "topics",
              "description": "Products or areas of interest mentioned in the email",
              "data_type": "multi_select",
              "enum_options": [
                {"name": "product_a",   "description": "Product A"},
                {"name": "product_b",   "description": "Product B"},
                {"name": "enterprise",  "description": "Enterprise plan or features"},
                {"name": "integration", "description": "Integration or API capabilities"},
                {"name": "pricing",     "description": "Pricing or billing"},
                {"name": "security",    "description": "Security or compliance"}
              ]
            },
            {"name": "summary", "description": "A one-sentence summary of what the sender is asking for", "data_type": "string"}
          ]
        }
      }
    ],
    "edges": [{"source": "parse_1", "target": "extract_1"}]
  }'

# 2. Submit the email body as text (no file upload)
curl -X POST 'https://api.anyformat.ai/v2/workflows/WORKFLOW_ID/run/' \
  -H "Authorization: Bearer $ANYFORMAT_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "text": "From: Maria Lopez <maria@acmecorp.com>\nSubject: Enterprise pricing for Q2\n\nHi, I am the VP of Engineering at Acme Corp..."
  }'

# 3. Poll for results
curl -H "Authorization: Bearer $ANYFORMAT_API_KEY" \
  'https://api.anyformat.ai/v2/workflows/WORKFLOW_ID/files/COLLECTION_ID/results/'

Tips

A string field like summary with a descriptive prompt acts as a mini-summarizer, giving you a one-sentence digest alongside the extracted fields.
  • Write detailed enum_options descriptions to help distinguish between similar categories. “pricing” vs “demo_request” can be ambiguous without good descriptions.
  • multi_select captures all relevant topics even when an email discusses several products at once.
  • For .eml or .msg files, use file upload instead — it preserves headers and attachments.

Next steps

Run workflow

All input methods: file upload and text

Webhooks

Use webhooks instead of polling for production email pipelines