> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doclo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Flow

> GET /api/v1/flows/{flowId}

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.

```bash theme={null}
Authorization: Bearer dc_live_your_api_key
```

## Path Parameters

| Parameter | Type   | Description                       |
| --------- | ------ | --------------------------------- |
| `flowId`  | string | **Required.** The flow identifier |

## Query Parameters

| Parameter | Type   | Description                                    |
| --------- | ------ | ---------------------------------------------- |
| `version` | string | Specific version to retrieve (default: latest) |

## Response

### Success (200 OK)

```json theme={null}
{
  "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

| Field                            | Type   | Description                             |
| -------------------------------- | ------ | --------------------------------------- |
| `id`                             | string | Flow identifier                         |
| `name`                           | string | Human-readable name                     |
| `description`                    | string | Detailed description                    |
| `version`                        | string | Current/requested version               |
| `versions`                       | array  | All available versions                  |
| `createdAt`                      | string | ISO 8601 creation timestamp             |
| `updatedAt`                      | string | ISO 8601 last update timestamp          |
| `schema.input`                   | object | JSON Schema for input validation        |
| `schema.output`                  | object | JSON Schema describing output structure |
| `config`                         | object | Flow configuration and limits           |
| `config.supportedFormats`        | array  | Accepted MIME types                     |
| `config.maxFileSizeMB`           | number | Maximum file size in MB                 |
| `config.maxPages`                | number | Maximum document pages                  |
| `config.estimatedCreditsPerPage` | number | Approximate credit cost                 |

## Examples

### cURL

```bash theme={null}
curl https://app.doclo.ai/api/v1/flows/invoice-extractor \
  -H "Authorization: Bearer dc_live_your_api_key"
```

### Get Specific Version

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

### TypeScript

```typescript theme={null}
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

```typescript theme={null}
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

| Status | Code                | Description                        |
| ------ | ------------------- | ---------------------------------- |
| 401    | `UNAUTHORIZED`      | Missing or invalid API key         |
| 403    | `FORBIDDEN`         | API key missing `flows:read` scope |
| 404    | `FLOW_NOT_FOUND`    | Flow doesn't exist                 |
| 404    | `VERSION_NOT_FOUND` | Requested version doesn't exist    |
| 429    | `RATE_LIMITED`      | Rate limit exceeded                |

## Next Steps

<CardGroup cols={2}>
  <Card title="Run Flow" icon="play" href="/api-reference/flows/run">
    Execute the flow with a document
  </Card>

  <Card title="Errors" icon="triangle-exclamation" href="/api-reference/errors">
    Handle error responses
  </Card>
</CardGroup>
