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

# Get Definition

Use this API to fetch a workflow definition. Returns the full `DefinitionView`. Filters out tombstoned definitions.

# Endpoint

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

# 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="definitionId" type="string" required>
      The definition to fetch.
    </ParamField>

    <ParamField body="organizationId" type="string">
      Required when scoped to an organization or document.
    </ParamField>

    <ParamField body="documentId" type="string">
      Required when scoped to a document.
    </ParamField>
  </Expandable>
</ParamField>

## **Example Requests**

#### Get a definition

```JSON theme={null}
{
  "data": {
    "definitionId": "marketing-copy-approval"
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "definitionId": "marketing-copy-approval",
    "name": "Marketing copy approval",
    "description": null,
    "version": 1,
    "scope": { "level": "apiKey", "organizationId": null, "documentId": null },
    "nodes": [ /* full node array */ ],
    "edges": [ /* full edge array */ ],
    "groups": [ /* full group array */ ],
    "triggers": null,
    "tags": null,
    "custom": null,
    "createdAt": 1731432000000,
    "updatedAt": 1731432000000,
    "status": "active"
  }
}
```

#### Failure Response

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

**Errors:** `NOT_FOUND` (definition does not exist or is tombstoned) / `INVALID_ARGUMENT`.

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "definitionId": "marketing-copy-approval",
      "name": "Marketing copy approval",
      "description": null,
      "version": 1,
      "scope": { "level": "apiKey", "organizationId": null, "documentId": null },
      "nodes": [],
      "edges": [],
      "groups": [],
      "triggers": null,
      "tags": null,
      "custom": null,
      "createdAt": 1731432000000,
      "updatedAt": 1731432000000,
      "status": "active"
    }
  }
  ```
</ResponseExample>
