# prov.attest.captureRequests.create

prov.attest.captureRequests.create in Node SDK. Create a capture request and send its link (201).

## Signature

```ts
prov.attest.captureRequests.create(params: CreateCaptureRequestParams): Promise<CaptureRequest>
```

## Parameters

- `params` (CreateCaptureRequestParams)

## Returns

`Promise<CaptureRequest>`

## HTTP operation

[`POST /v1/attest/capture_requests`](https://provenanceauth.com/docs/api/capture-requests.md#post-v1-attest-capture-requests): Create a capture request

## Errors

- [`attest_not_set_up`](https://provenanceauth.com/docs/platform/errors.md#attest_not_set_up)
- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`capture_contact_blocked`](https://provenanceauth.com/docs/platform/errors.md#capture_contact_blocked)
- [`capture_type_unavailable`](https://provenanceauth.com/docs/platform/errors.md#capture_type_unavailable)
- [`idempotency_key_reused`](https://provenanceauth.com/docs/platform/errors.md#idempotency_key_reused)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`invalid_json`](https://provenanceauth.com/docs/platform/errors.md#invalid_json)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`parameter_missing`](https://provenanceauth.com/docs/platform/errors.md#parameter_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`release_locale_unsupported`](https://provenanceauth.com/docs/platform/errors.md#release_locale_unsupported)

## Example

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/attest/capture_requests`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x", "Content-Type": "application/json" },
  body: JSON.stringify({
    "case_id": "CLM-DOCS-CAPTURE",
    "items": [
      {
        "type": "selfie",
        "label": "Your face"
      },
      {
        "type": "id_document",
        "label": "Driver's license",
        "instructions": "Lay it flat on a dark surface."
      },
      {
        "type": "video",
        "label": "Walk around the car",
        "max_duration_s": 30,
        "min_duration_s": 5
      },
      {
        "type": "photo",
        "label": "Capture images of the damage for your claim",
        "until_done": true
      }
    ],
    "contact": {
      "name": "Pat Rivera",
      "phone": "+14155550123",
      "email": "pat@example.com"
    },
    "channels": [
      "app_notification",
      "email",
      "text"
    ],
    "reminders": {
      "enabled": true,
      "after": [
        "24h",
        "36h"
      ]
    },
    "metadata": {
      "policy": "HB-4471"
    }
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/attest/capture_requests", headers={"Authorization": "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x"}, json={
    "case_id": "CLM-DOCS-CAPTURE",
    "items": [
        {
            "type": "selfie",
            "label": "Your face"
        },
        {
            "type": "id_document",
            "label": "Driver's license",
            "instructions": "Lay it flat on a dark surface."
        },
        {
            "type": "video",
            "label": "Walk around the car",
            "max_duration_s": 30,
            "min_duration_s": 5
        },
        {
            "type": "photo",
            "label": "Capture images of the damage for your claim",
            "until_done": True
        }
    ],
    "contact": {
        "name": "Pat Rivera",
        "phone": "+14155550123",
        "email": "pat@example.com"
    },
    "channels": [
        "app_notification",
        "email",
        "text"
    ],
    "reminders": {
        "enabled": True,
        "after": [
            "24h",
            "36h"
        ]
    },
    "metadata": {
        "policy": "HB-4471"
    }
}).json()
```
