# Complete sign

URL: https://docs.hanzo.ai/docs/openapi/esign/post-esign-o-by-org-sign-by-token-complete

> Finishes your signing — and seals the document if you were the last.

`POST /v1/esign/o/{org}/sign/{token}/complete`

> [eSign →](https://docs.hanzo.ai/docs/openapi/esign) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                                               |
| ------------- | ------------------------------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/esign/o/{org}/sign/{token}/complete` |
| **Method**    | `POST`                                                        |
| **Operation** | `post_esign_o_by_org_sign_by_token_complete`                  |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`                        |

Finishes your signing — and seals the document if you were the
last.

It marks this recipient as done and answers whether the DOCUMENT sealed with it.
When every signing recipient has completed, sealing happens right here in the
same call: the collected values are rendered onto the PDF, a real x509 PKCS#7
signature is applied, the sealed bytes are stored beside the untouched original,
and the document moves to COMPLETED. Until then the answer is the recipient's
own completion with the document still pending.

It refuses to complete a half-filled signature: a recipient with any unfilled
field is a 400 naming how many remain. A document not out for signature is a
409, as is a recipient who has already completed, and under SEQUENTIAL order a
signer out of turn is a 403. The token is the whole credential — no account, and
a token that does not resolve under the org segment is a 404. Sealing and
completion are one transaction, so a failure anywhere leaves the document
exactly as it was.

## Request

2 fields.

| Field   | In   | Type   | Required | Description |
| ------- | ---- | ------ | -------- | ----------- |
| `org`   | path | string | yes      |             |
| `token` | path | string | yes      |             |

## Response

| Status    | Body                  | Meaning |
| --------- | --------------------- | ------- |
| `200`     | esign.esignCompletion | ok      |
| `default` | problem-details       | refused |

`200` body — 3 fields.

| Field            | In   | Type    | Always | Description                                                                                                                           |
| ---------------- | ---- | ------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------- |
| `documentStatus` | body | string  | —      | DocumentStatus is COMPLETED when this was the last signature and the document sealed here, PENDING while others have still to sign.   |
| `recipientId`    | body | string  | —      | RecipientID is the recipient who finished.                                                                                            |
| `sealed`         | body | boolean | —      | Sealed is whether the document sealed on this call — the field values rendered onto the PDF and a real x509 PKCS#7 signature applied. |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo esign o sign complete <org> <token>
```

**SDK**

**.ts**

```ts
import { Configuration, EsignApi } from 'hanzoai';

const api = new EsignApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postEsignOByOrgSignByTokenComplete({ org: 'org', token: 'token' });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import EsignApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = EsignApi(client).post_esign_o_by_org_sign_by_token_complete(org='org', token='token')
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.EsignAPI.PostEsignOByOrgSignByTokenComplete(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, esign_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = esign_api::post_esign_o_by_org_sign_by_token_complete(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.EsignApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new EsignApi(client).postEsignOByOrgSignByTokenComplete();
```

The method above is the one at the current release of the document. `hanzoai@8.5.914` (PyPI) was generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. [SDKs →](https://docs.hanzo.ai/docs/sdks)

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/esign/o/<org>/sign/<token>/complete \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP reaches **esign** through the `esign` tool, which names its 9 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_esign_documents"
         }
       }
     }'
```

---

[eSign API](https://docs.hanzo.ai/docs/openapi/esign) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
