Skip to main content
Get detailed information about a specific flow, including its input/output schemas.

Endpoint

GET https://app.doclo.ai/api/v1/flows/{flowId}

Authentication

Requires an API key with flows:read scope.
Authorization: Bearer dc_live_your_api_key

Path Parameters

ParameterTypeDescription
flowIdstringRequired. The flow identifier

Query Parameters

ParameterTypeDescription
versionstringSpecific version to retrieve (default: latest)

Response

Success (200 OK)

{
  "id": "invoice-extractor",
  "name": "Invoice Extractor",
  "description": "Extract structured data from invoices including vendor, line items, and totals",
  "version": "1.2.0",
  "versions": ["1.0.0", "1.1.0", "1.2.0"],
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-02-20T14:45:00Z",
  "schema": {
    "input": {
      "type": "object",
      "properties": {
        "document": {
          "type": "object",
          "properties": {
            "base64": { "type": "string" },
            "filename": { "type": "string" },
            "mimeType": { "type": "string" }
          },
          "required": ["base64"]
        }
      },
      "required": ["document"]
    },
    "output": {
      "type": "object",
      "properties": {
        "invoiceNumber": { "type": "string" },
        "date": { "type": "string" },
        "vendor": {
          "type": "object",
          "properties": {
            "name": { "type": "string" },
            "address": { "type": "string" }
          }
        },
        "lineItems": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "description": { "type": "string" },
              "quantity": { "type": "number" },
              "unitPrice": { "type": "number" },
              "total": { "type": "number" }
            }
          }
        },
        "subtotal": { "type": "number" },
        "tax": { "type": "number" },
        "total": { "type": "number" }
      }
    }
  },
  "config": {
    "supportedFormats": ["application/pdf", "image/png", "image/jpeg"],
    "maxFileSizeMB": 50,
    "maxPages": 100,
    "estimatedCreditsPerPage": 2
  }
}

Response Fields

FieldTypeDescription
idstringFlow identifier
namestringHuman-readable name
descriptionstringDetailed description
versionstringCurrent/requested version
versionsarrayAll available versions
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last update timestamp
schema.inputobjectJSON Schema for input validation
schema.outputobjectJSON Schema describing output structure
configobjectFlow configuration and limits
config.supportedFormatsarrayAccepted MIME types
config.maxFileSizeMBnumberMaximum file size in MB
config.maxPagesnumberMaximum document pages
config.estimatedCreditsPerPagenumberApproximate credit cost

Examples

cURL

curl https://app.doclo.ai/api/v1/flows/invoice-extractor \
  -H "Authorization: Bearer dc_live_your_api_key"

Get Specific Version

curl "https://app.doclo.ai/api/v1/flows/invoice-extractor?version=1.1.0" \
  -H "Authorization: Bearer dc_live_your_api_key"

TypeScript

const response = await fetch(
  'https://app.doclo.ai/api/v1/flows/invoice-extractor',
  {
    headers: {
      'Authorization': `Bearer ${process.env.DOCLO_API_KEY}`
    }
  }
);

const flow = await response.json();

console.log(`Flow: ${flow.name} v${flow.version}`);
console.log(`Supported formats: ${flow.config.supportedFormats.join(', ')}`);
console.log(`Output schema:`, flow.schema.output);

Validate Input Before Running

import Ajv from 'ajv';

// Fetch flow to get input schema
const flowResponse = await fetch(
  'https://app.doclo.ai/api/v1/flows/invoice-extractor',
  { headers: { 'Authorization': `Bearer ${apiKey}` } }
);
const flow = await flowResponse.json();

// Validate your input
const ajv = new Ajv();
const validate = ajv.compile(flow.schema.input);

const input = {
  document: {
    base64: documentData,
    filename: 'invoice.pdf',
    mimeType: 'application/pdf'
  }
};

if (!validate(input)) {
  console.error('Invalid input:', validate.errors);
} else {
  // Input is valid, proceed with execution
}

Errors

StatusCodeDescription
401UNAUTHORIZEDMissing or invalid API key
403FORBIDDENAPI key missing flows:read scope
404FLOW_NOT_FOUNDFlow doesn’t exist
404VERSION_NOT_FOUNDRequested version doesn’t exist
429RATE_LIMITEDRate limit exceeded

Next Steps