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

# List Definitions

Use this API to paginate through active (non-tombstoned) workflow definitions, ordered by `updatedAt` DESC.

# Endpoint

`POST https://api.velt.dev/v2/workflow/definitions/list`

# Headers

**x-velt-api-key** `string` *required*

Your API key.

**x-velt-auth-token** `string` *required*

Your [Auth Token](https://velt.dev/docs/security/auth-tokens.md).

# Body

#### Params

**data** `object` *required*

**properties**

**pageSize** `integer`

1–500. Default 50.

**cursor** `integer`

The previous response's `nextCursor` (last item's `updatedAt` epoch ms).

> [!NOTE]
>
> `List Definitions` does not accept `organizationId` or `documentId` filters. Every active definition in the workspace is returned, ordered by `updatedAt` DESC, regardless of each definition's `scope`. To narrow by scope, filter the returned `DefinitionView.scope` client-side.

> [!NOTE]
>
> Requires a Firestore composite index (`status` ASC, `updatedAt` DESC). The first list call after deploy may surface a one-time index-create URL.

## **Example Requests**

#### List the first page

```JSON theme={null}
{
  "data": {
    "pageSize": 50
  }
}
```

#### Paginate

```JSON theme={null}
{
  "data": {
    "pageSize": 50,
    "cursor": 1714300000000
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "items": [
      {
        "definitionId": "marketing-copy-approval",
        "name": "Marketing copy approval",
        "description": null,
        "version": 1,
        "scope": { "level": "apiKey", "organizationId": null, "documentId": null },
        "nodes": [
          { "nodeId": "agent-draft", "type": "agent", "config": { "agentId": "copy-agent-v1", "urlPath": "documentUrl" } }
        ],
        "edges": [],
        "groups": null,
        "compiled": { "forwardEdges": [], "loops": [] },
        "triggers": null,
        "tags": null,
        "custom": null,
        "createdAt": 1731432000000,
        "updatedAt": 1731432000000,
        "status": "active"
      }
    ],
    "nextCursor": null
  }
}
```

Each `DefinitionView` row includes the read-only `compiled` block (`compiled.forwardEdges` + `compiled.loops`) alongside the authored `edges`. See [Get Definition](https://velt.dev/docs/api-reference/rest-apis/v2/approval-engine/definitions/get-definition.md#the-compiled-block) for the `compiled` schema.

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
```

```js theme={null}
{
  "result": {
    "items": [],
    "nextCursor": null
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.