> ## 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

<ParamField header="x-velt-api-key" type="string" required>
  Your API key.
</ParamField>

<ParamField header="x-velt-auth-token" type="string" required>
  Your [Auth Token](/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="pageSize" type="integer">
      1–500. Default 50.
    </ParamField>

    <ParamField body="cursor" type="integer">
      The previous response's `nextCursor` (last item's `updatedAt` epoch ms).
    </ParamField>

    <ParamField body="organizationId" type="string">
      Filter to a specific organization scope.
    </ParamField>

    <ParamField body="documentId" type="string">
      Filter to a specific document scope.
    </ParamField>
  </Expandable>
</ParamField>

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

## **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": [ /* DefinitionView[] */ ],
    "nextCursor": 1714300000000
  }
}
```

#### Failure Response

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

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "items": [],
      "nextCursor": 1714300000000
    }
  }
  ```
</ResponseExample>
