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

# Video Leads

> Retrieve CTA form submissions for a video.

Fetch all leads captured through the CTA form on a specific video. Leads are returned in reverse chronological order (most recent first).

## Endpoint

```
GET /v1/videos/:id/leads
```

## Authentication

Pass your API key as a Bearer token in the `Authorization` header.

<ParamField header="Authorization" type="string" required>
  Your API key. Format: `Bearer <api_key>`.
</ParamField>

## Path parameters

<ParamField path="id" type="number" required>
  The ID of the video to retrieve leads for.
</ParamField>

## Response

<ResponseField name="data" type="object" required>
  <Expandable title="properties" defaultOpen>
    <ResponseField name="leads" type="object[]" required>
      Array of lead objects ordered by most recent submission first. Empty array when no leads exist.

      <Expandable title="lead properties">
        <ResponseField name="id" type="number" required>
          Unique lead identifier.
        </ResponseField>

        <ResponseField name="video_id" type="number" required>
          ID of the video this lead was captured from.
        </ResponseField>

        <ResponseField name="response_data" type="object" required>
          Key-value map of the form fields submitted by the viewer. Field keys match the CTA form configuration on the domain.
        </ResponseField>

        <ResponseField name="submitted_at" type="string" required>
          ISO 8601 timestamp when the form was submitted.
        </ResponseField>

        <ResponseField name="internal_name" type="string" required>
          Name of the video at the time of submission.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<Note>
  This endpoint only returns leads from CTA form submissions. Clicks on external link CTAs are tracked separately in the `link_clicks` field returned by [Video Stats](/api-reference/videos/stats).
</Note>

## Error responses

| Status | Description                                       |
| ------ | ------------------------------------------------- |
| `400`  | The provided `id` is not a valid number.          |
| `404`  | No video found with the given ID in your account. |

## Examples

<CodeGroup>
  ```bash curl theme={null}
  curl --request GET \
    --url https://api.demomatic.tech/v1/videos/7/leads \
    --header 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```javascript JavaScript theme={null}
  const videoId = 7;

  const response = await fetch(`https://api.demomatic.tech/v1/videos/${videoId}/leads`, {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
    },
  });

  const { data } = await response.json();
  console.log(data.leads);
  ```
</CodeGroup>

### Response

```json 200 theme={null}
{
  "data": {
    "leads": [
      {
        "id": 42,
        "video_id": 7,
        "response_data": {
          "name": "Alice Smith",
          "email": "alice@example.com"
        },
        "submitted_at": "2024-01-15T10:30:00.000Z",
        "internal_name": "Product Tour Q1 2024"
      }
    ]
  }
}
```
