# Request consent signature

Canonical page: https://docs.ovok.com/api/consent-signature/request-consent-signature

`POST /consent/signature/{consentId}`

Requests an e-signature for a FHIR `Consent`: Ovok renders the consent text as a PDF, uploads it to the e-signature service (Documenso) with the verifier as the signer, and returns the document metadata.

**Auth:** bearer token. Every FHIR read runs with your token, so you must be able to read the Consent and the resources it points to.

## Behaviour

- The Consent must have:
  - `patient` referencing a `Patient`;
  - a `provision.data` reference to a `Composition` that holds the consent text;
  - a `verification` entry whose `verifiedWith` references a `Patient` or `RelatedPerson`, with `verified` not `true`.
- The text comes from the Composition section coded `main-content`. It is a Handlebars template filled with `patient`, `signer` and `organization` (the display names of the patient, the verifier and the project).
- The signer's email is the first `email` entry in the verifier's `telecom`.
- The document language comes from the Composition's CMS language coding when it is one of `en`, `de`, `fr`, `es`, `it`, `pl`; otherwise `de`.
- On success an identifier with system `https://app.documenso.com` and the new document ID is added to the Consent. Each call creates a new signature document and adds another identifier.
- The response holds `numberOfPages`, `title`, `author`, `subject`, `documentId` and `email` (the signer's address).

## Example

```bash
curl -X POST 'https://api.sandbox.ovok.com/consent/signature/c3499c27-2973-0a7f-807e-fb8676a92dcb' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'
```
