---
title: "Sign every document with one signature"
url: "https://developer.incode.com/api-reference/document-signature-sign/"
section: "api-reference"
group: "Electronic signature"
version: "v1.1"
status: "live"
endpoint: "POST /omni/document-signature/sign"
---
# Sign every document with one signature

`POST /omni/document-signature/sign`

Base URL: `https://demo-api.incodesmile.com` — Incode demo environment

Takes either a drawn signature (signatureBase64) or a typed name (typedName) and produces one signed PDF per document: the original plus an appended signature page for PDF, the signature page alone for MARKDOWN. A typed name is rendered in a cursive font. Every document shares the returned signatureId. documentIds is optional and lists every document the user was shown; when sent and it does not match the session's documents nothing is signed and the call fails with "Documents changed, reload them". Calling again after success returns the existing signature. Session token only. Scroll-to-end is enforced by the SDK and reported through interview events.

## Path & query parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `interviewId` | query | string |  |  |
| `api-version` | header | string | yes | Default: `1.0` |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `signatureBase64` | string |  | Base64 PNG of the handwritten signature drawn by the user. Exactly one of signatureBase64 and typedName is required |
| `typedName` | string |  | Name typed by the user instead of drawing; rendered in a cursive font on the signature page |
| `documentIds` | array[string] |  | Optional. documentId of every document the user was shown, as returned by GET /documents. When sent, the call is rejected if it does not match the session's current documents |

## Responses

### 200

OK

Response body (`application/json`):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `signatureId` | string |  |  |
| `signedAt` | integer (int64) |  |  |
| `documents` | array[DocumentSignatureDocumentDto] |  |  |
| `documents.documentId` | string |  |  |
| `documents.order` | integer (int32) |  | 1-based position in which the documents are shown |
| `documents.name` | string |  |  |
| `documents.format` | string |  | Enum: `PDF`, `MARKDOWN` |
| `documents.sha256` | string |  | Lowercase hex SHA-256 of the original bytes, also printed on the signature page |
| `documents.sizeBytes` | integer (int64) |  |  |
| `documents.signedAt` | integer (int64) |  | Epoch millis of the signature, null until signed |
| `documents.signatureId` | string |  | Shared by every document signed in the same call |
| `documents.content` | string |  | Markdown text, only for MARKDOWN documents |
| `documents.url` | string |  | Presigned URL of the original, valid one hour |
| `documents.signedUrl` | string |  | Presigned URL of the signed PDF: original plus signature page for PDF, the signature page alone for MARKDOWN. Null until signed. |

## Code samples

Generated from this endpoint's method, path, and the conventional Incode headers. The base URL is the Incode demo environment; replace `<YOUR_API_KEY>` with a key for your region.

### cURL

```bash
curl -X POST https://demo-api.incodesmile.com/omni/document-signature/sign?interviewId=%3CinterviewId%3E \
  -H "x-api-key: <YOUR_API_KEY>" \
  -H "X-Incode-Hardware-Id: <YOUR_INCODE_HARDWARE_ID>" \
  -H "api-version: 1.0" \
  -H "Content-Type: application/json"
```

### Node

```js
const res = await fetch("https://demo-api.incodesmile.com/omni/document-signature/sign?interviewId=%3CinterviewId%3E", {
  method: "POST",
  headers: {
      "x-api-key": "<YOUR_API_KEY>",
      "X-Incode-Hardware-Id": "<YOUR_INCODE_HARDWARE_ID>",
      "api-version": "1.0",
      "Content-Type": "application/json",
  },
});
const data = await res.json();
```

### Python

```python
import requests

headers = {
    "x-api-key": "<YOUR_API_KEY>",
    "X-Incode-Hardware-Id": "<YOUR_INCODE_HARDWARE_ID>",
    "api-version": "1.0",
    "Content-Type": "application/json",
}
res = requests.post("https://demo-api.incodesmile.com/omni/document-signature/sign?interviewId=%3CinterviewId%3E", headers=headers)
data = res.json()
```

### Java

```java
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://demo-api.incodesmile.com/omni/document-signature/sign?interviewId=%3CinterviewId%3E"))
    .header("x-api-key", "<YOUR_API_KEY>")
    .header("X-Incode-Hardware-Id", "<YOUR_INCODE_HARDWARE_ID>")
    .header("api-version", "1.0")
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> res = HttpClient.newHttpClient()
    .send(req, HttpResponse.BodyHandlers.ofString());
```

### Ruby

```
require "net/http"
require "json"

uri = URI("https://demo-api.incodesmile.com/omni/document-signature/sign?interviewId=%3CinterviewId%3E")
req = Net::HTTP::Post.new(uri)
req["x-api-key"] = "<YOUR_API_KEY>"
req["X-Incode-Hardware-Id"] = "<YOUR_INCODE_HARDWARE_ID>"
req["api-version"] = "1.0"
req["Content-Type"] = "application/json"

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)
```

### PHP

```
$ch = curl_init("https://demo-api.incodesmile.com/omni/document-signature/sign?interviewId=%3CinterviewId%3E");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "x-api-key: <YOUR_API_KEY>",
    "X-Incode-Hardware-Id: <YOUR_INCODE_HARDWARE_ID>",
    "api-version: 1.0",
    "Content-Type: application/json",
]);

$data = json_decode(curl_exec($ch), true);
curl_close($ch);
```

### Example response

```json
{
  "signatureId": "string",
  "signedAt": 0,
  "documents": [
    {
      "documentId": "string",
      "order": 0,
      "name": "string",
      "format": "PDF",
      "sha256": "string",
      "sizeBytes": 0,
      "signedAt": 0,
      "signatureId": "string",
      "content": "string",
      "url": "string",
      "signedUrl": "string"
    }
  ]
}
```
