@assinafy/cli 2.6.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +1 -1
- package/README.en.md +50 -20
- package/README.md +38 -10
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/api.cjs +235 -34
- package/dist/api.cjs.map +1 -1
- package/dist/api.js +234 -34
- package/dist/api.js.map +1 -1
- package/dist/cli.cjs +365 -68
- package/dist/types/api/client.d.ts +2 -0
- package/dist/types/api/client.d.ts.map +1 -1
- package/dist/types/api/contract-types.d.ts +110 -0
- package/dist/types/api/contract-types.d.ts.map +1 -0
- package/dist/types/api/index.d.ts +2 -0
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/resources/assignments.d.ts +2 -2
- package/dist/types/api/resources/assignments.d.ts.map +1 -1
- package/dist/types/api/resources/authentication.d.ts +3 -3
- package/dist/types/api/resources/authentication.d.ts.map +1 -1
- package/dist/types/api/resources/contracts.d.ts +19 -0
- package/dist/types/api/resources/contracts.d.ts.map +1 -0
- package/dist/types/api/resources/documents.d.ts +4 -3
- package/dist/types/api/resources/documents.d.ts.map +1 -1
- package/dist/types/api/resources/webhooks.d.ts +4 -3
- package/dist/types/api/resources/webhooks.d.ts.map +1 -1
- package/dist/types/api/types.d.ts +69 -18
- package/dist/types/api/types.d.ts.map +1 -1
- package/dist/types/api/utils.d.ts +8 -2
- package/dist/types/api/utils.d.ts.map +1 -1
- package/docs/README.md +2 -1
- package/docs/api-operations.json +49 -1
- package/docs/api-reference.md +1454 -295
- package/docs/contracts.md +128 -0
- package/docs/documents.md +7 -4
- package/docs/oauth-guide.md +5 -5
- package/docs/sdk-reference.md +156 -15
- package/package.json +2 -2
package/docs/api-reference.md
CHANGED
|
@@ -6,8 +6,8 @@ The renderer reuses a generic 400 envelope for several non-400 errors; top-level
|
|
|
6
6
|
|
|
7
7
|
- OpenAPI: 3.1.0
|
|
8
8
|
- API document version: 1.0.0
|
|
9
|
-
- Operations:
|
|
10
|
-
- Contract SHA-256: `
|
|
9
|
+
- Operations: 118
|
|
10
|
+
- Contract SHA-256: `3672991376b65f82cd6dec0102dadd0cfe97045fd85dcab568cd0414a84cd050`
|
|
11
11
|
|
|
12
12
|
## Accounts
|
|
13
13
|
|
|
@@ -42,6 +42,9 @@ Retrieve a workspace account the user belongs to.
|
|
|
42
42
|
"owner"
|
|
43
43
|
],
|
|
44
44
|
"is_delete_allowed": true,
|
|
45
|
+
"limits": {
|
|
46
|
+
"webhook_endpoints": 1
|
|
47
|
+
},
|
|
45
48
|
"created_at": "2026-06-03T03:54:16Z"
|
|
46
49
|
},
|
|
47
50
|
"status": 200,
|
|
@@ -126,6 +129,9 @@ Example:
|
|
|
126
129
|
"owner"
|
|
127
130
|
],
|
|
128
131
|
"is_delete_allowed": true,
|
|
132
|
+
"limits": {
|
|
133
|
+
"webhook_endpoints": 1
|
|
134
|
+
},
|
|
129
135
|
"created_at": "2026-06-03T03:54:16Z"
|
|
130
136
|
},
|
|
131
137
|
"status": 200,
|
|
@@ -495,6 +501,9 @@ Called with an OAuth application token, this returns exactly one workspace: the
|
|
|
495
501
|
"owner"
|
|
496
502
|
],
|
|
497
503
|
"is_delete_allowed": true,
|
|
504
|
+
"limits": {
|
|
505
|
+
"webhook_endpoints": 1
|
|
506
|
+
},
|
|
498
507
|
"created_at": "2026-06-03T03:54:16Z"
|
|
499
508
|
}
|
|
500
509
|
],
|
|
@@ -564,6 +573,9 @@ Example:
|
|
|
564
573
|
"owner"
|
|
565
574
|
],
|
|
566
575
|
"is_delete_allowed": true,
|
|
576
|
+
"limits": {
|
|
577
|
+
"webhook_endpoints": 1
|
|
578
|
+
},
|
|
567
579
|
"created_at": "2026-06-03T03:54:16Z"
|
|
568
580
|
},
|
|
569
581
|
"status": 200,
|
|
@@ -605,7 +617,7 @@ Example:
|
|
|
605
617
|
|
|
606
618
|
`GET /v1/accounts/{accountId}/stats`
|
|
607
619
|
|
|
608
|
-
Precomputed per-account document-funnel KPIs. `granularity=monthly` (default) returns the last 12 months, most recent first; `granularity=daily` with `month=YYYY-MM` returns that month's days. Series are zero-filled.
|
|
620
|
+
Precomputed per-account document-funnel KPIs. `granularity=monthly` (default) returns the last 12 months, most recent first; `granularity=daily` with `month=YYYY-MM` returns that month's days. Series are zero-filled. Requires the `account:read` OAuth scope.
|
|
609
621
|
|
|
610
622
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
611
623
|
|
|
@@ -682,7 +694,7 @@ Precomputed per-account document-funnel KPIs. `granularity=monthly` (default) re
|
|
|
682
694
|
|
|
683
695
|
`GET /v1/documents/{documentId}/activities`
|
|
684
696
|
|
|
685
|
-
List the activities recorded for a document. Each entry carries an event-specific `payload` snapshot (keys vary per event) and the request `origin` (`ip`, `user-agent`).
|
|
697
|
+
List the activities recorded for a document, newest first (`sort=id` for oldest first). Paged: 20 per page by default; the `X-Pagination-Total-Count`, `X-Pagination-Page-Count`, `X-Pagination-Current-Page` and `X-Pagination-Per-Page` headers describe the full list, and a page past the end returns an empty `data`. Each entry carries an event-specific `payload` snapshot (keys vary per event) and the request `origin` (`ip`, `user-agent`).
|
|
686
698
|
|
|
687
699
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
688
700
|
|
|
@@ -691,6 +703,9 @@ List the activities recorded for a document. Each entry carries an event-specifi
|
|
|
691
703
|
| Name | In | Type | Required | Description |
|
|
692
704
|
|---|---|---|---|---|
|
|
693
705
|
| `documentId` | path | string | yes | Document ID. |
|
|
706
|
+
| `sort` | query | string | no | `-id` (default, newest first) or `id`. |
|
|
707
|
+
| `page` | query | integer | no | Page number. |
|
|
708
|
+
| `per-page` | query | integer | no | Records per page (max 100). |
|
|
694
709
|
|
|
695
710
|
#### Responses
|
|
696
711
|
|
|
@@ -737,7 +752,7 @@ List the activities recorded for a document. Each entry carries an event-specifi
|
|
|
737
752
|
|
|
738
753
|
`GET /v1/accounts/{accountId}/documents`
|
|
739
754
|
|
|
740
|
-
List documents of the workspace.
|
|
755
|
+
List documents of the workspace, most recently updated first. Every row includes its `assignment` and `pages`; an `expand` parameter is ignored. For a lighter list without them, use `GET /v1/accounts/{accountId}/documents/search`.
|
|
741
756
|
|
|
742
757
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
743
758
|
|
|
@@ -750,7 +765,7 @@ List documents of the workspace.
|
|
|
750
765
|
| `method` | query | string | no | Signature method filter. |
|
|
751
766
|
| `search` | query | string | no | Partial match on document.name, signer.full_name, signer.email. |
|
|
752
767
|
| `tags` | query | string | no | Comma-separated tag IDs; returns documents having ALL listed tags. |
|
|
753
|
-
| `sort` | query | string | no |
|
|
768
|
+
| `sort` | query | string | no | `name` or `updated_at`, ascending; prefix with `-` for descending (`-updated_at`, the default). Other values are ignored. |
|
|
754
769
|
| `page` | query | integer | no | Page number. |
|
|
755
770
|
| `per-page` | query | integer | no | Records per page (max 100). |
|
|
756
771
|
|
|
@@ -773,6 +788,8 @@ List documents of the workspace.
|
|
|
773
788
|
},
|
|
774
789
|
"is_closed": false,
|
|
775
790
|
"signing_url": "https://example.com/example-url-3",
|
|
791
|
+
"verification_code": "example_secret",
|
|
792
|
+
"verification_url": "https://example.com/example-url-4",
|
|
776
793
|
"decline_reason": null,
|
|
777
794
|
"declined_by": null,
|
|
778
795
|
"tags": [
|
|
@@ -788,9 +805,10 @@ List documents of the workspace.
|
|
|
788
805
|
"number": 1,
|
|
789
806
|
"height": 2100,
|
|
790
807
|
"width": 1275,
|
|
791
|
-
"download_url": "https://example.com/example-url-
|
|
808
|
+
"download_url": "https://example.com/example-url-5"
|
|
792
809
|
}
|
|
793
810
|
],
|
|
811
|
+
"has_contract": true,
|
|
794
812
|
"created_at": "2026-06-03T03:54:16Z",
|
|
795
813
|
"updated_at": "2026-06-03T03:54:16Z"
|
|
796
814
|
}
|
|
@@ -866,6 +884,8 @@ Example:
|
|
|
866
884
|
},
|
|
867
885
|
"is_closed": false,
|
|
868
886
|
"signing_url": "https://example.com/example-url-3",
|
|
887
|
+
"verification_code": "example_secret",
|
|
888
|
+
"verification_url": "https://example.com/example-url-4",
|
|
869
889
|
"decline_reason": null,
|
|
870
890
|
"declined_by": null,
|
|
871
891
|
"tags": [
|
|
@@ -881,9 +901,10 @@ Example:
|
|
|
881
901
|
"number": 1,
|
|
882
902
|
"height": 2100,
|
|
883
903
|
"width": 1275,
|
|
884
|
-
"download_url": "https://example.com/example-url-
|
|
904
|
+
"download_url": "https://example.com/example-url-5"
|
|
885
905
|
}
|
|
886
906
|
],
|
|
907
|
+
"has_contract": true,
|
|
887
908
|
"created_at": "2026-06-03T03:54:16Z",
|
|
888
909
|
"updated_at": "2026-06-03T03:54:16Z"
|
|
889
910
|
},
|
|
@@ -937,6 +958,7 @@ Search documents of the workspace, returning a compact representation (no expand
|
|
|
937
958
|
| `accountId` | path | string | yes | Workspace account ID. |
|
|
938
959
|
| `search` | query | string | no | Search term. |
|
|
939
960
|
| `status` | query | string | no | |
|
|
961
|
+
| `sort` | query | string | no | `name` or `updated_at`, ascending; prefix with `-` for descending (`-updated_at`, the default). Other values are ignored. |
|
|
940
962
|
| `page` | query | integer | no | Page number. |
|
|
941
963
|
| `per-page` | query | integer | no | Records per page (max 100). |
|
|
942
964
|
|
|
@@ -959,6 +981,8 @@ Search documents of the workspace, returning a compact representation (no expand
|
|
|
959
981
|
},
|
|
960
982
|
"is_closed": false,
|
|
961
983
|
"signing_url": "https://example.com/example-url-3",
|
|
984
|
+
"verification_code": "example_secret",
|
|
985
|
+
"verification_url": "https://example.com/example-url-4",
|
|
962
986
|
"decline_reason": null,
|
|
963
987
|
"declined_by": null,
|
|
964
988
|
"tags": [
|
|
@@ -974,9 +998,10 @@ Search documents of the workspace, returning a compact representation (no expand
|
|
|
974
998
|
"number": 1,
|
|
975
999
|
"height": 2100,
|
|
976
1000
|
"width": 1275,
|
|
977
|
-
"download_url": "https://example.com/example-url-
|
|
1001
|
+
"download_url": "https://example.com/example-url-5"
|
|
978
1002
|
}
|
|
979
1003
|
],
|
|
1004
|
+
"has_contract": true,
|
|
980
1005
|
"created_at": "2026-06-03T03:54:16Z",
|
|
981
1006
|
"updated_at": "2026-06-03T03:54:16Z"
|
|
982
1007
|
}
|
|
@@ -1070,7 +1095,7 @@ The supported document statuses and whether a document in each status can be del
|
|
|
1070
1095
|
|
|
1071
1096
|
`GET /v1/documents/{documentId}`
|
|
1072
1097
|
|
|
1073
|
-
Get a document by its ID. `decline_reason` is only present when the access token belongs to the document's creator.
|
|
1098
|
+
Get a document by its ID. `decline_reason` is only present when the access token belongs to the document's creator. With a signer access code (`signer-access-code`), only documents the signer has been sent are found, and `assignment` holds only the signer's own items, without `signers`, `signing_urls`, `copy_receivers` or `summary`.
|
|
1074
1099
|
|
|
1075
1100
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
1076
1101
|
|
|
@@ -1098,6 +1123,8 @@ Get a document by its ID. `decline_reason` is only present when the access token
|
|
|
1098
1123
|
},
|
|
1099
1124
|
"is_closed": false,
|
|
1100
1125
|
"signing_url": "https://example.com/example-url-3",
|
|
1126
|
+
"verification_code": "example_secret",
|
|
1127
|
+
"verification_url": "https://example.com/example-url-4",
|
|
1101
1128
|
"decline_reason": null,
|
|
1102
1129
|
"declined_by": null,
|
|
1103
1130
|
"tags": [
|
|
@@ -1113,9 +1140,10 @@ Get a document by its ID. `decline_reason` is only present when the access token
|
|
|
1113
1140
|
"number": 1,
|
|
1114
1141
|
"height": 2100,
|
|
1115
1142
|
"width": 1275,
|
|
1116
|
-
"download_url": "https://example.com/example-url-
|
|
1143
|
+
"download_url": "https://example.com/example-url-5"
|
|
1117
1144
|
}
|
|
1118
1145
|
],
|
|
1146
|
+
"has_contract": true,
|
|
1119
1147
|
"created_at": "2026-06-03T03:54:16Z",
|
|
1120
1148
|
"updated_at": "2026-06-03T03:54:16Z"
|
|
1121
1149
|
},
|
|
@@ -1256,6 +1284,8 @@ Example:
|
|
|
1256
1284
|
},
|
|
1257
1285
|
"is_closed": false,
|
|
1258
1286
|
"signing_url": "https://example.com/example-url-3",
|
|
1287
|
+
"verification_code": "example_secret",
|
|
1288
|
+
"verification_url": "https://example.com/example-url-4",
|
|
1259
1289
|
"decline_reason": null,
|
|
1260
1290
|
"declined_by": null,
|
|
1261
1291
|
"tags": [
|
|
@@ -1271,9 +1301,10 @@ Example:
|
|
|
1271
1301
|
"number": 1,
|
|
1272
1302
|
"height": 2100,
|
|
1273
1303
|
"width": 1275,
|
|
1274
|
-
"download_url": "https://example.com/example-url-
|
|
1304
|
+
"download_url": "https://example.com/example-url-5"
|
|
1275
1305
|
}
|
|
1276
1306
|
],
|
|
1307
|
+
"has_contract": true,
|
|
1277
1308
|
"created_at": "2026-06-03T03:54:16Z",
|
|
1278
1309
|
"updated_at": "2026-06-03T03:54:16Z"
|
|
1279
1310
|
},
|
|
@@ -1770,7 +1801,7 @@ Download the rendered image of a specific document page.
|
|
|
1770
1801
|
|
|
1771
1802
|
`POST /v1/accounts/{accountId}/templates/{templateId}/documents`
|
|
1772
1803
|
|
|
1773
|
-
Generate a new document from a template,
|
|
1804
|
+
Generate a new document from a template. The request is checked (roles, fields, balance) before it returns, but the assignment is created in the background, so the response has `status: uploaded` and `assignment: null`. Follow the outcome on `GET /v1/documents/{documentId}` or through webhooks: when the send succeeds the status moves to `pending_signature` and `assignment_created` is sent; when it fails the status becomes `failed`, `document_processing_failed` is sent with the reason, and nothing is charged. When the template has fields, every signing role used must have at least one field; otherwise `400`. A template with placed signer fields sends a `collect` assignment, so it cannot take a `DigitalCertificate` signer (`400`); certificate signing needs a template without placed signer fields. Provide one signer entry per template role. An entry with `id` uses that existing signer; an entry with `email` reuses the account's signer with that email or creates one.
|
|
1774
1805
|
|
|
1775
1806
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
1776
1807
|
|
|
@@ -1786,10 +1817,10 @@ Generate a new document from a template, creating its assignment in the same cal
|
|
|
1786
1817
|
Fields (`application/json`):
|
|
1787
1818
|
|
|
1788
1819
|
- `signers` (array, required) — One entry per template role.
|
|
1789
|
-
- `editor_fields` (array) —
|
|
1820
|
+
- `editor_fields` (array) — Values for the fields placed on the template's `Editor` role, baked into the generated document. The `Editor` role takes no `signers` entry: it is filled only through this list. Every field placed on it needs an entry with a non-empty `value` (`400` otherwise); when it has no fields, send nothing. In `signers`, every `Signer` role needs an entry (`400` otherwise), and a `CopyReceiver` role takes an entry only for someone who should receive the certified document; a copy receiver's `verification_method`, `notification_methods` and `step` are ignored.
|
|
1790
1821
|
- `name` (string) — Title for the document. Defaults to the template name.
|
|
1791
1822
|
- `message` (string) — Optional message sent to signers.
|
|
1792
|
-
- `expires_at` (string) — Assignment expiration date (ISO 8601). No expiration by default. Must be at least one hour in the future.
|
|
1823
|
+
- `expires_at` (string) — Assignment expiration date (ISO 8601). No expiration by default. Must be at least one hour in the future. A UTC offset in the value is honored (`2026-12-31T23:59:59-03:00` is `2027-01-01T02:59:59Z`); a value without one is read as UTC, and a date alone (`2026-12-31`) means 23:59 UTC that day.
|
|
1793
1824
|
- `tags` (array) — Tag names to attach to the new document. Names that don't exist are auto-created. The template's default-document-tags are always applied; values here are merged on top (duplicates removed).
|
|
1794
1825
|
|
|
1795
1826
|
Example:
|
|
@@ -1800,6 +1831,9 @@ Example:
|
|
|
1800
1831
|
{
|
|
1801
1832
|
"role_id": "example_id_10",
|
|
1802
1833
|
"id": "example_id_11",
|
|
1834
|
+
"email": "user1@example.com",
|
|
1835
|
+
"name": "Maria Silva",
|
|
1836
|
+
"whatsapp_phone_number": "+5500000000000",
|
|
1803
1837
|
"verification_method": "Email",
|
|
1804
1838
|
"notification_methods": [
|
|
1805
1839
|
"Email"
|
|
@@ -1840,6 +1874,8 @@ Example:
|
|
|
1840
1874
|
},
|
|
1841
1875
|
"is_closed": false,
|
|
1842
1876
|
"signing_url": "https://example.com/example-url-3",
|
|
1877
|
+
"verification_code": "example_secret",
|
|
1878
|
+
"verification_url": "https://example.com/example-url-4",
|
|
1843
1879
|
"decline_reason": null,
|
|
1844
1880
|
"declined_by": null,
|
|
1845
1881
|
"tags": [
|
|
@@ -1855,9 +1891,10 @@ Example:
|
|
|
1855
1891
|
"number": 1,
|
|
1856
1892
|
"height": 2100,
|
|
1857
1893
|
"width": 1275,
|
|
1858
|
-
"download_url": "https://example.com/example-url-
|
|
1894
|
+
"download_url": "https://example.com/example-url-5"
|
|
1859
1895
|
}
|
|
1860
1896
|
],
|
|
1897
|
+
"has_contract": true,
|
|
1861
1898
|
"created_at": "2026-06-03T03:54:16Z",
|
|
1862
1899
|
"updated_at": "2026-06-03T03:54:16Z"
|
|
1863
1900
|
},
|
|
@@ -1941,10 +1978,10 @@ Example:
|
|
|
1941
1978
|
{
|
|
1942
1979
|
"data": {
|
|
1943
1980
|
"documents": 1,
|
|
1944
|
-
"credits": 0,
|
|
1981
|
+
"credits": 0.9,
|
|
1945
1982
|
"needs_extra_document": true,
|
|
1946
1983
|
"extra_document_cost": 1,
|
|
1947
|
-
"total_credits":
|
|
1984
|
+
"total_credits": 1.9,
|
|
1948
1985
|
"breakdown": [
|
|
1949
1986
|
{
|
|
1950
1987
|
"code": "NotificationWhatsapp",
|
|
@@ -1955,7 +1992,7 @@ Example:
|
|
|
1955
1992
|
}
|
|
1956
1993
|
],
|
|
1957
1994
|
"document_balance": 0,
|
|
1958
|
-
"credit_balance":
|
|
1995
|
+
"credit_balance": 10,
|
|
1959
1996
|
"has_sufficient_resources": true,
|
|
1960
1997
|
"blocking_reason": null,
|
|
1961
1998
|
"message": null
|
|
@@ -1991,7 +2028,7 @@ Example:
|
|
|
1991
2028
|
|
|
1992
2029
|
`GET /v1/assignments`
|
|
1993
2030
|
|
|
1994
|
-
List the assignments
|
|
2031
|
+
List the workspace's assignments, oldest first. With an OAuth token the workspace is the token's; otherwise pass `accountId`. Each assignment carries its `document_id`.
|
|
1995
2032
|
|
|
1996
2033
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
1997
2034
|
|
|
@@ -1999,6 +2036,8 @@ List the assignments belonging to the authenticated user's current account.
|
|
|
1999
2036
|
|
|
2000
2037
|
| Name | In | Type | Required | Description |
|
|
2001
2038
|
|---|---|---|---|---|
|
|
2039
|
+
| `accountId` | query | string | no | The workspace ID. Required unless the request uses an OAuth token. |
|
|
2040
|
+
| `sort` | query | string | no | `created_at` (default, oldest first), `expires_at` or `id`; prefix with `-` for descending (`-created_at`, newest first). Unknown values are ignored. |
|
|
2002
2041
|
| `page` | query | integer | no | Page number. |
|
|
2003
2042
|
| `per-page` | query | integer | no | Records per page (max 100). |
|
|
2004
2043
|
|
|
@@ -2012,7 +2051,9 @@ List the assignments belonging to the authenticated user's current account.
|
|
|
2012
2051
|
{
|
|
2013
2052
|
"resource": "assignment",
|
|
2014
2053
|
"id": "example_id_13",
|
|
2015
|
-
"
|
|
2054
|
+
"document_id": "example_id_3",
|
|
2055
|
+
"created_at": "2026-06-03T03:54:16Z",
|
|
2056
|
+
"sender_email": "user2@example.com",
|
|
2016
2057
|
"method": "virtual",
|
|
2017
2058
|
"expires_at": null,
|
|
2018
2059
|
"message": null,
|
|
@@ -2030,7 +2071,7 @@ List the assignments belonging to the authenticated user's current account.
|
|
|
2030
2071
|
"resource": "signer",
|
|
2031
2072
|
"id": "example_id_14",
|
|
2032
2073
|
"full_name": "Example User",
|
|
2033
|
-
"email": "
|
|
2074
|
+
"email": "user3@example.com",
|
|
2034
2075
|
"whatsapp_phone_number": "+5500000000000",
|
|
2035
2076
|
"government_id": "00000000000",
|
|
2036
2077
|
"has_accepted_terms": false
|
|
@@ -2060,7 +2101,7 @@ List the assignments belonging to the authenticated user's current account.
|
|
|
2060
2101
|
"signing_urls": [
|
|
2061
2102
|
{
|
|
2062
2103
|
"signer_id": "example_id_5",
|
|
2063
|
-
"url": "https://example.com/example-url-
|
|
2104
|
+
"url": "https://example.com/example-url-6"
|
|
2064
2105
|
}
|
|
2065
2106
|
]
|
|
2066
2107
|
}
|
|
@@ -2096,6 +2137,8 @@ List the assignments belonging to the authenticated user's current account.
|
|
|
2096
2137
|
|
|
2097
2138
|
Request signatures on a document. Use `method: virtual` to sign without input fields, or `method: collect` to place input fields on specific pages.
|
|
2098
2139
|
|
|
2140
|
+
**Digital certificate signing works only on `virtual` assignments.** A `DigitalCertificate` signer cannot sign placed fields, so a `collect` assignment with one is refused with `400` before anything is charged.
|
|
2141
|
+
|
|
2099
2142
|
For **virtual**, the document may be in `uploaded`, `metadata_processing` or `metadata_ready`; it is promoted to `pending_signature` automatically once metadata processing completes. For **collect**, the document must be in `metadata_ready` (fields reference specific pages).
|
|
2100
2143
|
|
|
2101
2144
|
`step` controls signing order: signers sharing a step sign in parallel, and the next step is notified only after the previous step completes. If supplied, every signer must supply it and values must be contiguous starting at 1.
|
|
@@ -2112,11 +2155,11 @@ For **virtual**, the document may be in `uploaded`, `metadata_processing` or `me
|
|
|
2112
2155
|
|
|
2113
2156
|
Fields (`application/json`):
|
|
2114
2157
|
|
|
2115
|
-
- `method` (string, required)
|
|
2158
|
+
- `method` (string, required) — `virtual` signs without input fields; `collect` places input fields on pages. Signers with `DigitalCertificate` verification need `virtual` (`collect` returns `400`).
|
|
2116
2159
|
- `signers` (array, required)
|
|
2117
|
-
- `entries` (array) — Required for `collect`: field placements per page.
|
|
2160
|
+
- `entries` (array) — Required for `collect`: field placements per page. In `collect`, every signer listed in `signers` must appear once and own at least one field here; otherwise `400`.
|
|
2118
2161
|
- `message` (string) — Text included in the invitation email.
|
|
2119
|
-
- `expires_at` (string) — ISO 8601; default is no expiration. Must be at least one hour in the future.
|
|
2162
|
+
- `expires_at` (string) — ISO 8601; default is no expiration. Must be at least one hour in the future. A UTC offset in the value is honored (`2026-12-31T23:59:59-03:00` is `2027-01-01T02:59:59Z`); a value without one is read as UTC, and a date alone (`2026-12-31`) means 23:59 UTC that day.
|
|
2120
2163
|
- `copy_receivers` (array) — Signer IDs that only receive a copy.
|
|
2121
2164
|
|
|
2122
2165
|
Example — Create without input (method: virtual, with verification & notification methods):
|
|
@@ -2290,7 +2333,7 @@ Example — Create with input fields (method: collect):
|
|
|
2290
2333
|
"data": {
|
|
2291
2334
|
"resource": "assignment",
|
|
2292
2335
|
"id": "example_id_21",
|
|
2293
|
-
"sender_email": "
|
|
2336
|
+
"sender_email": "user2@example.com",
|
|
2294
2337
|
"method": "virtual",
|
|
2295
2338
|
"expires_at": "2021-09-30T21:00:00Z",
|
|
2296
2339
|
"message": null,
|
|
@@ -2298,7 +2341,7 @@ Example — Create with input fields (method: collect):
|
|
|
2298
2341
|
{
|
|
2299
2342
|
"id": "example_id_15",
|
|
2300
2343
|
"full_name": "Example User",
|
|
2301
|
-
"email": "
|
|
2344
|
+
"email": "user4@example.com",
|
|
2302
2345
|
"verification_method": "Email",
|
|
2303
2346
|
"notification_methods": [
|
|
2304
2347
|
"Email"
|
|
@@ -2310,7 +2353,7 @@ Example — Create with input fields (method: collect):
|
|
|
2310
2353
|
{
|
|
2311
2354
|
"id": "example_id_16",
|
|
2312
2355
|
"full_name": "Example User",
|
|
2313
|
-
"email": "
|
|
2356
|
+
"email": "user5@example.com",
|
|
2314
2357
|
"verification_method": "Whatsapp",
|
|
2315
2358
|
"notification_methods": [
|
|
2316
2359
|
"Whatsapp"
|
|
@@ -2328,7 +2371,7 @@ Example — Create with input fields (method: collect):
|
|
|
2328
2371
|
"signer": {
|
|
2329
2372
|
"id": "example_id_15",
|
|
2330
2373
|
"full_name": "Example User",
|
|
2331
|
-
"email": "
|
|
2374
|
+
"email": "user4@example.com"
|
|
2332
2375
|
},
|
|
2333
2376
|
"field": {
|
|
2334
2377
|
"id": "example_id_23",
|
|
@@ -2347,13 +2390,13 @@ Example — Create with input fields (method: collect):
|
|
|
2347
2390
|
{
|
|
2348
2391
|
"id": "example_id_15",
|
|
2349
2392
|
"full_name": "Example User",
|
|
2350
|
-
"email": "
|
|
2393
|
+
"email": "user4@example.com",
|
|
2351
2394
|
"completed": false
|
|
2352
2395
|
},
|
|
2353
2396
|
{
|
|
2354
2397
|
"id": "example_id_16",
|
|
2355
2398
|
"full_name": "Example User",
|
|
2356
|
-
"email": "
|
|
2399
|
+
"email": "user5@example.com",
|
|
2357
2400
|
"completed": false
|
|
2358
2401
|
}
|
|
2359
2402
|
]
|
|
@@ -2361,11 +2404,11 @@ Example — Create with input fields (method: collect):
|
|
|
2361
2404
|
"signing_urls": [
|
|
2362
2405
|
{
|
|
2363
2406
|
"signer_id": "example_id_15",
|
|
2364
|
-
"url": "https://example.com/example-url-
|
|
2407
|
+
"url": "https://example.com/example-url-7"
|
|
2365
2408
|
},
|
|
2366
2409
|
{
|
|
2367
2410
|
"signer_id": "example_id_16",
|
|
2368
|
-
"url": "https://example.com/example-url-
|
|
2411
|
+
"url": "https://example.com/example-url-8"
|
|
2369
2412
|
}
|
|
2370
2413
|
]
|
|
2371
2414
|
}
|
|
@@ -2381,7 +2424,7 @@ Example — Create with input fields (method: collect):
|
|
|
2381
2424
|
"data": {
|
|
2382
2425
|
"resource": "assignment",
|
|
2383
2426
|
"id": "example_id_13",
|
|
2384
|
-
"sender_email": "
|
|
2427
|
+
"sender_email": "user2@example.com",
|
|
2385
2428
|
"method": "collect",
|
|
2386
2429
|
"expires_at": "2021-09-30T21:00:00Z",
|
|
2387
2430
|
"message": null,
|
|
@@ -2389,7 +2432,7 @@ Example — Create with input fields (method: collect):
|
|
|
2389
2432
|
{
|
|
2390
2433
|
"id": "example_id_17",
|
|
2391
2434
|
"full_name": "Example User",
|
|
2392
|
-
"email": "
|
|
2435
|
+
"email": "user6@example.com",
|
|
2393
2436
|
"verification_method": "Email",
|
|
2394
2437
|
"notification_methods": [
|
|
2395
2438
|
"Email"
|
|
@@ -2401,7 +2444,7 @@ Example — Create with input fields (method: collect):
|
|
|
2401
2444
|
{
|
|
2402
2445
|
"id": "example_id_18",
|
|
2403
2446
|
"full_name": "Example User",
|
|
2404
|
-
"email": "
|
|
2447
|
+
"email": "user7@example.com",
|
|
2405
2448
|
"verification_method": "Whatsapp",
|
|
2406
2449
|
"notification_methods": [
|
|
2407
2450
|
"Whatsapp"
|
|
@@ -2420,12 +2463,12 @@ Example — Create with input fields (method: collect):
|
|
|
2420
2463
|
"number": 1,
|
|
2421
2464
|
"height": 2100,
|
|
2422
2465
|
"width": 1275,
|
|
2423
|
-
"download_url": "https://example.com/example-url-
|
|
2466
|
+
"download_url": "https://example.com/example-url-9"
|
|
2424
2467
|
},
|
|
2425
2468
|
"signer": {
|
|
2426
2469
|
"id": "example_id_17",
|
|
2427
2470
|
"full_name": "Example User",
|
|
2428
|
-
"email": "
|
|
2471
|
+
"email": "user6@example.com"
|
|
2429
2472
|
},
|
|
2430
2473
|
"field": {
|
|
2431
2474
|
"id": "example_id_20",
|
|
@@ -2451,12 +2494,12 @@ Example — Create with input fields (method: collect):
|
|
|
2451
2494
|
"number": 1,
|
|
2452
2495
|
"height": 2100,
|
|
2453
2496
|
"width": 1275,
|
|
2454
|
-
"download_url": "https://example.com/example-url-
|
|
2497
|
+
"download_url": "https://example.com/example-url-9"
|
|
2455
2498
|
},
|
|
2456
2499
|
"signer": {
|
|
2457
2500
|
"id": "example_id_18",
|
|
2458
2501
|
"full_name": "Example User",
|
|
2459
|
-
"email": "
|
|
2502
|
+
"email": "user7@example.com"
|
|
2460
2503
|
},
|
|
2461
2504
|
"field": {
|
|
2462
2505
|
"id": "example_id_20",
|
|
@@ -2483,13 +2526,13 @@ Example — Create with input fields (method: collect):
|
|
|
2483
2526
|
{
|
|
2484
2527
|
"id": "example_id_17",
|
|
2485
2528
|
"full_name": "Example User",
|
|
2486
|
-
"email": "
|
|
2529
|
+
"email": "user6@example.com",
|
|
2487
2530
|
"completed": false
|
|
2488
2531
|
},
|
|
2489
2532
|
{
|
|
2490
2533
|
"id": "example_id_18",
|
|
2491
2534
|
"full_name": "Example User",
|
|
2492
|
-
"email": "
|
|
2535
|
+
"email": "user7@example.com",
|
|
2493
2536
|
"completed": false
|
|
2494
2537
|
}
|
|
2495
2538
|
]
|
|
@@ -2497,11 +2540,11 @@ Example — Create with input fields (method: collect):
|
|
|
2497
2540
|
"signing_urls": [
|
|
2498
2541
|
{
|
|
2499
2542
|
"signer_id": "example_id_17",
|
|
2500
|
-
"url": "https://example.com/example-url-
|
|
2543
|
+
"url": "https://example.com/example-url-10"
|
|
2501
2544
|
},
|
|
2502
2545
|
{
|
|
2503
2546
|
"signer_id": "example_id_18",
|
|
2504
|
-
"url": "https://example.com/example-url-
|
|
2547
|
+
"url": "https://example.com/example-url-11"
|
|
2505
2548
|
}
|
|
2506
2549
|
]
|
|
2507
2550
|
}
|
|
@@ -2554,8 +2597,16 @@ Per-unit costs (in credits) used to build the estimate:
|
|
|
2554
2597
|
| Email notification | 0 credits |
|
|
2555
2598
|
| WhatsApp notification | 0.45 credits |
|
|
2556
2599
|
| Digital certificate signature (per signer) | 0.5 credits |
|
|
2600
|
+
| Identity document verification (per signer) | depends on the plan, see the table below |
|
|
2601
|
+
|
|
2602
|
+
| Plan | Price per signer |
|
|
2603
|
+
|------|------------------|
|
|
2604
|
+
| Free | 1.5 credits |
|
|
2605
|
+
| Standard | 1 credit |
|
|
2606
|
+
| Pro | 0.5 credits |
|
|
2607
|
+
| Other plans and enterprise contracts | 0.25 credits |
|
|
2557
2608
|
|
|
2558
|
-
|
|
2609
|
+
`Email` and `Whatsapp` verification are not priced separately — their only line in the `breakdown` is their notification. A `Whatsapp`-verified signer therefore shows up as a WhatsApp notification, because that channel is mandatory for that verification method. A `DigitalCertificate` signer adds the digital-certificate signature cost **on top of** its notification cost; it appears in the `breakdown` under the `SignatureDigitalCertificate` code. An `IdDocumentFaceMatchBasic` signer likewise adds your plan's verification price on top of its notification, under the `VerificationIdDocumentFaceMatchBasic` code.
|
|
2559
2610
|
|
|
2560
2611
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
2561
2612
|
|
|
@@ -2569,7 +2620,7 @@ Verification methods are not priced separately — every line in the `breakdown`
|
|
|
2569
2620
|
|
|
2570
2621
|
Fields (`application/json`):
|
|
2571
2622
|
|
|
2572
|
-
- `method` (string)
|
|
2623
|
+
- `method` (string) — Send the method you will create the assignment with. With `collect`, a `DigitalCertificate` signer returns `400`, because certificate signing works only on `virtual` assignments.
|
|
2573
2624
|
- `signers` (array) — Required for `virtual`; each entry may be `{}` to default to Email.
|
|
2574
2625
|
- `entries` (array) — Required for `collect`.
|
|
2575
2626
|
|
|
@@ -2600,10 +2651,10 @@ Example:
|
|
|
2600
2651
|
{
|
|
2601
2652
|
"data": {
|
|
2602
2653
|
"documents": 1,
|
|
2603
|
-
"credits": 0,
|
|
2654
|
+
"credits": 0.9,
|
|
2604
2655
|
"needs_extra_document": true,
|
|
2605
2656
|
"extra_document_cost": 1,
|
|
2606
|
-
"total_credits":
|
|
2657
|
+
"total_credits": 1.9,
|
|
2607
2658
|
"breakdown": [
|
|
2608
2659
|
{
|
|
2609
2660
|
"code": "NotificationWhatsapp",
|
|
@@ -2614,7 +2665,7 @@ Example:
|
|
|
2614
2665
|
}
|
|
2615
2666
|
],
|
|
2616
2667
|
"document_balance": 0,
|
|
2617
|
-
"credit_balance":
|
|
2668
|
+
"credit_balance": 10,
|
|
2618
2669
|
"has_sufficient_resources": true,
|
|
2619
2670
|
"blocking_reason": null,
|
|
2620
2671
|
"message": null
|
|
@@ -2658,7 +2709,7 @@ Example:
|
|
|
2658
2709
|
|
|
2659
2710
|
`PUT /v1/documents/{documentId}/assignments/{assignmentId}/signers/{signerId}/resend`
|
|
2660
2711
|
|
|
2661
|
-
Resend the signature-request notification to a
|
|
2712
|
+
Resend the signature-request notification to a signer of the assignment who has not signed yet, while the document is pending signature. Paid notification methods are charged for each message that goes out.
|
|
2662
2713
|
|
|
2663
2714
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
2664
2715
|
|
|
@@ -2686,6 +2737,10 @@ Resend the signature-request notification to a specific signer of an assignment.
|
|
|
2686
2737
|
}
|
|
2687
2738
|
```
|
|
2688
2739
|
|
|
2740
|
+
##### 400 — The document is not pending signature, the signer is not part of the assignment, has already signed, or waits for an earlier signing step; or the account lacks credits for the reminder.
|
|
2741
|
+
|
|
2742
|
+
##### 404 — The assignment or signer was not found on this document.
|
|
2743
|
+
|
|
2689
2744
|
##### 401 — Missing or invalid credentials.
|
|
2690
2745
|
|
|
2691
2746
|
```json
|
|
@@ -2710,7 +2765,7 @@ Resend the signature-request notification to a specific signer of an assignment.
|
|
|
2710
2765
|
|
|
2711
2766
|
`POST /v1/documents/{documentId}/assignments/{assignmentId}/signers/{signerId}/estimate-resend-cost`
|
|
2712
2767
|
|
|
2713
|
-
Estimate the cost of resending the signature request to a signer.
|
|
2768
|
+
Estimate the cost of resending the signature request to a signer. The response has its own shape (`total`, not `total_credits`), because a reminder uses no document.
|
|
2714
2769
|
|
|
2715
2770
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
2716
2771
|
|
|
@@ -2729,25 +2784,16 @@ Estimate the cost of resending the signature request to a signer.
|
|
|
2729
2784
|
```json
|
|
2730
2785
|
{
|
|
2731
2786
|
"data": {
|
|
2732
|
-
"
|
|
2733
|
-
"credits": 0,
|
|
2734
|
-
"needs_extra_document": true,
|
|
2735
|
-
"extra_document_cost": 1,
|
|
2736
|
-
"total_credits": 0,
|
|
2787
|
+
"total": 0.45,
|
|
2737
2788
|
"breakdown": [
|
|
2738
2789
|
{
|
|
2739
|
-
"code": "
|
|
2740
|
-
"name": "Whatsapp Notification",
|
|
2741
|
-
"cost": 0.
|
|
2742
|
-
"quantity": 2,
|
|
2743
|
-
"unit_cost": 0.45
|
|
2790
|
+
"code": "NotificationWhatsappResend",
|
|
2791
|
+
"name": "Whatsapp Notification Resend",
|
|
2792
|
+
"cost": 0.45
|
|
2744
2793
|
}
|
|
2745
2794
|
],
|
|
2746
|
-
"
|
|
2747
|
-
"
|
|
2748
|
-
"has_sufficient_resources": true,
|
|
2749
|
-
"blocking_reason": null,
|
|
2750
|
-
"message": null
|
|
2795
|
+
"credit_balance": 10,
|
|
2796
|
+
"has_sufficient_credits": true
|
|
2751
2797
|
},
|
|
2752
2798
|
"status": 200,
|
|
2753
2799
|
"message": ""
|
|
@@ -2793,7 +2839,7 @@ Set a new expiration date for an assignment, or remove its expiration by sending
|
|
|
2793
2839
|
|
|
2794
2840
|
Fields (`application/json`):
|
|
2795
2841
|
|
|
2796
|
-
- `expires_at` (string | null, required) — New expiration date (ISO 8601). Must be at least one hour in the future. Send `null` to remove the expiration — the key itself is required.
|
|
2842
|
+
- `expires_at` (string | null, required) — New expiration date (ISO 8601). Must be at least one hour in the future. Send `null` to remove the expiration — the key itself is required. A UTC offset in the value is honored (`2026-12-31T23:59:59-03:00` is `2027-01-01T02:59:59Z`); a value without one is read as UTC, and a date alone (`2026-12-31`) means 23:59 UTC that day.
|
|
2797
2843
|
|
|
2798
2844
|
Example:
|
|
2799
2845
|
|
|
@@ -2812,7 +2858,9 @@ Example:
|
|
|
2812
2858
|
"data": {
|
|
2813
2859
|
"resource": "assignment",
|
|
2814
2860
|
"id": "example_id_13",
|
|
2815
|
-
"
|
|
2861
|
+
"document_id": "example_id_3",
|
|
2862
|
+
"created_at": "2026-06-03T03:54:16Z",
|
|
2863
|
+
"sender_email": "user2@example.com",
|
|
2816
2864
|
"method": "virtual",
|
|
2817
2865
|
"expires_at": null,
|
|
2818
2866
|
"message": null,
|
|
@@ -2830,7 +2878,7 @@ Example:
|
|
|
2830
2878
|
"resource": "signer",
|
|
2831
2879
|
"id": "example_id_14",
|
|
2832
2880
|
"full_name": "Example User",
|
|
2833
|
-
"email": "
|
|
2881
|
+
"email": "user3@example.com",
|
|
2834
2882
|
"whatsapp_phone_number": "+5500000000000",
|
|
2835
2883
|
"government_id": "00000000000",
|
|
2836
2884
|
"has_accepted_terms": false
|
|
@@ -2860,7 +2908,7 @@ Example:
|
|
|
2860
2908
|
"signing_urls": [
|
|
2861
2909
|
{
|
|
2862
2910
|
"signer_id": "example_id_5",
|
|
2863
|
-
"url": "https://example.com/example-url-
|
|
2911
|
+
"url": "https://example.com/example-url-6"
|
|
2864
2912
|
}
|
|
2865
2913
|
]
|
|
2866
2914
|
},
|
|
@@ -2914,7 +2962,7 @@ Example:
|
|
|
2914
2962
|
`GET /v1/documents/{documentId}/assignments/{assignmentId}/signers/{signerId}/identity-verification`
|
|
2915
2963
|
|
|
2916
2964
|
The signer's identity-document verification as the account's reviewer sees it. When the provider sends a verification to review, the account decides it with **Decide signer identity review**. The signer can still view and sign meanwhile; the review holds the document's certification instead (status `pending_identity_review` once every signer has signed).
|
|
2917
|
-
Evidence is a summary kept by Assinafy (no images or biometrics). `evidence_available` is false when the provider keeps none or it could not be fetched yet. While the review is open, `images` lists the evidence images the reviewer can open with **Signer identity review image**. A verification the provider approved directly, without a review, shows no evidence here (`evidence_available` is false); its evidence is on the `signer_identity_verified` activity.
|
|
2965
|
+
Evidence is a summary kept by Assinafy (no images or biometrics). `evidence_available` is false when the provider keeps none or it could not be fetched yet. While the review is open, `images` lists the evidence images the reviewer can open with **Signer identity review image**. A verification the provider approved directly, without a review, shows no evidence here (`evidence_available` is false); its evidence is on the `signer_identity_verified` activity. Reachable with the `documents:read` OAuth scope, but the images and the decision are not available to OAuth applications (`403`): the review is made by a person in Assinafy.
|
|
2918
2966
|
|
|
2919
2967
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
2920
2968
|
|
|
@@ -3000,7 +3048,7 @@ Evidence is a summary kept by Assinafy (no images or biometrics). `evidence_avai
|
|
|
3000
3048
|
|
|
3001
3049
|
`GET /v1/documents/{documentId}/assignments/{assignmentId}/signers/{signerId}/identity-verification/images/{name}`
|
|
3002
3050
|
|
|
3003
|
-
One evidence image of a signer identity verification that is `InReview`, for the account's reviewer: the document photos (or the digital document PDF) and the face photo. Fetched from the verification provider on each request and never stored by Assinafy. Available only while the review is open; once it is decided, every image returns 404. `name` must be one of the review's `images`.
|
|
3051
|
+
One evidence image of a signer identity verification that is `InReview`, for the account's reviewer: the document photos (or the digital document PDF) and the face photo. Fetched from the verification provider on each request and never stored by Assinafy. Available only while the review is open; once it is decided, every image returns 404. `name` must be one of the review's `images`. Not available to OAuth applications (`403`): the images are for the person reviewing.
|
|
3004
3052
|
|
|
3005
3053
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
3006
3054
|
|
|
@@ -3043,7 +3091,7 @@ One evidence image of a signer identity verification that is `InReview`, for the
|
|
|
3043
3091
|
|
|
3044
3092
|
`POST /v1/documents/{documentId}/assignments/{assignmentId}/signers/{signerId}/identity-verification/review`
|
|
3045
3093
|
|
|
3046
|
-
Approves or rejects a signer whose identity verification is `InReview`, while the document is `pending_signature` or `pending_identity_review`. Approved: once every signer has signed and no other signer is under review, the document is certificated; the certificate states the approval by review and every difference found. Rejected: the document is cancelled (`rejected_by_user`, with the reviewer as the user) and every signer and copy receiver gets the cancellation notice; the note is never shown to them. The signer gets no message about the decision itself. The decision is also reported to the verification provider.
|
|
3094
|
+
Approves or rejects a signer whose identity verification is `InReview`, while the document is `pending_signature` or `pending_identity_review`. Approved: once every signer has signed and no other signer is under review, the document is certificated; the certificate states the approval by review and every difference found. Rejected: the document is cancelled (`rejected_by_user`, with the reviewer as the user) and every signer and copy receiver gets the cancellation notice; the note is never shown to them. The signer gets no message about the decision itself. The decision is also reported to the verification provider. Not available to OAuth applications (`403`): the certificate names the person who reviewed, so the decision is made in Assinafy.
|
|
3047
3095
|
|
|
3048
3096
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
3049
3097
|
|
|
@@ -3166,7 +3214,7 @@ List all WhatsApp notification messages sent for an assignment. The response inc
|
|
|
3166
3214
|
{
|
|
3167
3215
|
"data": [
|
|
3168
3216
|
{
|
|
3169
|
-
"sent_at":
|
|
3217
|
+
"sent_at": "2026-07-07T12:00:00Z",
|
|
3170
3218
|
"header": "Documento para assinatura: Contrato de Servico",
|
|
3171
3219
|
"body": "string",
|
|
3172
3220
|
"buttons": [
|
|
@@ -3224,7 +3272,7 @@ Example:
|
|
|
3224
3272
|
|
|
3225
3273
|
```json
|
|
3226
3274
|
{
|
|
3227
|
-
"email": "
|
|
3275
|
+
"email": "user8@example.com",
|
|
3228
3276
|
"password": "example_secret"
|
|
3229
3277
|
}
|
|
3230
3278
|
```
|
|
@@ -3240,7 +3288,7 @@ Example:
|
|
|
3240
3288
|
"user": {
|
|
3241
3289
|
"id": "example_id_28",
|
|
3242
3290
|
"name": "John Smith",
|
|
3243
|
-
"email": "
|
|
3291
|
+
"email": "user9@example.com",
|
|
3244
3292
|
"telephone": "+5500000000000",
|
|
3245
3293
|
"government_id": "00000000000",
|
|
3246
3294
|
"is_email_verified": false,
|
|
@@ -3303,7 +3351,7 @@ Example:
|
|
|
3303
3351
|
|
|
3304
3352
|
```json
|
|
3305
3353
|
{
|
|
3306
|
-
"email": "
|
|
3354
|
+
"email": "user8@example.com"
|
|
3307
3355
|
}
|
|
3308
3356
|
```
|
|
3309
3357
|
|
|
@@ -3314,7 +3362,7 @@ Example:
|
|
|
3314
3362
|
```json
|
|
3315
3363
|
{
|
|
3316
3364
|
"data": {
|
|
3317
|
-
"email": "
|
|
3365
|
+
"email": "user8@example.com"
|
|
3318
3366
|
},
|
|
3319
3367
|
"status": 200,
|
|
3320
3368
|
"message": ""
|
|
@@ -3351,7 +3399,7 @@ Example:
|
|
|
3351
3399
|
|
|
3352
3400
|
```json
|
|
3353
3401
|
{
|
|
3354
|
-
"email": "
|
|
3402
|
+
"email": "user8@example.com",
|
|
3355
3403
|
"token": "example_secret",
|
|
3356
3404
|
"new_password": "example_secret"
|
|
3357
3405
|
}
|
|
@@ -3364,7 +3412,7 @@ Example:
|
|
|
3364
3412
|
```json
|
|
3365
3413
|
{
|
|
3366
3414
|
"data": {
|
|
3367
|
-
"email": "
|
|
3415
|
+
"email": "user8@example.com"
|
|
3368
3416
|
},
|
|
3369
3417
|
"status": 200,
|
|
3370
3418
|
"message": ""
|
|
@@ -3411,7 +3459,7 @@ Example:
|
|
|
3411
3459
|
|
|
3412
3460
|
```json
|
|
3413
3461
|
{
|
|
3414
|
-
"email": "
|
|
3462
|
+
"email": "user8@example.com",
|
|
3415
3463
|
"password": "example_secret",
|
|
3416
3464
|
"new_password": "example_secret"
|
|
3417
3465
|
}
|
|
@@ -3424,7 +3472,7 @@ Example:
|
|
|
3424
3472
|
```json
|
|
3425
3473
|
{
|
|
3426
3474
|
"data": {
|
|
3427
|
-
"email": "
|
|
3475
|
+
"email": "user8@example.com"
|
|
3428
3476
|
},
|
|
3429
3477
|
"status": 200,
|
|
3430
3478
|
"message": ""
|
|
@@ -3496,7 +3544,7 @@ Example:
|
|
|
3496
3544
|
"user": {
|
|
3497
3545
|
"id": "example_id_28",
|
|
3498
3546
|
"name": "John Smith",
|
|
3499
|
-
"email": "
|
|
3547
|
+
"email": "user9@example.com",
|
|
3500
3548
|
"telephone": "+5500000000000",
|
|
3501
3549
|
"government_id": "00000000000",
|
|
3502
3550
|
"is_email_verified": false,
|
|
@@ -3625,7 +3673,7 @@ Example:
|
|
|
3625
3673
|
"data": {
|
|
3626
3674
|
"id": "example_id_29",
|
|
3627
3675
|
"secret": "example_secret",
|
|
3628
|
-
"provisioning_uri": "https://example.com/example-url-
|
|
3676
|
+
"provisioning_uri": "https://example.com/example-url-12"
|
|
3629
3677
|
},
|
|
3630
3678
|
"status": 200,
|
|
3631
3679
|
"message": ""
|
|
@@ -3927,7 +3975,7 @@ Example:
|
|
|
3927
3975
|
"user": {
|
|
3928
3976
|
"id": "example_id_28",
|
|
3929
3977
|
"name": "John Smith",
|
|
3930
|
-
"email": "
|
|
3978
|
+
"email": "user9@example.com",
|
|
3931
3979
|
"telephone": "+5500000000000",
|
|
3932
3980
|
"government_id": "00000000000",
|
|
3933
3981
|
"is_email_verified": false,
|
|
@@ -4175,15 +4223,13 @@ Delete the existing API key.
|
|
|
4175
4223
|
}
|
|
4176
4224
|
```
|
|
4177
4225
|
|
|
4178
|
-
##
|
|
4179
|
-
|
|
4180
|
-
### List fields
|
|
4226
|
+
## Contracts
|
|
4181
4227
|
|
|
4182
|
-
|
|
4228
|
+
### List contracts
|
|
4183
4229
|
|
|
4184
|
-
|
|
4230
|
+
`GET /v1/accounts/{accountId}/contracts`
|
|
4185
4231
|
|
|
4186
|
-
|
|
4232
|
+
List the contract terms tracked on the workspace's documents, most recently updated first. Every filter is optional and only narrows the list. To catch up after a webhook that never arrived, page this list until the contracts are older than your last sync: every change to the terms, by a user or by the hourly run, moves `updated_at`. Each document's history of contract events is at `GET /v1/documents/{documentId}/activities`.
|
|
4187
4233
|
|
|
4188
4234
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
4189
4235
|
|
|
@@ -4192,32 +4238,134 @@ When `include_standard` is enabled, records of type `signature`, `initial` and `
|
|
|
4192
4238
|
| Name | In | Type | Required | Description |
|
|
4193
4239
|
|---|---|---|---|---|
|
|
4194
4240
|
| `accountId` | path | string | yes | Workspace account ID. |
|
|
4195
|
-
| `
|
|
4196
|
-
| `
|
|
4241
|
+
| `status` | query | array | no | Contract status; several, comma-separated, match any of them. |
|
|
4242
|
+
| `counterparty` | query | string | no | Part of the counterparty name, or its exact CPF/CNPJ. |
|
|
4243
|
+
| `search` | query | string | no | Part of the document's name. |
|
|
4244
|
+
| `end_date_from` | query | string | no | Contracts ending on or after this date. |
|
|
4245
|
+
| `end_date_to` | query | string | no | Contracts ending on or before this date. |
|
|
4246
|
+
| `ending_within_days` | query | integer | no | Contracts ending from today (the API's calendar day, Brasília time) to that many days later, both included; `0` is today. Any status: add `status=active` for the ones still in force. |
|
|
4247
|
+
| `external_system` | query | string | no | System of an external reference, e.g. `hubspot`. |
|
|
4248
|
+
| `external_id` | query | string | no | ID of an external reference in that system. |
|
|
4249
|
+
| `sort` | query | string | no | `end_date` or `updated_at`; prefix with `-` for descending (`-updated_at`, the default). Contracts without an end date come last either way. |
|
|
4250
|
+
| `expand` | query | string | no | `document` embeds each contract's document. |
|
|
4251
|
+
| `page` | query | integer | no | Page number. |
|
|
4252
|
+
| `per-page` | query | integer | no | Records per page (max 100). |
|
|
4197
4253
|
|
|
4198
4254
|
#### Responses
|
|
4199
4255
|
|
|
4200
|
-
##### 200 —
|
|
4256
|
+
##### 200 — A page of contracts
|
|
4257
|
+
|
|
4258
|
+
**A page of contracts**
|
|
4201
4259
|
|
|
4202
4260
|
```json
|
|
4203
4261
|
{
|
|
4262
|
+
"status": 200,
|
|
4263
|
+
"message": "",
|
|
4204
4264
|
"data": [
|
|
4205
4265
|
{
|
|
4206
|
-
"
|
|
4207
|
-
"
|
|
4208
|
-
"
|
|
4209
|
-
"
|
|
4210
|
-
"
|
|
4211
|
-
"
|
|
4212
|
-
"
|
|
4213
|
-
"
|
|
4214
|
-
"
|
|
4215
|
-
"
|
|
4216
|
-
"
|
|
4266
|
+
"document_id": "example_id_30",
|
|
4267
|
+
"status": "active",
|
|
4268
|
+
"counterparty_name": "Acme Ltda",
|
|
4269
|
+
"counterparty_taxpayer_id": "00000000000",
|
|
4270
|
+
"value": 120000.5,
|
|
4271
|
+
"currency": "BRL",
|
|
4272
|
+
"start_date": "2026-11-01",
|
|
4273
|
+
"end_date": "2027-10-31",
|
|
4274
|
+
"auto_renew": true,
|
|
4275
|
+
"renewal_term_months": 12,
|
|
4276
|
+
"notice_period_days": 30,
|
|
4277
|
+
"term": 1,
|
|
4278
|
+
"owner_id": "example_id_31",
|
|
4279
|
+
"metadata": {
|
|
4280
|
+
"crm_stage": "won"
|
|
4281
|
+
},
|
|
4282
|
+
"external_references": [
|
|
4283
|
+
{
|
|
4284
|
+
"system": "hubspot",
|
|
4285
|
+
"id": "example_id_32"
|
|
4286
|
+
}
|
|
4287
|
+
],
|
|
4288
|
+
"created_at": "2026-10-23T12:00:00Z",
|
|
4289
|
+
"updated_at": "2026-10-23T12:00:00Z"
|
|
4217
4290
|
}
|
|
4218
|
-
]
|
|
4291
|
+
]
|
|
4292
|
+
}
|
|
4293
|
+
```
|
|
4294
|
+
|
|
4295
|
+
**A page of contracts with their documents (expand=document)**
|
|
4296
|
+
|
|
4297
|
+
```json
|
|
4298
|
+
{
|
|
4219
4299
|
"status": 200,
|
|
4220
|
-
"message": ""
|
|
4300
|
+
"message": "",
|
|
4301
|
+
"data": [
|
|
4302
|
+
{
|
|
4303
|
+
"document_id": "example_id_30",
|
|
4304
|
+
"status": "active",
|
|
4305
|
+
"counterparty_name": "Acme Ltda",
|
|
4306
|
+
"counterparty_taxpayer_id": "00000000000",
|
|
4307
|
+
"value": 120000.5,
|
|
4308
|
+
"currency": "BRL",
|
|
4309
|
+
"start_date": "2026-11-01",
|
|
4310
|
+
"end_date": "2027-10-31",
|
|
4311
|
+
"auto_renew": true,
|
|
4312
|
+
"renewal_term_months": 12,
|
|
4313
|
+
"notice_period_days": 30,
|
|
4314
|
+
"term": 1,
|
|
4315
|
+
"owner_id": "example_id_31",
|
|
4316
|
+
"metadata": {
|
|
4317
|
+
"crm_stage": "won"
|
|
4318
|
+
},
|
|
4319
|
+
"external_references": [
|
|
4320
|
+
{
|
|
4321
|
+
"system": "hubspot",
|
|
4322
|
+
"id": "example_id_32"
|
|
4323
|
+
}
|
|
4324
|
+
],
|
|
4325
|
+
"created_at": "2026-10-23T12:00:00Z",
|
|
4326
|
+
"updated_at": "2026-10-23T12:00:00Z",
|
|
4327
|
+
"document": {
|
|
4328
|
+
"id": "example_id_30",
|
|
4329
|
+
"account_id": "example_id_4",
|
|
4330
|
+
"template_id": null,
|
|
4331
|
+
"name": "Contrato de prestação de serviços.pdf",
|
|
4332
|
+
"status": "certificated",
|
|
4333
|
+
"artifacts": {
|
|
4334
|
+
"original": "https://example.com/example-url-13"
|
|
4335
|
+
},
|
|
4336
|
+
"is_closed": true,
|
|
4337
|
+
"signing_url": "https://example.com/example-url-14",
|
|
4338
|
+
"verification_code": "example_secret",
|
|
4339
|
+
"verification_url": "https://example.com/example-url-4",
|
|
4340
|
+
"decline_reason": null,
|
|
4341
|
+
"declined_by": null,
|
|
4342
|
+
"tags": [],
|
|
4343
|
+
"created_at": "2026-10-20T14:00:00Z",
|
|
4344
|
+
"updated_at": "2026-10-22T09:00:00Z"
|
|
4345
|
+
}
|
|
4346
|
+
}
|
|
4347
|
+
]
|
|
4348
|
+
}
|
|
4349
|
+
```
|
|
4350
|
+
|
|
4351
|
+
##### 400 — The request breaks a contract rule. `errors` has one entry per problem found: the `field` as sent (`null` when the request as a whole is refused), a stable `code` to translate, and the `message` in the platform's language; `message` at the top is the first entry's. The contract's own rules on the terms, and the external references' items, report every field that breaks one, an entry per field (its first problem); the other checks (the body, its fields, the contract's state, a renewal's or a link's conditions) stop at the first problem they find. | Code | Field | Refused when | |------|-------|--------------| | `InvalidBody` | — | The body is not a JSON object (a list, a bare value), or a `PUT` of contract terms sends no attribute. | | `UnknownField` | the attribute | The endpoint does not take the attribute; one entry per attribute. | | `NotSingleValue` | the attribute | On a `PUT` of contract terms, a list sent for a term that takes one value (every term but `metadata` and `external_references`). On a link, the same list answers the term's own code. | | `Required` | `parent_document_id`, `relation_type`, `external_references[i].system`, `external_references[i].id` | A first link without `parent_document_id` (a pending link that was removed meanwhile) or `relation_type`; an `external_references` item without `system` or `id` (`i` is its place in the list sent, from 0). | | `Invalid` | the field | The value is not of the field's type or form: `status` not one of the four; `currency` not three letters; `auto_renew` not a boolean; `owner_id` not a user id; `value` not a number; `counterparty_name` holding HTML; `metadata` not an object; `external_references` not a list, an item's `system` (`external_references[i].system`) with characters other than letters, digits, `_`, `-` and `.`, or its `id` (`external_references[i].id`) with an emoji or another 4-byte character; `parent_document_id` not text; `relation_type` not `amendment`, `renewal` or `termination`; `term` not a whole number from 1; `reason` not text. On the list: a filter sent as a list, a `status` not one of the four, `ending_within_days` not a whole number. | | `TooSmall`, `TooBig` | the field | `value` below 0 or above 9999999999999.99; `renewal_term_months` outside 1 to 600; `notice_period_days` (and the list's `ending_within_days`) outside 0 to 3650. | | `TooLong` | the field | `counterparty_name` over 255 characters, counting each emoji as stored (several characters); `counterparty_taxpayer_id` over 20; `reason` over 500; `external_references[i].system` over 64 or `external_references[i].id` over 255. | | `TooMany` | `external_references` | More than 20 items. | | `TooManyDecimals` | `value` | More than two decimal places. | | `InvalidDate` | `start_date`, `end_date`, `updated_at`; the list's `end_date_from`, `end_date_to` | Not a date as `YYYY-MM-DD` (an impossible one such as `2026-02-30` included); `updated_at` not a date and time as the API writes it (`2026-10-23T12:00:00Z`, or with an offset). | | `DateTooEarly` | `start_date`, `end_date` | Before the year 1000. | | `DateTooLate` | `end_date` | A renewal by the term would pass 9999-12-31. | | `EndBeforeStart` | `end_date` | Before `start_date`. | | `InvalidTaxpayerId` | `counterparty_taxpayer_id` | Not a valid CPF or CNPJ (formatted or not). | | `NotAMember` | `owner_id` | Not an active member of the workspace. | | `TooManyKeys` | `metadata` | More than 50 keys. | | `InvalidKey` | `metadata` | A key that is not 1 to 40 letters, digits, `_`, `-` or `.`. | | `InvalidValue` | `metadata` | A value that is not plain text of at most 500 characters. | | `NumberUnderDateKey` | `metadata` | A number under a key ending in `_at`, or `stuck_since`, which the API would return as a date. | | `ListKeys` | `metadata` | Keys `0`, `1`, `2`…, which would read back as a list. | | `DuplicateReference` | `external_references` | Two items the database takes for one (accents, `ß` and `ss`); items equal case aside are merged, not refused. | | `StatusNotSettable` | `status` | A tracked contract sent `expired` or `terminated`, or a closed one sent `draft` or `active`: a contract is closed by terminating it and reopened by renewing it. | | `CannotReturnToDraft` | `status` | An `active` contract sent `draft`. | | `ExpiredNeedsPastEndDate` | `end_date` | New terms with status `expired` and no `end_date` before today. | | `TerminatedNeedsEndDate` | `end_date` | New terms with status `terminated` and no `end_date`. | | `UnsignableDocument` | — | New terms, or a first link, on a cancelled, declined or expired document. Terms or a link already on one stay editable. | | `DocumentIsAmendment` | — | Terms of its own for a document linked as an amendment: its terms are the changes it makes. | | `DocumentHasOwnTerms` | — | A link for a document that tracks a contract of its own: a document is a contract or an amendment, never both. | | `ParentHasNoTerms` | `parent_document_id` | The parent named has no contract terms, nor amends a contract that has. | | `ParentTerminated` | `parent_document_id` | The parent contract is terminated. | | `NoTermChanged` | — | An `amendment` that changes no term, also by dropping its last one. A `renewal` or `termination` may change none. | | `TermNotAllowed` | the term | A term the relation type cannot change: a `renewal` changes only `end_date` and `value`, a `termination` only `end_date`. | | `AmendmentApplied` | — | The amendment applied when its document was signed and can no longer change. | | `TermOrEndDateRequired` | — | A renewal sends neither `term` nor `end_date`. | | `TermMismatch` | `term` | Not the contract's current term: the renewal already happened. | | `ContractTerminated` | — | A renewal of a terminated contract. | | `EndDateRequired` | `end_date` | A renewal by the term, or a `renewal` link without `end_date`, of a contract without an end date. | | `EndDateNotAfterCurrent` | `end_date` | A renewal, or a `renewal` link, to a date not after the current end date. | | `AlreadyTerminated` | — | A termination of a contract already terminated. | A body that is not valid JSON is refused before it reaches these endpoints, with the platform's `400` and no `errors`. A link is also checked against what applying it today would give the parent, so a delta the contract would refuse comes back with the contract's own codes.
|
|
4352
|
+
|
|
4353
|
+
```json
|
|
4354
|
+
{
|
|
4355
|
+
"status": 400,
|
|
4356
|
+
"message": "value must be no less than 0.",
|
|
4357
|
+
"errors": [
|
|
4358
|
+
{
|
|
4359
|
+
"field": "value",
|
|
4360
|
+
"code": "TooSmall",
|
|
4361
|
+
"message": "value must be no less than 0."
|
|
4362
|
+
},
|
|
4363
|
+
{
|
|
4364
|
+
"field": "currency",
|
|
4365
|
+
"code": "Invalid",
|
|
4366
|
+
"message": "currency is invalid."
|
|
4367
|
+
}
|
|
4368
|
+
]
|
|
4221
4369
|
}
|
|
4222
4370
|
```
|
|
4223
4371
|
|
|
@@ -4241,11 +4389,11 @@ When `include_standard` is enabled, records of type `signature`, `initial` and `
|
|
|
4241
4389
|
}
|
|
4242
4390
|
```
|
|
4243
4391
|
|
|
4244
|
-
###
|
|
4392
|
+
### Get a document's contract terms
|
|
4245
4393
|
|
|
4246
|
-
`
|
|
4394
|
+
`GET /v1/accounts/{accountId}/documents/{documentId}/contract`
|
|
4247
4395
|
|
|
4248
|
-
|
|
4396
|
+
The contract terms tracked on a document, with `amendments`: the documents that amend, renew or terminate it. For a document that is itself an amendment, its link and delta (`DocumentContractAmendment`) instead. Readable even after the workspace's plan stops including contract tracking.
|
|
4249
4397
|
|
|
4250
4398
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
4251
4399
|
|
|
@@ -4254,58 +4402,131 @@ Create a field definition in the workspace.
|
|
|
4254
4402
|
| Name | In | Type | Required | Description |
|
|
4255
4403
|
|---|---|---|---|---|
|
|
4256
4404
|
| `accountId` | path | string | yes | Workspace account ID. |
|
|
4405
|
+
| `documentId` | path | string | yes | Document ID. |
|
|
4257
4406
|
|
|
4258
|
-
####
|
|
4259
|
-
|
|
4260
|
-
Fields (`application/json`):
|
|
4407
|
+
#### Responses
|
|
4261
4408
|
|
|
4262
|
-
|
|
4263
|
-
- `type` (string, required)
|
|
4264
|
-
- `regex` (string | null)
|
|
4265
|
-
- `is_required` (boolean)
|
|
4409
|
+
##### 200 — The contract terms, or the amendment
|
|
4266
4410
|
|
|
4267
|
-
|
|
4411
|
+
**The contract terms with their amendments**
|
|
4268
4412
|
|
|
4269
4413
|
```json
|
|
4270
4414
|
{
|
|
4271
|
-
"
|
|
4272
|
-
"
|
|
4273
|
-
"
|
|
4274
|
-
|
|
4415
|
+
"status": 200,
|
|
4416
|
+
"message": "",
|
|
4417
|
+
"data": {
|
|
4418
|
+
"resource": "document_contract",
|
|
4419
|
+
"document_id": "example_id_30",
|
|
4420
|
+
"status": "active",
|
|
4421
|
+
"counterparty_name": "Acme Ltda",
|
|
4422
|
+
"counterparty_taxpayer_id": "00000000000",
|
|
4423
|
+
"value": 130000,
|
|
4424
|
+
"currency": "BRL",
|
|
4425
|
+
"start_date": "2026-11-01",
|
|
4426
|
+
"end_date": "2028-06-30",
|
|
4427
|
+
"auto_renew": true,
|
|
4428
|
+
"renewal_term_months": 12,
|
|
4429
|
+
"notice_period_days": 30,
|
|
4430
|
+
"term": 2,
|
|
4431
|
+
"owner_id": "example_id_31",
|
|
4432
|
+
"metadata": {
|
|
4433
|
+
"crm_stage": "won"
|
|
4434
|
+
},
|
|
4435
|
+
"external_references": [
|
|
4436
|
+
{
|
|
4437
|
+
"system": "hubspot",
|
|
4438
|
+
"id": "example_id_32"
|
|
4439
|
+
}
|
|
4440
|
+
],
|
|
4441
|
+
"created_at": "2026-10-23T12:00:00Z",
|
|
4442
|
+
"updated_at": "2027-05-12T18:20:00Z",
|
|
4443
|
+
"amendments": [
|
|
4444
|
+
{
|
|
4445
|
+
"document_id": "example_id_33",
|
|
4446
|
+
"document_name": "Aditivo 1 - Contrato de prestação de serviços.pdf",
|
|
4447
|
+
"parent_document_id": "example_id_30",
|
|
4448
|
+
"relation_type": "amendment",
|
|
4449
|
+
"number": 1,
|
|
4450
|
+
"status": "applied",
|
|
4451
|
+
"document_status": "certificated",
|
|
4452
|
+
"apply_error": null,
|
|
4453
|
+
"currency": "BRL",
|
|
4454
|
+
"terms": {
|
|
4455
|
+
"value": 130000,
|
|
4456
|
+
"end_date": "2028-06-30"
|
|
4457
|
+
},
|
|
4458
|
+
"changes": {
|
|
4459
|
+
"value": {
|
|
4460
|
+
"from": 120000.5,
|
|
4461
|
+
"to": 130000
|
|
4462
|
+
},
|
|
4463
|
+
"end_date": {
|
|
4464
|
+
"from": "2027-10-31",
|
|
4465
|
+
"to": "2028-06-30"
|
|
4466
|
+
},
|
|
4467
|
+
"term": {
|
|
4468
|
+
"from": 1,
|
|
4469
|
+
"to": 2
|
|
4470
|
+
}
|
|
4471
|
+
},
|
|
4472
|
+
"applied_at": "2027-05-12T18:20:00Z",
|
|
4473
|
+
"created_at": "2027-05-10T15:00:00Z",
|
|
4474
|
+
"updated_at": "2027-05-12T18:20:00Z"
|
|
4475
|
+
}
|
|
4476
|
+
]
|
|
4477
|
+
}
|
|
4275
4478
|
}
|
|
4276
4479
|
```
|
|
4277
4480
|
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
##### 200 — The created field
|
|
4481
|
+
**The amendment, waiting for its signature**
|
|
4281
4482
|
|
|
4282
4483
|
```json
|
|
4283
4484
|
{
|
|
4284
|
-
"data": {
|
|
4285
|
-
"resource": "field",
|
|
4286
|
-
"id": "example_id_20",
|
|
4287
|
-
"name": "Signature",
|
|
4288
|
-
"type": "signature",
|
|
4289
|
-
"regex": null,
|
|
4290
|
-
"is_pre_defined": true,
|
|
4291
|
-
"is_active": true,
|
|
4292
|
-
"is_required": true,
|
|
4293
|
-
"is_standard": true,
|
|
4294
|
-
"is_read_only": true,
|
|
4295
|
-
"is_visible": true
|
|
4296
|
-
},
|
|
4297
4485
|
"status": 200,
|
|
4298
|
-
"message": ""
|
|
4486
|
+
"message": "",
|
|
4487
|
+
"data": {
|
|
4488
|
+
"resource": "document_contract_amendment",
|
|
4489
|
+
"document_id": "example_id_33",
|
|
4490
|
+
"document_name": "Aditivo 1 - Contrato de prestação de serviços.pdf",
|
|
4491
|
+
"parent_document_id": "example_id_30",
|
|
4492
|
+
"relation_type": "amendment",
|
|
4493
|
+
"number": null,
|
|
4494
|
+
"status": "pending",
|
|
4495
|
+
"document_status": "pending_signature",
|
|
4496
|
+
"apply_error": null,
|
|
4497
|
+
"currency": "BRL",
|
|
4498
|
+
"terms": {
|
|
4499
|
+
"value": 130000,
|
|
4500
|
+
"end_date": "2028-06-30"
|
|
4501
|
+
},
|
|
4502
|
+
"changes": {
|
|
4503
|
+
"value": {
|
|
4504
|
+
"from": 120000.5,
|
|
4505
|
+
"to": 130000
|
|
4506
|
+
},
|
|
4507
|
+
"end_date": {
|
|
4508
|
+
"from": "2027-10-31",
|
|
4509
|
+
"to": "2028-06-30"
|
|
4510
|
+
},
|
|
4511
|
+
"term": {
|
|
4512
|
+
"from": 1,
|
|
4513
|
+
"to": 2
|
|
4514
|
+
}
|
|
4515
|
+
},
|
|
4516
|
+
"applied_at": null,
|
|
4517
|
+
"created_at": "2027-05-10T15:00:00Z",
|
|
4518
|
+
"updated_at": "2027-05-10T15:00:00Z"
|
|
4519
|
+
}
|
|
4299
4520
|
}
|
|
4300
4521
|
```
|
|
4301
4522
|
|
|
4302
|
-
#####
|
|
4523
|
+
##### 404 — The document is not in the workspace (`Document not found.`), or carries no contract terms (on a read: neither its own nor those of a contract it amends whose document still exists). Only the second has a `code`, `NoContractTerms`, so a document without terms can be told from one that is not there.
|
|
4303
4524
|
|
|
4304
4525
|
```json
|
|
4305
4526
|
{
|
|
4306
|
-
"status":
|
|
4307
|
-
"message": "
|
|
4308
|
-
"
|
|
4527
|
+
"status": 404,
|
|
4528
|
+
"message": "This document has no contract terms.",
|
|
4529
|
+
"code": "NoContractTerms"
|
|
4309
4530
|
}
|
|
4310
4531
|
```
|
|
4311
4532
|
|
|
@@ -4329,11 +4550,11 @@ Example:
|
|
|
4329
4550
|
}
|
|
4330
4551
|
```
|
|
4331
4552
|
|
|
4332
|
-
###
|
|
4553
|
+
### Set a document's contract terms
|
|
4333
4554
|
|
|
4334
|
-
`
|
|
4555
|
+
`PUT /v1/accounts/{accountId}/documents/{documentId}/contract`
|
|
4335
4556
|
|
|
4336
|
-
|
|
4557
|
+
Creates the document's contract terms, or changes only the attributes sent (see the request body for what `null` does). `external_references`, when sent, replaces the whole list. Records a `document_contract_updated` event when the terms change; a retry that changes nothing records none. The body must be a JSON object with at least one attribute. With `parent_document_id`, the document is instead linked as an amendment, renewal or termination of that contract (or of any document in its family, resolved to the root) and the other attributes are the terms it changes; a later `PUT` on a pending amendment merges into that delta (a `null` drops a key) and `parent_document_id: null` unlinks it; every change to the link records `document_contract_amendment_updated` on this document. The delta applies to the parent once the document is certificated (at once, if it already is), in signing order (the order the documents' certifications were recorded in, fixed for each once it is; a certificated document with none recorded waits, and is placed by its certification time an hour on): instruments signed earlier apply first, one that cannot holds the later ones back, and an instrument signed before one already applied is blocked instead of applied over it. Applying records `document_contract_amended`; an applied amendment is read-only. A cancelled, declined or expired document takes no new terms and no new link; terms or a link already on one stay and can still change. Send the `updated_at` you read with the write to have it refused (`409`) if the contract or link changed meanwhile. Needs a plan with contract tracking (`403` otherwise).
|
|
4337
4558
|
|
|
4338
4559
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
4339
4560
|
|
|
@@ -4342,103 +4563,963 @@ Retrieve a single field definition.
|
|
|
4342
4563
|
| Name | In | Type | Required | Description |
|
|
4343
4564
|
|---|---|---|---|---|
|
|
4344
4565
|
| `accountId` | path | string | yes | Workspace account ID. |
|
|
4345
|
-
| `
|
|
4566
|
+
| `documentId` | path | string | yes | Document ID. |
|
|
4346
4567
|
|
|
4347
|
-
####
|
|
4568
|
+
#### Request Body (required)
|
|
4348
4569
|
|
|
4349
|
-
|
|
4570
|
+
Fields (`application/json`):
|
|
4350
4571
|
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4572
|
+
- `status` (string) — On creation any status, so a contract that ended before it was tracked is registered as it ended: `expired` needs an `end_date` in the past, `terminated` its `end_date`; neither is walked by the lifecycle. Afterwards only `draft` or `active` (a contract in force never goes back to `draft`): `expired` and `terminated` are set by the lifecycle and the terminate endpoint; a closed contract is reopened by renewing it.
|
|
4573
|
+
- `counterparty_name` (string | null) — Emoji are kept; other characters outside the 3-byte range are dropped.
|
|
4574
|
+
- `counterparty_taxpayer_id` (string | null) — A valid CPF or CNPJ, formatted or not.
|
|
4575
|
+
- `value` (number | null) — Two decimal places at most.
|
|
4576
|
+
- `currency` (string | null) — Three letters, such as `BRL` or `USD`, stored in capitals; `BRL` when a `value` is set without one.
|
|
4577
|
+
- `start_date` (string | null) — `YYYY-MM-DD`, from the year 1000.
|
|
4578
|
+
- `end_date` (string | null) — `YYYY-MM-DD`, on or after `start_date`.
|
|
4579
|
+
- `auto_renew` (boolean) — Whether the hourly run starts the next term the day after `end_date`, by `renewal_term_months`, instead of expiring the contract.
|
|
4580
|
+
- `renewal_term_months` (integer | null) — How far a renewal by the term moves `end_date`; 12 when unset.
|
|
4581
|
+
- `notice_period_days` (integer | null) — Days before `end_date` the notice period starts (`document_contract_renewal_notice`); none when unset.
|
|
4582
|
+
- `owner_id` (string | null) — An active member of this workspace.
|
|
4583
|
+
- `metadata` (object | null) — Your own fields: up to 50 keys of 1 to 40 letters, digits, `_`, `-` or `.`, each holding plain text of at most 500 characters; no number under a key ending in `_at`, or `stuck_since`.
|
|
4584
|
+
- `external_references` (array | null) — Replaces the whole list; `[]` or `null` clears it. Two items whose `system` and `id` compare equal case aside are one reference (the first sent is kept); a pair the database takes for one beyond that (accents, `ß` and `ss`) answers `400`.
|
|
4585
|
+
- `parent_document_id` (string | null) — Links the document as an amendment of this contract document, or of any document in its family (resolved to the root); `null` unlinks a pending amendment. With it, the other attributes are the terms the instrument changes, not terms of its own; on a pending amendment a `null` value drops that term from the delta rather than clearing it on the parent.
|
|
4586
|
+
- `relation_type` (string) — Required on the first link. `amendment` may change `value`, `currency`, `start_date` (effective from, display only), `end_date`, `auto_renew`, `renewal_term_months`, `notice_period_days`, `counterparty_name`, `counterparty_taxpayer_id` and `metadata`; `renewal` only `end_date` and `value`; `termination` only `end_date` (the effective date).
|
|
4587
|
+
- `updated_at` (string) — Optional precondition: the `updated_at` the client read the contract (or this document's amendment link) with, as the API returned it. If the contract or link changed since, nothing is written and the answer is `409` with `code: ContractChanged`. Not sent, or `null`: the write applies whatever changed meanwhile (last write wins). Compared to the second; a fraction of a second, as a JavaScript date prints it, is read and ignored. New terms and a first link have nothing to have read, so sending one answers `409`; on a pending amendment, send the link's own `updated_at` (the GET on that document).
|
|
4588
|
+
|
|
4589
|
+
Example — Set every term:
|
|
4590
|
+
|
|
4591
|
+
```json
|
|
4592
|
+
{
|
|
4593
|
+
"status": "active",
|
|
4594
|
+
"counterparty_name": "Acme Ltda",
|
|
4595
|
+
"counterparty_taxpayer_id": "00000000000",
|
|
4596
|
+
"value": 120000.5,
|
|
4597
|
+
"currency": "BRL",
|
|
4598
|
+
"start_date": "2026-11-01",
|
|
4599
|
+
"end_date": "2027-10-31",
|
|
4600
|
+
"auto_renew": true,
|
|
4601
|
+
"renewal_term_months": 12,
|
|
4602
|
+
"notice_period_days": 30,
|
|
4603
|
+
"owner_id": "example_id_31",
|
|
4604
|
+
"metadata": {
|
|
4605
|
+
"crm_stage": "won"
|
|
4365
4606
|
},
|
|
4366
|
-
"
|
|
4367
|
-
|
|
4607
|
+
"external_references": [
|
|
4608
|
+
{
|
|
4609
|
+
"system": "hubspot",
|
|
4610
|
+
"id": "example_id_32"
|
|
4611
|
+
}
|
|
4612
|
+
]
|
|
4368
4613
|
}
|
|
4369
4614
|
```
|
|
4370
4615
|
|
|
4371
|
-
|
|
4616
|
+
Example — Change one term, clear another:
|
|
4372
4617
|
|
|
4373
4618
|
```json
|
|
4374
4619
|
{
|
|
4375
|
-
"
|
|
4376
|
-
"
|
|
4377
|
-
"data": null
|
|
4620
|
+
"notice_period_days": 60,
|
|
4621
|
+
"counterparty_name": null
|
|
4378
4622
|
}
|
|
4379
4623
|
```
|
|
4380
4624
|
|
|
4381
|
-
|
|
4625
|
+
Example — Replace the external references:
|
|
4382
4626
|
|
|
4383
4627
|
```json
|
|
4384
4628
|
{
|
|
4385
|
-
"
|
|
4386
|
-
|
|
4387
|
-
|
|
4629
|
+
"external_references": [
|
|
4630
|
+
{
|
|
4631
|
+
"system": "hubspot",
|
|
4632
|
+
"id": "example_id_32"
|
|
4633
|
+
},
|
|
4634
|
+
{
|
|
4635
|
+
"system": "erp",
|
|
4636
|
+
"id": "example_id_34"
|
|
4637
|
+
}
|
|
4638
|
+
]
|
|
4388
4639
|
}
|
|
4389
4640
|
```
|
|
4390
4641
|
|
|
4391
|
-
|
|
4642
|
+
Example — Link an aditivo that changes the value and the end date:
|
|
4392
4643
|
|
|
4393
4644
|
```json
|
|
4394
4645
|
{
|
|
4395
|
-
"
|
|
4396
|
-
"
|
|
4397
|
-
"
|
|
4646
|
+
"parent_document_id": "example_id_30",
|
|
4647
|
+
"relation_type": "amendment",
|
|
4648
|
+
"value": 130000,
|
|
4649
|
+
"end_date": "2028-06-30"
|
|
4398
4650
|
}
|
|
4399
4651
|
```
|
|
4400
4652
|
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
`PUT /v1/accounts/{accountId}/fields/{fieldId}`
|
|
4404
|
-
|
|
4405
|
-
Update a field definition.
|
|
4406
|
-
|
|
4407
|
-
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
4408
|
-
|
|
4409
|
-
#### Parameters
|
|
4410
|
-
|
|
4411
|
-
| Name | In | Type | Required | Description |
|
|
4412
|
-
|---|---|---|---|---|
|
|
4413
|
-
| `accountId` | path | string | yes | Workspace account ID. |
|
|
4414
|
-
| `fieldId` | path | string | yes | The field ID. |
|
|
4415
|
-
|
|
4416
|
-
#### Request Body (required)
|
|
4417
|
-
|
|
4418
|
-
Fields (`application/json`):
|
|
4653
|
+
#### Responses
|
|
4419
4654
|
|
|
4420
|
-
|
|
4421
|
-
- `regex` (string | null)
|
|
4422
|
-
- `is_active` (boolean)
|
|
4655
|
+
##### 200 — The contract terms as saved, or the amendment as linked
|
|
4423
4656
|
|
|
4424
|
-
|
|
4657
|
+
**The contract terms**
|
|
4425
4658
|
|
|
4426
4659
|
```json
|
|
4427
4660
|
{
|
|
4428
|
-
"
|
|
4429
|
-
"
|
|
4430
|
-
"
|
|
4661
|
+
"status": 200,
|
|
4662
|
+
"message": "",
|
|
4663
|
+
"data": {
|
|
4664
|
+
"resource": "document_contract",
|
|
4665
|
+
"document_id": "example_id_30",
|
|
4666
|
+
"status": "active",
|
|
4667
|
+
"counterparty_name": "Acme Ltda",
|
|
4668
|
+
"counterparty_taxpayer_id": "00000000000",
|
|
4669
|
+
"value": 120000.5,
|
|
4670
|
+
"currency": "BRL",
|
|
4671
|
+
"start_date": "2026-11-01",
|
|
4672
|
+
"end_date": "2027-10-31",
|
|
4673
|
+
"auto_renew": true,
|
|
4674
|
+
"renewal_term_months": 12,
|
|
4675
|
+
"notice_period_days": 30,
|
|
4676
|
+
"term": 1,
|
|
4677
|
+
"owner_id": "example_id_31",
|
|
4678
|
+
"metadata": {
|
|
4679
|
+
"crm_stage": "won"
|
|
4680
|
+
},
|
|
4681
|
+
"external_references": [
|
|
4682
|
+
{
|
|
4683
|
+
"system": "hubspot",
|
|
4684
|
+
"id": "example_id_32"
|
|
4685
|
+
}
|
|
4686
|
+
],
|
|
4687
|
+
"created_at": "2026-10-23T12:00:00Z",
|
|
4688
|
+
"updated_at": "2026-10-23T12:00:00Z"
|
|
4689
|
+
}
|
|
4431
4690
|
}
|
|
4432
4691
|
```
|
|
4433
4692
|
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
##### 200 — The updated field
|
|
4693
|
+
**The amendment, waiting for its signature**
|
|
4437
4694
|
|
|
4438
4695
|
```json
|
|
4439
4696
|
{
|
|
4697
|
+
"status": 200,
|
|
4698
|
+
"message": "",
|
|
4440
4699
|
"data": {
|
|
4441
|
-
"resource": "
|
|
4700
|
+
"resource": "document_contract_amendment",
|
|
4701
|
+
"document_id": "example_id_33",
|
|
4702
|
+
"document_name": "Aditivo 1 - Contrato de prestação de serviços.pdf",
|
|
4703
|
+
"parent_document_id": "example_id_30",
|
|
4704
|
+
"relation_type": "amendment",
|
|
4705
|
+
"number": null,
|
|
4706
|
+
"status": "pending",
|
|
4707
|
+
"document_status": "pending_signature",
|
|
4708
|
+
"apply_error": null,
|
|
4709
|
+
"currency": "BRL",
|
|
4710
|
+
"terms": {
|
|
4711
|
+
"value": 130000,
|
|
4712
|
+
"end_date": "2028-06-30"
|
|
4713
|
+
},
|
|
4714
|
+
"changes": {
|
|
4715
|
+
"value": {
|
|
4716
|
+
"from": 120000.5,
|
|
4717
|
+
"to": 130000
|
|
4718
|
+
},
|
|
4719
|
+
"end_date": {
|
|
4720
|
+
"from": "2027-10-31",
|
|
4721
|
+
"to": "2028-06-30"
|
|
4722
|
+
},
|
|
4723
|
+
"term": {
|
|
4724
|
+
"from": 1,
|
|
4725
|
+
"to": 2
|
|
4726
|
+
}
|
|
4727
|
+
},
|
|
4728
|
+
"applied_at": null,
|
|
4729
|
+
"created_at": "2027-05-10T15:00:00Z",
|
|
4730
|
+
"updated_at": "2027-05-10T15:00:00Z"
|
|
4731
|
+
}
|
|
4732
|
+
}
|
|
4733
|
+
```
|
|
4734
|
+
|
|
4735
|
+
**The amendment, applied to the parent**
|
|
4736
|
+
|
|
4737
|
+
```json
|
|
4738
|
+
{
|
|
4739
|
+
"status": 200,
|
|
4740
|
+
"message": "",
|
|
4741
|
+
"data": {
|
|
4742
|
+
"resource": "document_contract_amendment",
|
|
4743
|
+
"document_id": "example_id_33",
|
|
4744
|
+
"document_name": "Aditivo 1 - Contrato de prestação de serviços.pdf",
|
|
4745
|
+
"parent_document_id": "example_id_30",
|
|
4746
|
+
"relation_type": "amendment",
|
|
4747
|
+
"number": 1,
|
|
4748
|
+
"status": "applied",
|
|
4749
|
+
"document_status": "certificated",
|
|
4750
|
+
"apply_error": null,
|
|
4751
|
+
"currency": "BRL",
|
|
4752
|
+
"terms": {
|
|
4753
|
+
"value": 130000,
|
|
4754
|
+
"end_date": "2028-06-30"
|
|
4755
|
+
},
|
|
4756
|
+
"changes": {
|
|
4757
|
+
"value": {
|
|
4758
|
+
"from": 120000.5,
|
|
4759
|
+
"to": 130000
|
|
4760
|
+
},
|
|
4761
|
+
"end_date": {
|
|
4762
|
+
"from": "2027-10-31",
|
|
4763
|
+
"to": "2028-06-30"
|
|
4764
|
+
},
|
|
4765
|
+
"term": {
|
|
4766
|
+
"from": 1,
|
|
4767
|
+
"to": 2
|
|
4768
|
+
}
|
|
4769
|
+
},
|
|
4770
|
+
"applied_at": "2027-05-12T18:20:00Z",
|
|
4771
|
+
"created_at": "2027-05-10T15:00:00Z",
|
|
4772
|
+
"updated_at": "2027-05-12T18:20:00Z"
|
|
4773
|
+
}
|
|
4774
|
+
}
|
|
4775
|
+
```
|
|
4776
|
+
|
|
4777
|
+
##### 400 — The request breaks a contract rule. `errors` has one entry per problem found: the `field` as sent (`null` when the request as a whole is refused), a stable `code` to translate, and the `message` in the platform's language; `message` at the top is the first entry's. The contract's own rules on the terms, and the external references' items, report every field that breaks one, an entry per field (its first problem); the other checks (the body, its fields, the contract's state, a renewal's or a link's conditions) stop at the first problem they find. | Code | Field | Refused when | |------|-------|--------------| | `InvalidBody` | — | The body is not a JSON object (a list, a bare value), or a `PUT` of contract terms sends no attribute. | | `UnknownField` | the attribute | The endpoint does not take the attribute; one entry per attribute. | | `NotSingleValue` | the attribute | On a `PUT` of contract terms, a list sent for a term that takes one value (every term but `metadata` and `external_references`). On a link, the same list answers the term's own code. | | `Required` | `parent_document_id`, `relation_type`, `external_references[i].system`, `external_references[i].id` | A first link without `parent_document_id` (a pending link that was removed meanwhile) or `relation_type`; an `external_references` item without `system` or `id` (`i` is its place in the list sent, from 0). | | `Invalid` | the field | The value is not of the field's type or form: `status` not one of the four; `currency` not three letters; `auto_renew` not a boolean; `owner_id` not a user id; `value` not a number; `counterparty_name` holding HTML; `metadata` not an object; `external_references` not a list, an item's `system` (`external_references[i].system`) with characters other than letters, digits, `_`, `-` and `.`, or its `id` (`external_references[i].id`) with an emoji or another 4-byte character; `parent_document_id` not text; `relation_type` not `amendment`, `renewal` or `termination`; `term` not a whole number from 1; `reason` not text. On the list: a filter sent as a list, a `status` not one of the four, `ending_within_days` not a whole number. | | `TooSmall`, `TooBig` | the field | `value` below 0 or above 9999999999999.99; `renewal_term_months` outside 1 to 600; `notice_period_days` (and the list's `ending_within_days`) outside 0 to 3650. | | `TooLong` | the field | `counterparty_name` over 255 characters, counting each emoji as stored (several characters); `counterparty_taxpayer_id` over 20; `reason` over 500; `external_references[i].system` over 64 or `external_references[i].id` over 255. | | `TooMany` | `external_references` | More than 20 items. | | `TooManyDecimals` | `value` | More than two decimal places. | | `InvalidDate` | `start_date`, `end_date`, `updated_at`; the list's `end_date_from`, `end_date_to` | Not a date as `YYYY-MM-DD` (an impossible one such as `2026-02-30` included); `updated_at` not a date and time as the API writes it (`2026-10-23T12:00:00Z`, or with an offset). | | `DateTooEarly` | `start_date`, `end_date` | Before the year 1000. | | `DateTooLate` | `end_date` | A renewal by the term would pass 9999-12-31. | | `EndBeforeStart` | `end_date` | Before `start_date`. | | `InvalidTaxpayerId` | `counterparty_taxpayer_id` | Not a valid CPF or CNPJ (formatted or not). | | `NotAMember` | `owner_id` | Not an active member of the workspace. | | `TooManyKeys` | `metadata` | More than 50 keys. | | `InvalidKey` | `metadata` | A key that is not 1 to 40 letters, digits, `_`, `-` or `.`. | | `InvalidValue` | `metadata` | A value that is not plain text of at most 500 characters. | | `NumberUnderDateKey` | `metadata` | A number under a key ending in `_at`, or `stuck_since`, which the API would return as a date. | | `ListKeys` | `metadata` | Keys `0`, `1`, `2`…, which would read back as a list. | | `DuplicateReference` | `external_references` | Two items the database takes for one (accents, `ß` and `ss`); items equal case aside are merged, not refused. | | `StatusNotSettable` | `status` | A tracked contract sent `expired` or `terminated`, or a closed one sent `draft` or `active`: a contract is closed by terminating it and reopened by renewing it. | | `CannotReturnToDraft` | `status` | An `active` contract sent `draft`. | | `ExpiredNeedsPastEndDate` | `end_date` | New terms with status `expired` and no `end_date` before today. | | `TerminatedNeedsEndDate` | `end_date` | New terms with status `terminated` and no `end_date`. | | `UnsignableDocument` | — | New terms, or a first link, on a cancelled, declined or expired document. Terms or a link already on one stay editable. | | `DocumentIsAmendment` | — | Terms of its own for a document linked as an amendment: its terms are the changes it makes. | | `DocumentHasOwnTerms` | — | A link for a document that tracks a contract of its own: a document is a contract or an amendment, never both. | | `ParentHasNoTerms` | `parent_document_id` | The parent named has no contract terms, nor amends a contract that has. | | `ParentTerminated` | `parent_document_id` | The parent contract is terminated. | | `NoTermChanged` | — | An `amendment` that changes no term, also by dropping its last one. A `renewal` or `termination` may change none. | | `TermNotAllowed` | the term | A term the relation type cannot change: a `renewal` changes only `end_date` and `value`, a `termination` only `end_date`. | | `AmendmentApplied` | — | The amendment applied when its document was signed and can no longer change. | | `TermOrEndDateRequired` | — | A renewal sends neither `term` nor `end_date`. | | `TermMismatch` | `term` | Not the contract's current term: the renewal already happened. | | `ContractTerminated` | — | A renewal of a terminated contract. | | `EndDateRequired` | `end_date` | A renewal by the term, or a `renewal` link without `end_date`, of a contract without an end date. | | `EndDateNotAfterCurrent` | `end_date` | A renewal, or a `renewal` link, to a date not after the current end date. | | `AlreadyTerminated` | — | A termination of a contract already terminated. | A body that is not valid JSON is refused before it reaches these endpoints, with the platform's `400` and no `errors`. A link is also checked against what applying it today would give the parent, so a delta the contract would refuse comes back with the contract's own codes.
|
|
4778
|
+
|
|
4779
|
+
```json
|
|
4780
|
+
{
|
|
4781
|
+
"status": 400,
|
|
4782
|
+
"message": "value must be no less than 0.",
|
|
4783
|
+
"errors": [
|
|
4784
|
+
{
|
|
4785
|
+
"field": "value",
|
|
4786
|
+
"code": "TooSmall",
|
|
4787
|
+
"message": "value must be no less than 0."
|
|
4788
|
+
},
|
|
4789
|
+
{
|
|
4790
|
+
"field": "currency",
|
|
4791
|
+
"code": "Invalid",
|
|
4792
|
+
"message": "currency is invalid."
|
|
4793
|
+
}
|
|
4794
|
+
]
|
|
4795
|
+
}
|
|
4796
|
+
```
|
|
4797
|
+
|
|
4798
|
+
##### 403 — The workspace's plan does not include contract tracking.
|
|
4799
|
+
|
|
4800
|
+
```json
|
|
4801
|
+
{
|
|
4802
|
+
"status": 403,
|
|
4803
|
+
"message": "Contract tracking is not available for your current plan."
|
|
4804
|
+
}
|
|
4805
|
+
```
|
|
4806
|
+
|
|
4807
|
+
##### 409 — The write sent the `updated_at` it read the contract (or the amendment link) with, and the contract changed since: by another user, an integration or the hourly run. Nothing was written. Read it again, check the change still applies, and send it with the new `updated_at`.
|
|
4808
|
+
|
|
4809
|
+
```json
|
|
4810
|
+
{
|
|
4811
|
+
"status": 409,
|
|
4812
|
+
"message": "The contract changed after it was read; read it again and resend the change.",
|
|
4813
|
+
"code": "ContractChanged"
|
|
4814
|
+
}
|
|
4815
|
+
```
|
|
4816
|
+
|
|
4817
|
+
##### 404 — The document is not in the workspace, the `parent_document_id` names a document outside it, or `parent_document_id: null` is sent for a document that is not an amendment.
|
|
4818
|
+
|
|
4819
|
+
```json
|
|
4820
|
+
{
|
|
4821
|
+
"status": 404,
|
|
4822
|
+
"message": "Document not found."
|
|
4823
|
+
}
|
|
4824
|
+
```
|
|
4825
|
+
|
|
4826
|
+
##### 401 — Missing or invalid credentials.
|
|
4827
|
+
|
|
4828
|
+
```json
|
|
4829
|
+
{
|
|
4830
|
+
"status": 401,
|
|
4831
|
+
"message": "Bad request.",
|
|
4832
|
+
"data": null
|
|
4833
|
+
}
|
|
4834
|
+
```
|
|
4835
|
+
|
|
4836
|
+
##### 500 — Unexpected server error.
|
|
4837
|
+
|
|
4838
|
+
```json
|
|
4839
|
+
{
|
|
4840
|
+
"status": 500,
|
|
4841
|
+
"message": "Bad request.",
|
|
4842
|
+
"data": null
|
|
4843
|
+
}
|
|
4844
|
+
```
|
|
4845
|
+
|
|
4846
|
+
### List the contracts related to a document
|
|
4847
|
+
|
|
4848
|
+
`GET /v1/accounts/{accountId}/documents/{documentId}/contract/related`
|
|
4849
|
+
|
|
4850
|
+
The family the document belongs to, seen from its root: the contract terms with every amendment, renewal and termination document linked to them (`amendments`). Works from the contract document and from any of its amendments alike.
|
|
4851
|
+
|
|
4852
|
+
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
4853
|
+
|
|
4854
|
+
#### Parameters
|
|
4855
|
+
|
|
4856
|
+
| Name | In | Type | Required | Description |
|
|
4857
|
+
|---|---|---|---|---|
|
|
4858
|
+
| `accountId` | path | string | yes | Workspace account ID. |
|
|
4859
|
+
| `documentId` | path | string | yes | Document ID. |
|
|
4860
|
+
|
|
4861
|
+
#### Responses
|
|
4862
|
+
|
|
4863
|
+
##### 200 — The root contract and its family
|
|
4864
|
+
|
|
4865
|
+
**The contract terms with their amendments**
|
|
4866
|
+
|
|
4867
|
+
```json
|
|
4868
|
+
{
|
|
4869
|
+
"status": 200,
|
|
4870
|
+
"message": "",
|
|
4871
|
+
"data": {
|
|
4872
|
+
"resource": "document_contract",
|
|
4873
|
+
"document_id": "example_id_30",
|
|
4874
|
+
"status": "active",
|
|
4875
|
+
"counterparty_name": "Acme Ltda",
|
|
4876
|
+
"counterparty_taxpayer_id": "00000000000",
|
|
4877
|
+
"value": 130000,
|
|
4878
|
+
"currency": "BRL",
|
|
4879
|
+
"start_date": "2026-11-01",
|
|
4880
|
+
"end_date": "2028-06-30",
|
|
4881
|
+
"auto_renew": true,
|
|
4882
|
+
"renewal_term_months": 12,
|
|
4883
|
+
"notice_period_days": 30,
|
|
4884
|
+
"term": 2,
|
|
4885
|
+
"owner_id": "example_id_31",
|
|
4886
|
+
"metadata": {
|
|
4887
|
+
"crm_stage": "won"
|
|
4888
|
+
},
|
|
4889
|
+
"external_references": [
|
|
4890
|
+
{
|
|
4891
|
+
"system": "hubspot",
|
|
4892
|
+
"id": "example_id_32"
|
|
4893
|
+
}
|
|
4894
|
+
],
|
|
4895
|
+
"created_at": "2026-10-23T12:00:00Z",
|
|
4896
|
+
"updated_at": "2027-05-12T18:20:00Z",
|
|
4897
|
+
"amendments": [
|
|
4898
|
+
{
|
|
4899
|
+
"document_id": "example_id_33",
|
|
4900
|
+
"document_name": "Aditivo 1 - Contrato de prestação de serviços.pdf",
|
|
4901
|
+
"parent_document_id": "example_id_30",
|
|
4902
|
+
"relation_type": "amendment",
|
|
4903
|
+
"number": 1,
|
|
4904
|
+
"status": "applied",
|
|
4905
|
+
"document_status": "certificated",
|
|
4906
|
+
"apply_error": null,
|
|
4907
|
+
"currency": "BRL",
|
|
4908
|
+
"terms": {
|
|
4909
|
+
"value": 130000,
|
|
4910
|
+
"end_date": "2028-06-30"
|
|
4911
|
+
},
|
|
4912
|
+
"changes": {
|
|
4913
|
+
"value": {
|
|
4914
|
+
"from": 120000.5,
|
|
4915
|
+
"to": 130000
|
|
4916
|
+
},
|
|
4917
|
+
"end_date": {
|
|
4918
|
+
"from": "2027-10-31",
|
|
4919
|
+
"to": "2028-06-30"
|
|
4920
|
+
},
|
|
4921
|
+
"term": {
|
|
4922
|
+
"from": 1,
|
|
4923
|
+
"to": 2
|
|
4924
|
+
}
|
|
4925
|
+
},
|
|
4926
|
+
"applied_at": "2027-05-12T18:20:00Z",
|
|
4927
|
+
"created_at": "2027-05-10T15:00:00Z",
|
|
4928
|
+
"updated_at": "2027-05-12T18:20:00Z"
|
|
4929
|
+
}
|
|
4930
|
+
]
|
|
4931
|
+
}
|
|
4932
|
+
}
|
|
4933
|
+
```
|
|
4934
|
+
|
|
4935
|
+
##### 404 — The document is not in the workspace (`Document not found.`), or carries no contract terms (on a read: neither its own nor those of a contract it amends whose document still exists). Only the second has a `code`, `NoContractTerms`, so a document without terms can be told from one that is not there.
|
|
4936
|
+
|
|
4937
|
+
```json
|
|
4938
|
+
{
|
|
4939
|
+
"status": 404,
|
|
4940
|
+
"message": "This document has no contract terms.",
|
|
4941
|
+
"code": "NoContractTerms"
|
|
4942
|
+
}
|
|
4943
|
+
```
|
|
4944
|
+
|
|
4945
|
+
##### 401 — Missing or invalid credentials.
|
|
4946
|
+
|
|
4947
|
+
```json
|
|
4948
|
+
{
|
|
4949
|
+
"status": 401,
|
|
4950
|
+
"message": "Bad request.",
|
|
4951
|
+
"data": null
|
|
4952
|
+
}
|
|
4953
|
+
```
|
|
4954
|
+
|
|
4955
|
+
##### 500 — Unexpected server error.
|
|
4956
|
+
|
|
4957
|
+
```json
|
|
4958
|
+
{
|
|
4959
|
+
"status": 500,
|
|
4960
|
+
"message": "Bad request.",
|
|
4961
|
+
"data": null
|
|
4962
|
+
}
|
|
4963
|
+
```
|
|
4964
|
+
|
|
4965
|
+
### Renew a contract
|
|
4966
|
+
|
|
4967
|
+
`POST /v1/accounts/{accountId}/documents/{documentId}/contract/renew`
|
|
4968
|
+
|
|
4969
|
+
Starts the contract's next term: `end_date` moves by `renewal_term_months` (12 when unset), or to the `end_date` sent, which must be after the current one. A `value` sent replaces the current one. Reopens an expired contract; a terminated one returns `400`. Steps `term`, so the lifecycle alerts run again for the new term. Records a `document_contract_renewed` event. Needs a plan with contract tracking (`403` otherwise). The body names the `term` the renewal starts from (the contract's current one) or the `end_date` it renews to, so a renewal answered with a `5xx` error, or whose answer was lost, is safe to send again: the repeat is refused with `400`, as the contract is then in its next term and that date is no longer after the current one (or with `409`, when it sends the `updated_at` it read).
|
|
4970
|
+
|
|
4971
|
+
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
4972
|
+
|
|
4973
|
+
#### Parameters
|
|
4974
|
+
|
|
4975
|
+
| Name | In | Type | Required | Description |
|
|
4976
|
+
|---|---|---|---|---|
|
|
4977
|
+
| `accountId` | path | string | yes | Workspace account ID. |
|
|
4978
|
+
| `documentId` | path | string | yes | Document ID. |
|
|
4979
|
+
|
|
4980
|
+
#### Request Body
|
|
4981
|
+
|
|
4982
|
+
Fields (`application/json`):
|
|
4983
|
+
|
|
4984
|
+
- `end_date` (string | null) — The new end date, after the current one. Absent, empty or `null`: the current end date plus the renewal term, stepped until it is in the future; `term` is then required.
|
|
4985
|
+
- `value` (number | null) — The new value; unchanged when not sent, cleared by `null`.
|
|
4986
|
+
- `term` (integer) — The term this renewal starts from, the contract's current `term`. Required unless `end_date` is sent; for a contract in another term the renewal is refused, so a repeated request never renews twice.
|
|
4987
|
+
- `updated_at` (string) — Optional precondition: the contract's `updated_at` as read. Changed since: `409`, nothing renewed.
|
|
4988
|
+
|
|
4989
|
+
Example — Renew from term 1 by the renewal term, with a new value: safe to repeat:
|
|
4990
|
+
|
|
4991
|
+
```json
|
|
4992
|
+
{
|
|
4993
|
+
"term": 1,
|
|
4994
|
+
"value": 126000
|
|
4995
|
+
}
|
|
4996
|
+
```
|
|
4997
|
+
|
|
4998
|
+
Example — Renew to a date with a new value:
|
|
4999
|
+
|
|
5000
|
+
```json
|
|
5001
|
+
{
|
|
5002
|
+
"end_date": "2029-06-30",
|
|
5003
|
+
"value": 130000
|
|
5004
|
+
}
|
|
5005
|
+
```
|
|
5006
|
+
|
|
5007
|
+
#### Responses
|
|
5008
|
+
|
|
5009
|
+
##### 200 — The renewed contract
|
|
5010
|
+
|
|
5011
|
+
**The renewed contract**
|
|
5012
|
+
|
|
5013
|
+
```json
|
|
5014
|
+
{
|
|
5015
|
+
"status": 200,
|
|
5016
|
+
"message": "",
|
|
5017
|
+
"data": {
|
|
5018
|
+
"resource": "document_contract",
|
|
5019
|
+
"document_id": "example_id_30",
|
|
5020
|
+
"status": "active",
|
|
5021
|
+
"counterparty_name": "Acme Ltda",
|
|
5022
|
+
"counterparty_taxpayer_id": "00000000000",
|
|
5023
|
+
"value": 130000,
|
|
5024
|
+
"currency": "BRL",
|
|
5025
|
+
"start_date": "2026-11-01",
|
|
5026
|
+
"end_date": "2029-06-30",
|
|
5027
|
+
"auto_renew": true,
|
|
5028
|
+
"renewal_term_months": 12,
|
|
5029
|
+
"notice_period_days": 30,
|
|
5030
|
+
"term": 2,
|
|
5031
|
+
"owner_id": "example_id_31",
|
|
5032
|
+
"metadata": {
|
|
5033
|
+
"crm_stage": "won"
|
|
5034
|
+
},
|
|
5035
|
+
"external_references": [
|
|
5036
|
+
{
|
|
5037
|
+
"system": "hubspot",
|
|
5038
|
+
"id": "example_id_32"
|
|
5039
|
+
}
|
|
5040
|
+
],
|
|
5041
|
+
"created_at": "2026-10-23T12:00:00Z",
|
|
5042
|
+
"updated_at": "2027-10-15T09:30:00Z"
|
|
5043
|
+
}
|
|
5044
|
+
}
|
|
5045
|
+
```
|
|
5046
|
+
|
|
5047
|
+
##### 400 — The request breaks a contract rule. `errors` has one entry per problem found: the `field` as sent (`null` when the request as a whole is refused), a stable `code` to translate, and the `message` in the platform's language; `message` at the top is the first entry's. The contract's own rules on the terms, and the external references' items, report every field that breaks one, an entry per field (its first problem); the other checks (the body, its fields, the contract's state, a renewal's or a link's conditions) stop at the first problem they find. | Code | Field | Refused when | |------|-------|--------------| | `InvalidBody` | — | The body is not a JSON object (a list, a bare value), or a `PUT` of contract terms sends no attribute. | | `UnknownField` | the attribute | The endpoint does not take the attribute; one entry per attribute. | | `NotSingleValue` | the attribute | On a `PUT` of contract terms, a list sent for a term that takes one value (every term but `metadata` and `external_references`). On a link, the same list answers the term's own code. | | `Required` | `parent_document_id`, `relation_type`, `external_references[i].system`, `external_references[i].id` | A first link without `parent_document_id` (a pending link that was removed meanwhile) or `relation_type`; an `external_references` item without `system` or `id` (`i` is its place in the list sent, from 0). | | `Invalid` | the field | The value is not of the field's type or form: `status` not one of the four; `currency` not three letters; `auto_renew` not a boolean; `owner_id` not a user id; `value` not a number; `counterparty_name` holding HTML; `metadata` not an object; `external_references` not a list, an item's `system` (`external_references[i].system`) with characters other than letters, digits, `_`, `-` and `.`, or its `id` (`external_references[i].id`) with an emoji or another 4-byte character; `parent_document_id` not text; `relation_type` not `amendment`, `renewal` or `termination`; `term` not a whole number from 1; `reason` not text. On the list: a filter sent as a list, a `status` not one of the four, `ending_within_days` not a whole number. | | `TooSmall`, `TooBig` | the field | `value` below 0 or above 9999999999999.99; `renewal_term_months` outside 1 to 600; `notice_period_days` (and the list's `ending_within_days`) outside 0 to 3650. | | `TooLong` | the field | `counterparty_name` over 255 characters, counting each emoji as stored (several characters); `counterparty_taxpayer_id` over 20; `reason` over 500; `external_references[i].system` over 64 or `external_references[i].id` over 255. | | `TooMany` | `external_references` | More than 20 items. | | `TooManyDecimals` | `value` | More than two decimal places. | | `InvalidDate` | `start_date`, `end_date`, `updated_at`; the list's `end_date_from`, `end_date_to` | Not a date as `YYYY-MM-DD` (an impossible one such as `2026-02-30` included); `updated_at` not a date and time as the API writes it (`2026-10-23T12:00:00Z`, or with an offset). | | `DateTooEarly` | `start_date`, `end_date` | Before the year 1000. | | `DateTooLate` | `end_date` | A renewal by the term would pass 9999-12-31. | | `EndBeforeStart` | `end_date` | Before `start_date`. | | `InvalidTaxpayerId` | `counterparty_taxpayer_id` | Not a valid CPF or CNPJ (formatted or not). | | `NotAMember` | `owner_id` | Not an active member of the workspace. | | `TooManyKeys` | `metadata` | More than 50 keys. | | `InvalidKey` | `metadata` | A key that is not 1 to 40 letters, digits, `_`, `-` or `.`. | | `InvalidValue` | `metadata` | A value that is not plain text of at most 500 characters. | | `NumberUnderDateKey` | `metadata` | A number under a key ending in `_at`, or `stuck_since`, which the API would return as a date. | | `ListKeys` | `metadata` | Keys `0`, `1`, `2`…, which would read back as a list. | | `DuplicateReference` | `external_references` | Two items the database takes for one (accents, `ß` and `ss`); items equal case aside are merged, not refused. | | `StatusNotSettable` | `status` | A tracked contract sent `expired` or `terminated`, or a closed one sent `draft` or `active`: a contract is closed by terminating it and reopened by renewing it. | | `CannotReturnToDraft` | `status` | An `active` contract sent `draft`. | | `ExpiredNeedsPastEndDate` | `end_date` | New terms with status `expired` and no `end_date` before today. | | `TerminatedNeedsEndDate` | `end_date` | New terms with status `terminated` and no `end_date`. | | `UnsignableDocument` | — | New terms, or a first link, on a cancelled, declined or expired document. Terms or a link already on one stay editable. | | `DocumentIsAmendment` | — | Terms of its own for a document linked as an amendment: its terms are the changes it makes. | | `DocumentHasOwnTerms` | — | A link for a document that tracks a contract of its own: a document is a contract or an amendment, never both. | | `ParentHasNoTerms` | `parent_document_id` | The parent named has no contract terms, nor amends a contract that has. | | `ParentTerminated` | `parent_document_id` | The parent contract is terminated. | | `NoTermChanged` | — | An `amendment` that changes no term, also by dropping its last one. A `renewal` or `termination` may change none. | | `TermNotAllowed` | the term | A term the relation type cannot change: a `renewal` changes only `end_date` and `value`, a `termination` only `end_date`. | | `AmendmentApplied` | — | The amendment applied when its document was signed and can no longer change. | | `TermOrEndDateRequired` | — | A renewal sends neither `term` nor `end_date`. | | `TermMismatch` | `term` | Not the contract's current term: the renewal already happened. | | `ContractTerminated` | — | A renewal of a terminated contract. | | `EndDateRequired` | `end_date` | A renewal by the term, or a `renewal` link without `end_date`, of a contract without an end date. | | `EndDateNotAfterCurrent` | `end_date` | A renewal, or a `renewal` link, to a date not after the current end date. | | `AlreadyTerminated` | — | A termination of a contract already terminated. | A body that is not valid JSON is refused before it reaches these endpoints, with the platform's `400` and no `errors`. A link is also checked against what applying it today would give the parent, so a delta the contract would refuse comes back with the contract's own codes.
|
|
5048
|
+
|
|
5049
|
+
```json
|
|
5050
|
+
{
|
|
5051
|
+
"status": 400,
|
|
5052
|
+
"message": "value must be no less than 0.",
|
|
5053
|
+
"errors": [
|
|
5054
|
+
{
|
|
5055
|
+
"field": "value",
|
|
5056
|
+
"code": "TooSmall",
|
|
5057
|
+
"message": "value must be no less than 0."
|
|
5058
|
+
},
|
|
5059
|
+
{
|
|
5060
|
+
"field": "currency",
|
|
5061
|
+
"code": "Invalid",
|
|
5062
|
+
"message": "currency is invalid."
|
|
5063
|
+
}
|
|
5064
|
+
]
|
|
5065
|
+
}
|
|
5066
|
+
```
|
|
5067
|
+
|
|
5068
|
+
##### 403 — The workspace's plan does not include contract tracking.
|
|
5069
|
+
|
|
5070
|
+
```json
|
|
5071
|
+
{
|
|
5072
|
+
"status": 403,
|
|
5073
|
+
"message": "Contract tracking is not available for your current plan."
|
|
5074
|
+
}
|
|
5075
|
+
```
|
|
5076
|
+
|
|
5077
|
+
##### 409 — The write sent the `updated_at` it read the contract (or the amendment link) with, and the contract changed since: by another user, an integration or the hourly run. Nothing was written. Read it again, check the change still applies, and send it with the new `updated_at`.
|
|
5078
|
+
|
|
5079
|
+
```json
|
|
5080
|
+
{
|
|
5081
|
+
"status": 409,
|
|
5082
|
+
"message": "The contract changed after it was read; read it again and resend the change.",
|
|
5083
|
+
"code": "ContractChanged"
|
|
5084
|
+
}
|
|
5085
|
+
```
|
|
5086
|
+
|
|
5087
|
+
##### 404 — The document is not in the workspace (`Document not found.`), or carries no contract terms (on a read: neither its own nor those of a contract it amends whose document still exists). Only the second has a `code`, `NoContractTerms`, so a document without terms can be told from one that is not there.
|
|
5088
|
+
|
|
5089
|
+
```json
|
|
5090
|
+
{
|
|
5091
|
+
"status": 404,
|
|
5092
|
+
"message": "This document has no contract terms.",
|
|
5093
|
+
"code": "NoContractTerms"
|
|
5094
|
+
}
|
|
5095
|
+
```
|
|
5096
|
+
|
|
5097
|
+
##### 401 — Missing or invalid credentials.
|
|
5098
|
+
|
|
5099
|
+
```json
|
|
5100
|
+
{
|
|
5101
|
+
"status": 401,
|
|
5102
|
+
"message": "Bad request.",
|
|
5103
|
+
"data": null
|
|
5104
|
+
}
|
|
5105
|
+
```
|
|
5106
|
+
|
|
5107
|
+
##### 500 — Unexpected server error.
|
|
5108
|
+
|
|
5109
|
+
```json
|
|
5110
|
+
{
|
|
5111
|
+
"status": 500,
|
|
5112
|
+
"message": "Bad request.",
|
|
5113
|
+
"data": null
|
|
5114
|
+
}
|
|
5115
|
+
```
|
|
5116
|
+
|
|
5117
|
+
### Terminate a contract
|
|
5118
|
+
|
|
5119
|
+
`POST /v1/accounts/{accountId}/documents/{documentId}/contract/terminate`
|
|
5120
|
+
|
|
5121
|
+
Closes the contract: its status becomes `terminated` and the lifecycle job stops alerting on it. Records a `document_contract_terminated` event carrying the `reason`. Needs a plan with contract tracking (`403` otherwise).
|
|
5122
|
+
|
|
5123
|
+
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
5124
|
+
|
|
5125
|
+
#### Parameters
|
|
5126
|
+
|
|
5127
|
+
| Name | In | Type | Required | Description |
|
|
5128
|
+
|---|---|---|---|---|
|
|
5129
|
+
| `accountId` | path | string | yes | Workspace account ID. |
|
|
5130
|
+
| `documentId` | path | string | yes | Document ID. |
|
|
5131
|
+
|
|
5132
|
+
#### Request Body
|
|
5133
|
+
|
|
5134
|
+
Fields (`application/json`):
|
|
5135
|
+
|
|
5136
|
+
- `reason` (string | null) — Kept in the `document_contract_terminated` event; HTML is stripped.
|
|
5137
|
+
- `updated_at` (string) — Optional precondition: the contract's `updated_at` as read. Changed since: `409`, nothing terminated.
|
|
5138
|
+
|
|
5139
|
+
Example — Terminate with a reason:
|
|
5140
|
+
|
|
5141
|
+
```json
|
|
5142
|
+
{
|
|
5143
|
+
"reason": "Fornecedor substituído"
|
|
5144
|
+
}
|
|
5145
|
+
```
|
|
5146
|
+
|
|
5147
|
+
#### Responses
|
|
5148
|
+
|
|
5149
|
+
##### 200 — The terminated contract
|
|
5150
|
+
|
|
5151
|
+
**The terminated contract**
|
|
5152
|
+
|
|
5153
|
+
```json
|
|
5154
|
+
{
|
|
5155
|
+
"status": 200,
|
|
5156
|
+
"message": "",
|
|
5157
|
+
"data": {
|
|
5158
|
+
"resource": "document_contract",
|
|
5159
|
+
"document_id": "example_id_30",
|
|
5160
|
+
"status": "terminated",
|
|
5161
|
+
"counterparty_name": "Acme Ltda",
|
|
5162
|
+
"counterparty_taxpayer_id": "00000000000",
|
|
5163
|
+
"value": 120000.5,
|
|
5164
|
+
"currency": "BRL",
|
|
5165
|
+
"start_date": "2026-11-01",
|
|
5166
|
+
"end_date": "2027-10-31",
|
|
5167
|
+
"auto_renew": true,
|
|
5168
|
+
"renewal_term_months": 12,
|
|
5169
|
+
"notice_period_days": 30,
|
|
5170
|
+
"term": 1,
|
|
5171
|
+
"owner_id": "example_id_31",
|
|
5172
|
+
"metadata": {
|
|
5173
|
+
"crm_stage": "won"
|
|
5174
|
+
},
|
|
5175
|
+
"external_references": [
|
|
5176
|
+
{
|
|
5177
|
+
"system": "hubspot",
|
|
5178
|
+
"id": "example_id_32"
|
|
5179
|
+
}
|
|
5180
|
+
],
|
|
5181
|
+
"created_at": "2026-10-23T12:00:00Z",
|
|
5182
|
+
"updated_at": "2027-03-02T14:00:00Z"
|
|
5183
|
+
}
|
|
5184
|
+
}
|
|
5185
|
+
```
|
|
5186
|
+
|
|
5187
|
+
##### 400 — The request breaks a contract rule. `errors` has one entry per problem found: the `field` as sent (`null` when the request as a whole is refused), a stable `code` to translate, and the `message` in the platform's language; `message` at the top is the first entry's. The contract's own rules on the terms, and the external references' items, report every field that breaks one, an entry per field (its first problem); the other checks (the body, its fields, the contract's state, a renewal's or a link's conditions) stop at the first problem they find. | Code | Field | Refused when | |------|-------|--------------| | `InvalidBody` | — | The body is not a JSON object (a list, a bare value), or a `PUT` of contract terms sends no attribute. | | `UnknownField` | the attribute | The endpoint does not take the attribute; one entry per attribute. | | `NotSingleValue` | the attribute | On a `PUT` of contract terms, a list sent for a term that takes one value (every term but `metadata` and `external_references`). On a link, the same list answers the term's own code. | | `Required` | `parent_document_id`, `relation_type`, `external_references[i].system`, `external_references[i].id` | A first link without `parent_document_id` (a pending link that was removed meanwhile) or `relation_type`; an `external_references` item without `system` or `id` (`i` is its place in the list sent, from 0). | | `Invalid` | the field | The value is not of the field's type or form: `status` not one of the four; `currency` not three letters; `auto_renew` not a boolean; `owner_id` not a user id; `value` not a number; `counterparty_name` holding HTML; `metadata` not an object; `external_references` not a list, an item's `system` (`external_references[i].system`) with characters other than letters, digits, `_`, `-` and `.`, or its `id` (`external_references[i].id`) with an emoji or another 4-byte character; `parent_document_id` not text; `relation_type` not `amendment`, `renewal` or `termination`; `term` not a whole number from 1; `reason` not text. On the list: a filter sent as a list, a `status` not one of the four, `ending_within_days` not a whole number. | | `TooSmall`, `TooBig` | the field | `value` below 0 or above 9999999999999.99; `renewal_term_months` outside 1 to 600; `notice_period_days` (and the list's `ending_within_days`) outside 0 to 3650. | | `TooLong` | the field | `counterparty_name` over 255 characters, counting each emoji as stored (several characters); `counterparty_taxpayer_id` over 20; `reason` over 500; `external_references[i].system` over 64 or `external_references[i].id` over 255. | | `TooMany` | `external_references` | More than 20 items. | | `TooManyDecimals` | `value` | More than two decimal places. | | `InvalidDate` | `start_date`, `end_date`, `updated_at`; the list's `end_date_from`, `end_date_to` | Not a date as `YYYY-MM-DD` (an impossible one such as `2026-02-30` included); `updated_at` not a date and time as the API writes it (`2026-10-23T12:00:00Z`, or with an offset). | | `DateTooEarly` | `start_date`, `end_date` | Before the year 1000. | | `DateTooLate` | `end_date` | A renewal by the term would pass 9999-12-31. | | `EndBeforeStart` | `end_date` | Before `start_date`. | | `InvalidTaxpayerId` | `counterparty_taxpayer_id` | Not a valid CPF or CNPJ (formatted or not). | | `NotAMember` | `owner_id` | Not an active member of the workspace. | | `TooManyKeys` | `metadata` | More than 50 keys. | | `InvalidKey` | `metadata` | A key that is not 1 to 40 letters, digits, `_`, `-` or `.`. | | `InvalidValue` | `metadata` | A value that is not plain text of at most 500 characters. | | `NumberUnderDateKey` | `metadata` | A number under a key ending in `_at`, or `stuck_since`, which the API would return as a date. | | `ListKeys` | `metadata` | Keys `0`, `1`, `2`…, which would read back as a list. | | `DuplicateReference` | `external_references` | Two items the database takes for one (accents, `ß` and `ss`); items equal case aside are merged, not refused. | | `StatusNotSettable` | `status` | A tracked contract sent `expired` or `terminated`, or a closed one sent `draft` or `active`: a contract is closed by terminating it and reopened by renewing it. | | `CannotReturnToDraft` | `status` | An `active` contract sent `draft`. | | `ExpiredNeedsPastEndDate` | `end_date` | New terms with status `expired` and no `end_date` before today. | | `TerminatedNeedsEndDate` | `end_date` | New terms with status `terminated` and no `end_date`. | | `UnsignableDocument` | — | New terms, or a first link, on a cancelled, declined or expired document. Terms or a link already on one stay editable. | | `DocumentIsAmendment` | — | Terms of its own for a document linked as an amendment: its terms are the changes it makes. | | `DocumentHasOwnTerms` | — | A link for a document that tracks a contract of its own: a document is a contract or an amendment, never both. | | `ParentHasNoTerms` | `parent_document_id` | The parent named has no contract terms, nor amends a contract that has. | | `ParentTerminated` | `parent_document_id` | The parent contract is terminated. | | `NoTermChanged` | — | An `amendment` that changes no term, also by dropping its last one. A `renewal` or `termination` may change none. | | `TermNotAllowed` | the term | A term the relation type cannot change: a `renewal` changes only `end_date` and `value`, a `termination` only `end_date`. | | `AmendmentApplied` | — | The amendment applied when its document was signed and can no longer change. | | `TermOrEndDateRequired` | — | A renewal sends neither `term` nor `end_date`. | | `TermMismatch` | `term` | Not the contract's current term: the renewal already happened. | | `ContractTerminated` | — | A renewal of a terminated contract. | | `EndDateRequired` | `end_date` | A renewal by the term, or a `renewal` link without `end_date`, of a contract without an end date. | | `EndDateNotAfterCurrent` | `end_date` | A renewal, or a `renewal` link, to a date not after the current end date. | | `AlreadyTerminated` | — | A termination of a contract already terminated. | A body that is not valid JSON is refused before it reaches these endpoints, with the platform's `400` and no `errors`. A link is also checked against what applying it today would give the parent, so a delta the contract would refuse comes back with the contract's own codes.
|
|
5188
|
+
|
|
5189
|
+
```json
|
|
5190
|
+
{
|
|
5191
|
+
"status": 400,
|
|
5192
|
+
"message": "value must be no less than 0.",
|
|
5193
|
+
"errors": [
|
|
5194
|
+
{
|
|
5195
|
+
"field": "value",
|
|
5196
|
+
"code": "TooSmall",
|
|
5197
|
+
"message": "value must be no less than 0."
|
|
5198
|
+
},
|
|
5199
|
+
{
|
|
5200
|
+
"field": "currency",
|
|
5201
|
+
"code": "Invalid",
|
|
5202
|
+
"message": "currency is invalid."
|
|
5203
|
+
}
|
|
5204
|
+
]
|
|
5205
|
+
}
|
|
5206
|
+
```
|
|
5207
|
+
|
|
5208
|
+
##### 403 — The workspace's plan does not include contract tracking.
|
|
5209
|
+
|
|
5210
|
+
```json
|
|
5211
|
+
{
|
|
5212
|
+
"status": 403,
|
|
5213
|
+
"message": "Contract tracking is not available for your current plan."
|
|
5214
|
+
}
|
|
5215
|
+
```
|
|
5216
|
+
|
|
5217
|
+
##### 409 — The write sent the `updated_at` it read the contract (or the amendment link) with, and the contract changed since: by another user, an integration or the hourly run. Nothing was written. Read it again, check the change still applies, and send it with the new `updated_at`.
|
|
5218
|
+
|
|
5219
|
+
```json
|
|
5220
|
+
{
|
|
5221
|
+
"status": 409,
|
|
5222
|
+
"message": "The contract changed after it was read; read it again and resend the change.",
|
|
5223
|
+
"code": "ContractChanged"
|
|
5224
|
+
}
|
|
5225
|
+
```
|
|
5226
|
+
|
|
5227
|
+
##### 404 — The document is not in the workspace (`Document not found.`), or carries no contract terms (on a read: neither its own nor those of a contract it amends whose document still exists). Only the second has a `code`, `NoContractTerms`, so a document without terms can be told from one that is not there.
|
|
5228
|
+
|
|
5229
|
+
```json
|
|
5230
|
+
{
|
|
5231
|
+
"status": 404,
|
|
5232
|
+
"message": "This document has no contract terms.",
|
|
5233
|
+
"code": "NoContractTerms"
|
|
5234
|
+
}
|
|
5235
|
+
```
|
|
5236
|
+
|
|
5237
|
+
##### 401 — Missing or invalid credentials.
|
|
5238
|
+
|
|
5239
|
+
```json
|
|
5240
|
+
{
|
|
5241
|
+
"status": 401,
|
|
5242
|
+
"message": "Bad request.",
|
|
5243
|
+
"data": null
|
|
5244
|
+
}
|
|
5245
|
+
```
|
|
5246
|
+
|
|
5247
|
+
##### 500 — Unexpected server error.
|
|
5248
|
+
|
|
5249
|
+
```json
|
|
5250
|
+
{
|
|
5251
|
+
"status": 500,
|
|
5252
|
+
"message": "Bad request.",
|
|
5253
|
+
"data": null
|
|
5254
|
+
}
|
|
5255
|
+
```
|
|
5256
|
+
|
|
5257
|
+
## Fields
|
|
5258
|
+
|
|
5259
|
+
### List fields
|
|
5260
|
+
|
|
5261
|
+
`GET /v1/accounts/{accountId}/fields`
|
|
5262
|
+
|
|
5263
|
+
List the field definitions of a workspace.
|
|
5264
|
+
|
|
5265
|
+
When `include_standard` is enabled, records of type `signature`, `initial` and `signatureDate` are also returned. Every workspace has one of each, created with it; they cannot be created, and a field can't be placed on the `Editor` role with them.
|
|
5266
|
+
|
|
5267
|
+
To find the fields a sender can place on a document or template, list with `include_standard=true`: the result is every active field definition, signature fields included, and each one's `id` is the `field_id` to place.
|
|
5268
|
+
|
|
5269
|
+
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
5270
|
+
|
|
5271
|
+
#### Parameters
|
|
5272
|
+
|
|
5273
|
+
| Name | In | Type | Required | Description |
|
|
5274
|
+
|---|---|---|---|---|
|
|
5275
|
+
| `accountId` | path | string | yes | Workspace account ID. |
|
|
5276
|
+
| `include_inactive` | query | boolean | no | Include inactive field definitions. |
|
|
5277
|
+
| `include_standard` | query | boolean | no | Include standard field types (signature, initial, signatureDate). |
|
|
5278
|
+
|
|
5279
|
+
#### Responses
|
|
5280
|
+
|
|
5281
|
+
##### 200 — Field definitions
|
|
5282
|
+
|
|
5283
|
+
```json
|
|
5284
|
+
{
|
|
5285
|
+
"data": [
|
|
5286
|
+
{
|
|
5287
|
+
"resource": "field",
|
|
5288
|
+
"id": "example_id_20",
|
|
5289
|
+
"name": "Signature",
|
|
5290
|
+
"type": "signature",
|
|
5291
|
+
"regex": null,
|
|
5292
|
+
"is_pre_defined": true,
|
|
5293
|
+
"is_active": true,
|
|
5294
|
+
"is_required": true,
|
|
5295
|
+
"is_standard": true,
|
|
5296
|
+
"is_read_only": true,
|
|
5297
|
+
"is_visible": true
|
|
5298
|
+
}
|
|
5299
|
+
],
|
|
5300
|
+
"status": 200,
|
|
5301
|
+
"message": ""
|
|
5302
|
+
}
|
|
5303
|
+
```
|
|
5304
|
+
|
|
5305
|
+
##### 401 — Missing or invalid credentials.
|
|
5306
|
+
|
|
5307
|
+
```json
|
|
5308
|
+
{
|
|
5309
|
+
"status": 401,
|
|
5310
|
+
"message": "Bad request.",
|
|
5311
|
+
"data": null
|
|
5312
|
+
}
|
|
5313
|
+
```
|
|
5314
|
+
|
|
5315
|
+
##### 500 — Unexpected server error.
|
|
5316
|
+
|
|
5317
|
+
```json
|
|
5318
|
+
{
|
|
5319
|
+
"status": 500,
|
|
5320
|
+
"message": "Bad request.",
|
|
5321
|
+
"data": null
|
|
5322
|
+
}
|
|
5323
|
+
```
|
|
5324
|
+
|
|
5325
|
+
### Create field
|
|
5326
|
+
|
|
5327
|
+
`POST /v1/accounts/{accountId}/fields`
|
|
5328
|
+
|
|
5329
|
+
Create a field definition in the workspace.
|
|
5330
|
+
|
|
5331
|
+
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
5332
|
+
|
|
5333
|
+
#### Parameters
|
|
5334
|
+
|
|
5335
|
+
| Name | In | Type | Required | Description |
|
|
5336
|
+
|---|---|---|---|---|
|
|
5337
|
+
| `accountId` | path | string | yes | Workspace account ID. |
|
|
5338
|
+
|
|
5339
|
+
#### Request Body (required)
|
|
5340
|
+
|
|
5341
|
+
Fields (`application/json`):
|
|
5342
|
+
|
|
5343
|
+
- `name` (string, required)
|
|
5344
|
+
- `type` (string, required)
|
|
5345
|
+
- `regex` (string | null)
|
|
5346
|
+
- `is_required` (boolean)
|
|
5347
|
+
|
|
5348
|
+
Example:
|
|
5349
|
+
|
|
5350
|
+
```json
|
|
5351
|
+
{
|
|
5352
|
+
"name": "Full name",
|
|
5353
|
+
"type": "text",
|
|
5354
|
+
"regex": null,
|
|
5355
|
+
"is_required": true
|
|
5356
|
+
}
|
|
5357
|
+
```
|
|
5358
|
+
|
|
5359
|
+
#### Responses
|
|
5360
|
+
|
|
5361
|
+
##### 200 — The created field
|
|
5362
|
+
|
|
5363
|
+
```json
|
|
5364
|
+
{
|
|
5365
|
+
"data": {
|
|
5366
|
+
"resource": "field",
|
|
5367
|
+
"id": "example_id_20",
|
|
5368
|
+
"name": "Signature",
|
|
5369
|
+
"type": "signature",
|
|
5370
|
+
"regex": null,
|
|
5371
|
+
"is_pre_defined": true,
|
|
5372
|
+
"is_active": true,
|
|
5373
|
+
"is_required": true,
|
|
5374
|
+
"is_standard": true,
|
|
5375
|
+
"is_read_only": true,
|
|
5376
|
+
"is_visible": true
|
|
5377
|
+
},
|
|
5378
|
+
"status": 200,
|
|
5379
|
+
"message": ""
|
|
5380
|
+
}
|
|
5381
|
+
```
|
|
5382
|
+
|
|
5383
|
+
##### 400 — One or more fields failed validation.
|
|
5384
|
+
|
|
5385
|
+
```json
|
|
5386
|
+
{
|
|
5387
|
+
"status": 400,
|
|
5388
|
+
"message": "Bad request.",
|
|
5389
|
+
"data": null
|
|
5390
|
+
}
|
|
5391
|
+
```
|
|
5392
|
+
|
|
5393
|
+
##### 401 — Missing or invalid credentials.
|
|
5394
|
+
|
|
5395
|
+
```json
|
|
5396
|
+
{
|
|
5397
|
+
"status": 401,
|
|
5398
|
+
"message": "Bad request.",
|
|
5399
|
+
"data": null
|
|
5400
|
+
}
|
|
5401
|
+
```
|
|
5402
|
+
|
|
5403
|
+
##### 500 — Unexpected server error.
|
|
5404
|
+
|
|
5405
|
+
```json
|
|
5406
|
+
{
|
|
5407
|
+
"status": 500,
|
|
5408
|
+
"message": "Bad request.",
|
|
5409
|
+
"data": null
|
|
5410
|
+
}
|
|
5411
|
+
```
|
|
5412
|
+
|
|
5413
|
+
### Get field
|
|
5414
|
+
|
|
5415
|
+
`GET /v1/accounts/{accountId}/fields/{fieldId}`
|
|
5416
|
+
|
|
5417
|
+
Retrieve a single field definition.
|
|
5418
|
+
|
|
5419
|
+
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
5420
|
+
|
|
5421
|
+
#### Parameters
|
|
5422
|
+
|
|
5423
|
+
| Name | In | Type | Required | Description |
|
|
5424
|
+
|---|---|---|---|---|
|
|
5425
|
+
| `accountId` | path | string | yes | Workspace account ID. |
|
|
5426
|
+
| `fieldId` | path | string | yes | The field ID. |
|
|
5427
|
+
|
|
5428
|
+
#### Responses
|
|
5429
|
+
|
|
5430
|
+
##### 200 — The field
|
|
5431
|
+
|
|
5432
|
+
```json
|
|
5433
|
+
{
|
|
5434
|
+
"data": {
|
|
5435
|
+
"resource": "field",
|
|
5436
|
+
"id": "example_id_20",
|
|
5437
|
+
"name": "Signature",
|
|
5438
|
+
"type": "signature",
|
|
5439
|
+
"regex": null,
|
|
5440
|
+
"is_pre_defined": true,
|
|
5441
|
+
"is_active": true,
|
|
5442
|
+
"is_required": true,
|
|
5443
|
+
"is_standard": true,
|
|
5444
|
+
"is_read_only": true,
|
|
5445
|
+
"is_visible": true
|
|
5446
|
+
},
|
|
5447
|
+
"status": 200,
|
|
5448
|
+
"message": ""
|
|
5449
|
+
}
|
|
5450
|
+
```
|
|
5451
|
+
|
|
5452
|
+
##### 404 — The requested resource does not exist.
|
|
5453
|
+
|
|
5454
|
+
```json
|
|
5455
|
+
{
|
|
5456
|
+
"status": 404,
|
|
5457
|
+
"message": "Bad request.",
|
|
5458
|
+
"data": null
|
|
5459
|
+
}
|
|
5460
|
+
```
|
|
5461
|
+
|
|
5462
|
+
##### 401 — Missing or invalid credentials.
|
|
5463
|
+
|
|
5464
|
+
```json
|
|
5465
|
+
{
|
|
5466
|
+
"status": 401,
|
|
5467
|
+
"message": "Bad request.",
|
|
5468
|
+
"data": null
|
|
5469
|
+
}
|
|
5470
|
+
```
|
|
5471
|
+
|
|
5472
|
+
##### 500 — Unexpected server error.
|
|
5473
|
+
|
|
5474
|
+
```json
|
|
5475
|
+
{
|
|
5476
|
+
"status": 500,
|
|
5477
|
+
"message": "Bad request.",
|
|
5478
|
+
"data": null
|
|
5479
|
+
}
|
|
5480
|
+
```
|
|
5481
|
+
|
|
5482
|
+
### Update field
|
|
5483
|
+
|
|
5484
|
+
`PUT /v1/accounts/{accountId}/fields/{fieldId}`
|
|
5485
|
+
|
|
5486
|
+
Update a field definition.
|
|
5487
|
+
|
|
5488
|
+
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
5489
|
+
|
|
5490
|
+
#### Parameters
|
|
5491
|
+
|
|
5492
|
+
| Name | In | Type | Required | Description |
|
|
5493
|
+
|---|---|---|---|---|
|
|
5494
|
+
| `accountId` | path | string | yes | Workspace account ID. |
|
|
5495
|
+
| `fieldId` | path | string | yes | The field ID. |
|
|
5496
|
+
|
|
5497
|
+
#### Request Body (required)
|
|
5498
|
+
|
|
5499
|
+
Fields (`application/json`):
|
|
5500
|
+
|
|
5501
|
+
- `name` (string)
|
|
5502
|
+
- `regex` (string | null)
|
|
5503
|
+
- `is_active` (boolean)
|
|
5504
|
+
|
|
5505
|
+
Example:
|
|
5506
|
+
|
|
5507
|
+
```json
|
|
5508
|
+
{
|
|
5509
|
+
"name": "string",
|
|
5510
|
+
"regex": null,
|
|
5511
|
+
"is_active": true
|
|
5512
|
+
}
|
|
5513
|
+
```
|
|
5514
|
+
|
|
5515
|
+
#### Responses
|
|
5516
|
+
|
|
5517
|
+
##### 200 — The updated field
|
|
5518
|
+
|
|
5519
|
+
```json
|
|
5520
|
+
{
|
|
5521
|
+
"data": {
|
|
5522
|
+
"resource": "field",
|
|
4442
5523
|
"id": "example_id_20",
|
|
4443
5524
|
"name": "Signature",
|
|
4444
5525
|
"type": "signature",
|
|
@@ -4628,7 +5709,7 @@ Example:
|
|
|
4628
5709
|
```json
|
|
4629
5710
|
[
|
|
4630
5711
|
{
|
|
4631
|
-
"field_id": "
|
|
5712
|
+
"field_id": "example_id_35",
|
|
4632
5713
|
"value": "1111111111111"
|
|
4633
5714
|
}
|
|
4634
5715
|
]
|
|
@@ -4642,7 +5723,7 @@ Example:
|
|
|
4642
5723
|
{
|
|
4643
5724
|
"data": [
|
|
4644
5725
|
{
|
|
4645
|
-
"field_id": "
|
|
5726
|
+
"field_id": "example_id_35",
|
|
4646
5727
|
"type": "cpf",
|
|
4647
5728
|
"success": false,
|
|
4648
5729
|
"error_message": "Invalid CPF."
|
|
@@ -4677,7 +5758,7 @@ Example:
|
|
|
4677
5758
|
|
|
4678
5759
|
`GET /v1/field-types`
|
|
4679
5760
|
|
|
4680
|
-
List the
|
|
5761
|
+
List the types a workspace can create field definitions with (`POST /v1/accounts/{accountId}/fields`). The built-in `signature`, `initial` and `signatureDate` types are not listed: they can't be created, and their definitions come from `GET /v1/accounts/{accountId}/fields?include_standard=true`. `cpf` expects 11 digits; `cnpj` accepts 14-char values (letters A-Z allowed in positions 1–12 per the CNPJ Alfanumérico rule; check digits 13–14 stay numeric). Punctuation is ignored during validation.
|
|
4681
5762
|
|
|
4682
5763
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
4683
5764
|
|
|
@@ -4724,7 +5805,7 @@ List the possible field types. `cpf` expects 11 digits; `cnpj` accepts 14-char v
|
|
|
4724
5805
|
|
|
4725
5806
|
`GET /v1/users/self/notification-preferences`
|
|
4726
5807
|
|
|
4727
|
-
Which owner-facing document notifications the authenticated user receives by e-mail. All
|
|
5808
|
+
Which owner-facing document notifications the authenticated user receives by e-mail. All thirteen keys are always returned; everything defaults to `true`. Account and security e-mail (welcome, password reset, invitations, account deletion) is not configurable and never appears here. Not available to third-party OAuth applications (`403`), whatever their scopes: these are the user's personal settings. Assinafy's own apps can reach it.
|
|
4728
5809
|
|
|
4729
5810
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
4730
5811
|
|
|
@@ -4743,7 +5824,11 @@ Which owner-facing document notifications the authenticated user receives by e-m
|
|
|
4743
5824
|
"DocumentExpirationReset": true,
|
|
4744
5825
|
"DocumentProcessingFailed": true,
|
|
4745
5826
|
"TemplateProcessingFailed": true,
|
|
4746
|
-
"SignerWhatsappFailed": true
|
|
5827
|
+
"SignerWhatsappFailed": true,
|
|
5828
|
+
"ContractRenewalNotice": true,
|
|
5829
|
+
"ContractExpiring": true,
|
|
5830
|
+
"ContractExpired": true,
|
|
5831
|
+
"ContractRenewed": true
|
|
4747
5832
|
},
|
|
4748
5833
|
"status": 200,
|
|
4749
5834
|
"message": ""
|
|
@@ -4774,7 +5859,7 @@ Which owner-facing document notifications the authenticated user receives by e-m
|
|
|
4774
5859
|
|
|
4775
5860
|
`PUT /v1/users/self/notification-preferences`
|
|
4776
5861
|
|
|
4777
|
-
Merges the supplied map into the authenticated user's preferences. Send only the keys you want to change — omitted keys keep their current value. Setting a key to `false` stops that e-mail for this user in every account they belong to. Returns the full map. An unknown code, a non-boolean value, or an empty body is rejected with 400 and nothing is written.
|
|
5862
|
+
Merges the supplied map into the authenticated user's preferences. Send only the keys you want to change — omitted keys keep their current value. Setting a key to `false` stops that e-mail for this user in every account they belong to. Returns the full map. An unknown code, a non-boolean value, or an empty body is rejected with 400 and nothing is written. Not available to third-party OAuth applications (`403`), whatever their scopes: these are the user's personal settings. Assinafy's own apps can reach it.
|
|
4778
5863
|
|
|
4779
5864
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
4780
5865
|
|
|
@@ -4791,6 +5876,10 @@ Fields (`application/json`):
|
|
|
4791
5876
|
- `DocumentProcessingFailed` (boolean) — An uploaded document could not be processed.
|
|
4792
5877
|
- `TemplateProcessingFailed` (boolean) — A template could not be processed.
|
|
4793
5878
|
- `SignerWhatsappFailed` (boolean) — A WhatsApp notification to a signer could not be delivered.
|
|
5879
|
+
- `ContractRenewalNotice` (boolean) — A tracked contract entered its notice period: it is about to end or to renew.
|
|
5880
|
+
- `ContractExpiring` (boolean) — A tracked contract ends in 45 or in 30 days.
|
|
5881
|
+
- `ContractExpired` (boolean) — A tracked contract ended without renewal.
|
|
5882
|
+
- `ContractRenewed` (boolean) — A tracked contract was auto-renewed into its next term.
|
|
4794
5883
|
|
|
4795
5884
|
Example:
|
|
4796
5885
|
|
|
@@ -4804,7 +5893,11 @@ Example:
|
|
|
4804
5893
|
"DocumentExpirationReset": true,
|
|
4805
5894
|
"DocumentProcessingFailed": true,
|
|
4806
5895
|
"TemplateProcessingFailed": true,
|
|
4807
|
-
"SignerWhatsappFailed": true
|
|
5896
|
+
"SignerWhatsappFailed": true,
|
|
5897
|
+
"ContractRenewalNotice": true,
|
|
5898
|
+
"ContractExpiring": true,
|
|
5899
|
+
"ContractExpired": true,
|
|
5900
|
+
"ContractRenewed": true
|
|
4808
5901
|
}
|
|
4809
5902
|
```
|
|
4810
5903
|
|
|
@@ -4823,7 +5916,11 @@ Example:
|
|
|
4823
5916
|
"DocumentExpirationReset": true,
|
|
4824
5917
|
"DocumentProcessingFailed": true,
|
|
4825
5918
|
"TemplateProcessingFailed": true,
|
|
4826
|
-
"SignerWhatsappFailed": true
|
|
5919
|
+
"SignerWhatsappFailed": true,
|
|
5920
|
+
"ContractRenewalNotice": true,
|
|
5921
|
+
"ContractExpiring": true,
|
|
5922
|
+
"ContractExpired": true,
|
|
5923
|
+
"ContractRenewed": true
|
|
4827
5924
|
},
|
|
4828
5925
|
"status": 200,
|
|
4829
5926
|
"message": ""
|
|
@@ -4864,7 +5961,7 @@ Example:
|
|
|
4864
5961
|
|
|
4865
5962
|
`GET /v1/users/self/stats`
|
|
4866
5963
|
|
|
4867
|
-
The authenticated user's document-funnel KPIs summed across all accounts they currently belong to. `granularity=monthly` (default) returns the last 12 months, most recent first; `granularity=daily` with `month=YYYY-MM` returns that month's days. Series are zero-filled.
|
|
5964
|
+
The authenticated user's document-funnel KPIs summed across all accounts they currently belong to. `granularity=monthly` (default) returns the last 12 months, most recent first; `granularity=daily` with `month=YYYY-MM` returns that month's days. Series are zero-filled. Not available to OAuth access tokens (`403`): a token is bound to one workspace, so an OAuth app reads that workspace's figures from **Account document KPIs** instead.
|
|
4868
5965
|
|
|
4869
5966
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
4870
5967
|
|
|
@@ -4938,7 +6035,7 @@ The authenticated user's document-funnel KPIs summed across all accounts they cu
|
|
|
4938
6035
|
|
|
4939
6036
|
`GET /v1/users/self`
|
|
4940
6037
|
|
|
4941
|
-
Returns the profile of the user owning the access token.
|
|
6038
|
+
Returns the profile of the user owning the access token. Not available to OAuth access tokens (`403`); an OAuth app reads the user's identity from `GET /v1/oauth/userinfo`.
|
|
4942
6039
|
|
|
4943
6040
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
4944
6041
|
|
|
@@ -4951,7 +6048,7 @@ Returns the profile of the user owning the access token.
|
|
|
4951
6048
|
"data": {
|
|
4952
6049
|
"id": "example_id_28",
|
|
4953
6050
|
"name": "John Smith",
|
|
4954
|
-
"email": "
|
|
6051
|
+
"email": "user9@example.com",
|
|
4955
6052
|
"telephone": "+5500000000000",
|
|
4956
6053
|
"government_id": "00000000000",
|
|
4957
6054
|
"is_email_verified": false,
|
|
@@ -5031,7 +6128,7 @@ Example:
|
|
|
5031
6128
|
{
|
|
5032
6129
|
"grant_type": "authorization_code",
|
|
5033
6130
|
"code": "string",
|
|
5034
|
-
"redirect_uri": "https://example.com/example-url-
|
|
6131
|
+
"redirect_uri": "https://example.com/example-url-15",
|
|
5035
6132
|
"code_verifier": "string",
|
|
5036
6133
|
"refresh_token": "example_secret",
|
|
5037
6134
|
"client_id": "example_id_5",
|
|
@@ -5269,6 +6366,8 @@ Retrieve a publicly shared document by ID. Public endpoint.
|
|
|
5269
6366
|
},
|
|
5270
6367
|
"is_closed": false,
|
|
5271
6368
|
"signing_url": "https://example.com/example-url-3",
|
|
6369
|
+
"verification_code": "example_secret",
|
|
6370
|
+
"verification_url": "https://example.com/example-url-4",
|
|
5272
6371
|
"decline_reason": null,
|
|
5273
6372
|
"declined_by": null,
|
|
5274
6373
|
"tags": [
|
|
@@ -5284,9 +6383,10 @@ Retrieve a publicly shared document by ID. Public endpoint.
|
|
|
5284
6383
|
"number": 1,
|
|
5285
6384
|
"height": 2100,
|
|
5286
6385
|
"width": 1275,
|
|
5287
|
-
"download_url": "https://example.com/example-url-
|
|
6386
|
+
"download_url": "https://example.com/example-url-5"
|
|
5288
6387
|
}
|
|
5289
6388
|
],
|
|
6389
|
+
"has_contract": true,
|
|
5290
6390
|
"created_at": "2026-06-03T03:54:16Z",
|
|
5291
6391
|
"updated_at": "2026-06-03T03:54:16Z"
|
|
5292
6392
|
},
|
|
@@ -5341,7 +6441,7 @@ Example:
|
|
|
5341
6441
|
```json
|
|
5342
6442
|
{
|
|
5343
6443
|
"channel": "email",
|
|
5344
|
-
"recipient": "
|
|
6444
|
+
"recipient": "user1@example.com"
|
|
5345
6445
|
}
|
|
5346
6446
|
```
|
|
5347
6447
|
|
|
@@ -5354,13 +6454,13 @@ Example:
|
|
|
5354
6454
|
"data": {
|
|
5355
6455
|
"document": {
|
|
5356
6456
|
"resource": "document",
|
|
5357
|
-
"id": "
|
|
6457
|
+
"id": "example_id_36",
|
|
5358
6458
|
"name": "Contract.pdf",
|
|
5359
6459
|
"page_count": 3,
|
|
5360
6460
|
"created_by": "Jane Doe"
|
|
5361
6461
|
},
|
|
5362
6462
|
"channel": "email",
|
|
5363
|
-
"recipient": "
|
|
6463
|
+
"recipient": "user1@example.com"
|
|
5364
6464
|
},
|
|
5365
6465
|
"status": 200,
|
|
5366
6466
|
"message": ""
|
|
@@ -5403,7 +6503,7 @@ Example:
|
|
|
5403
6503
|
|
|
5404
6504
|
Return the signer identified by the signer access code, including the `has_signature`/`has_initial`/`is_signature_reusable` flags and the `verification_method` of this signature request. Available before verification, so the signing page can pick the right first step.
|
|
5405
6505
|
|
|
5406
|
-
**Authentication:** signer access code (`
|
|
6506
|
+
**Authentication:** signer access code (`signer-access-code` query or body parameter).
|
|
5407
6507
|
|
|
5408
6508
|
#### Responses
|
|
5409
6509
|
|
|
@@ -5419,7 +6519,7 @@ Return the signer identified by the signer access code, including the `has_signa
|
|
|
5419
6519
|
"resource": "signer",
|
|
5420
6520
|
"id": "example_id_14",
|
|
5421
6521
|
"full_name": "Example User",
|
|
5422
|
-
"email": "
|
|
6522
|
+
"email": "user3@example.com",
|
|
5423
6523
|
"whatsapp_phone_number": "+5500000000000",
|
|
5424
6524
|
"government_id": "00000000000",
|
|
5425
6525
|
"has_accepted_terms": false
|
|
@@ -5459,7 +6559,7 @@ Current state of the signer's identity document verification. Backfills a pendin
|
|
|
5459
6559
|
|
|
5460
6560
|
**In review:** the signer continues -- views, confirms their data and signs -- while the account reviews the result. The document is certificated only after the account approves every signer under review; if it rejects one, the document is cancelled and every signer receives the cancellation notice.
|
|
5461
6561
|
|
|
5462
|
-
**Authentication:** signer access code (`
|
|
6562
|
+
**Authentication:** signer access code (`signer-access-code` query or body parameter).
|
|
5463
6563
|
|
|
5464
6564
|
#### Responses
|
|
5465
6565
|
|
|
@@ -5470,7 +6570,7 @@ Current state of the signer's identity document verification. Backfills a pendin
|
|
|
5470
6570
|
"data": {
|
|
5471
6571
|
"can_start": false,
|
|
5472
6572
|
"status": "Pending",
|
|
5473
|
-
"url": "https://example.com/example-url-
|
|
6573
|
+
"url": "https://example.com/example-url-16",
|
|
5474
6574
|
"expires_at": "2026-10-07T21:18:47Z",
|
|
5475
6575
|
"completed_at": "2026-08-10T20:32:00Z"
|
|
5476
6576
|
},
|
|
@@ -5507,7 +6607,7 @@ Records the signer's biometric-processing consent and opens a provider session.
|
|
|
5507
6607
|
|
|
5508
6608
|
**One live session per signer:** this succeeds when no session exists yet, or when the last one Expired (the capture link lapsed before anything was submitted); the expired session is replaced by a new one. Otherwise -- Pending, In Review, Approved, Declined or Abandoned -- it returns `400`. A resend never destroys or replaces a live provider session, and the account is billed once per signer at assignment creation, never again on a restart. Recovering from a Declined or Abandoned verification means the account must start a whole new process (new document, new assignment).
|
|
5509
6609
|
|
|
5510
|
-
**Authentication:** signer access code (`
|
|
6610
|
+
**Authentication:** signer access code (`signer-access-code` query or body parameter).
|
|
5511
6611
|
|
|
5512
6612
|
#### Request Body (required)
|
|
5513
6613
|
|
|
@@ -5531,7 +6631,7 @@ Example:
|
|
|
5531
6631
|
{
|
|
5532
6632
|
"data": {
|
|
5533
6633
|
"id": "example_id_20",
|
|
5534
|
-
"url": "https://example.com/example-url-
|
|
6634
|
+
"url": "https://example.com/example-url-16",
|
|
5535
6635
|
"expires_at": "2026-10-07T21:18:47Z"
|
|
5536
6636
|
},
|
|
5537
6637
|
"status": 200,
|
|
@@ -5565,9 +6665,9 @@ Example:
|
|
|
5565
6665
|
|
|
5566
6666
|
`GET /v1/signers/{signerId}/document`
|
|
5567
6667
|
|
|
5568
|
-
Return the document and the signer's assignment items, scoped to the signer access code.
|
|
6668
|
+
Return the document and the signer's assignment items, scoped to the signer access code. The response adds `current_signer`: this signer, with their `verification_method`, `notification_methods` and `completed` (whether they have already signed).
|
|
5569
6669
|
|
|
5570
|
-
**Authentication:** signer access code (`
|
|
6670
|
+
**Authentication:** signer access code (`signer-access-code` query or body parameter).
|
|
5571
6671
|
|
|
5572
6672
|
#### Parameters
|
|
5573
6673
|
|
|
@@ -5593,6 +6693,8 @@ Return the document and the signer's assignment items, scoped to the signer acce
|
|
|
5593
6693
|
},
|
|
5594
6694
|
"is_closed": false,
|
|
5595
6695
|
"signing_url": "https://example.com/example-url-3",
|
|
6696
|
+
"verification_code": "example_secret",
|
|
6697
|
+
"verification_url": "https://example.com/example-url-4",
|
|
5596
6698
|
"decline_reason": null,
|
|
5597
6699
|
"declined_by": null,
|
|
5598
6700
|
"tags": [
|
|
@@ -5608,9 +6710,10 @@ Return the document and the signer's assignment items, scoped to the signer acce
|
|
|
5608
6710
|
"number": 1,
|
|
5609
6711
|
"height": 2100,
|
|
5610
6712
|
"width": 1275,
|
|
5611
|
-
"download_url": "https://example.com/example-url-
|
|
6713
|
+
"download_url": "https://example.com/example-url-5"
|
|
5612
6714
|
}
|
|
5613
6715
|
],
|
|
6716
|
+
"has_contract": true,
|
|
5614
6717
|
"created_at": "2026-06-03T03:54:16Z",
|
|
5615
6718
|
"updated_at": "2026-06-03T03:54:16Z"
|
|
5616
6719
|
},
|
|
@@ -5653,11 +6756,11 @@ Return the document and the signer's assignment items, scoped to the signer acce
|
|
|
5653
6756
|
|
|
5654
6757
|
`GET /v1/sign`
|
|
5655
6758
|
|
|
5656
|
-
Retrieve the document a signer has been invited to sign, using the signer access code. Marks the document as viewed. Returns 409 while the document is still being prepared (retry with backoff).
|
|
6759
|
+
Retrieve the document a signer has been invited to sign, using the signer access code. Marks the document as viewed. The assignment carries only this signer's items, and leaves out the other signers, their signing links (`signing_urls`), the copy receivers and the signing `summary`. The response adds `current_signer`: this signer, with their `verification_method`, `notification_methods` and `completed` (whether they have already signed). Returns 409 while the document is still being prepared (retry with backoff).
|
|
5657
6760
|
|
|
5658
6761
|
**Signers whose verification method is `DigitalCertificate`** must have confirmed their data *and* accepted the terms before this returns the document; otherwise it is `400`. Both are satisfied in one call to `PUT /v1/documents/{documentId}/signers/confirm-data` with `has_accepted_terms: true`, so send that before this endpoint — the `has_accepted_terms` query parameter here is too late to open the gate. `PUT /v1/signers/accept-terms` also works and is never gated.
|
|
5659
6762
|
|
|
5660
|
-
**Authentication:** signer access code (`
|
|
6763
|
+
**Authentication:** signer access code (`signer-access-code` query or body parameter).
|
|
5661
6764
|
|
|
5662
6765
|
#### Parameters
|
|
5663
6766
|
|
|
@@ -5683,6 +6786,8 @@ Retrieve the document a signer has been invited to sign, using the signer access
|
|
|
5683
6786
|
},
|
|
5684
6787
|
"is_closed": false,
|
|
5685
6788
|
"signing_url": "https://example.com/example-url-3",
|
|
6789
|
+
"verification_code": "example_secret",
|
|
6790
|
+
"verification_url": "https://example.com/example-url-4",
|
|
5686
6791
|
"decline_reason": null,
|
|
5687
6792
|
"declined_by": null,
|
|
5688
6793
|
"tags": [
|
|
@@ -5698,9 +6803,10 @@ Retrieve the document a signer has been invited to sign, using the signer access
|
|
|
5698
6803
|
"number": 1,
|
|
5699
6804
|
"height": 2100,
|
|
5700
6805
|
"width": 1275,
|
|
5701
|
-
"download_url": "https://example.com/example-url-
|
|
6806
|
+
"download_url": "https://example.com/example-url-5"
|
|
5702
6807
|
}
|
|
5703
6808
|
],
|
|
6809
|
+
"has_contract": true,
|
|
5704
6810
|
"created_at": "2026-06-03T03:54:16Z",
|
|
5705
6811
|
"updated_at": "2026-06-03T03:54:16Z"
|
|
5706
6812
|
},
|
|
@@ -5737,9 +6843,9 @@ Retrieve the document a signer has been invited to sign, using the signer access
|
|
|
5737
6843
|
|
|
5738
6844
|
`POST /v1/documents/{documentId}/assignments/{assignmentId}`
|
|
5739
6845
|
|
|
5740
|
-
Sign a document with input fields (collect method): submit the signer's item values, completing their items. For **virtual** assignments the signer must first confirm their data via `PUT /v1/documents/{documentId}/signers/confirm-data`, otherwise this returns `400` (Signer data must be confirmed before signing). Signers whose verification method is `DigitalCertificate` cannot use this endpoint — their signature must be produced through `POST /v1/signers/certificate/start` + `/complete`, and this returns `400`. The request body is a JSON array of item entries. Uses the signer access code.
|
|
6846
|
+
Sign a document with input fields (collect method): submit the signer's item values, completing their items. Signing again after the signer has signed changes nothing and returns the current assignment. For **virtual** assignments the signer must first confirm their data via `PUT /v1/documents/{documentId}/signers/confirm-data`, otherwise this returns `400` (Signer data must be confirmed before signing). Signers whose verification method is `DigitalCertificate` cannot use this endpoint — their signature must be produced through `POST /v1/signers/certificate/start` + `/complete`, and this returns `400`. The request body is a JSON array of item entries. Uses the signer access code.
|
|
5741
6847
|
|
|
5742
|
-
**Authentication:** signer access code (`
|
|
6848
|
+
**Authentication:** signer access code (`signer-access-code` query or body parameter).
|
|
5743
6849
|
|
|
5744
6850
|
#### Parameters
|
|
5745
6851
|
|
|
@@ -5775,7 +6881,9 @@ Example:
|
|
|
5775
6881
|
}
|
|
5776
6882
|
```
|
|
5777
6883
|
|
|
5778
|
-
##### 400 — Signer data must be confirmed before signing (virtual assignments),
|
|
6884
|
+
##### 400 — Signer data must be confirmed before signing (virtual assignments), the signer must sign with a digital certificate through the digital certificate endpoints, or an entry names a page, field or item that is not one of this signer's. Nothing is signed when an entry is refused.
|
|
6885
|
+
|
|
6886
|
+
##### 404 — The assignment is not the one the access code belongs to.
|
|
5779
6887
|
|
|
5780
6888
|
##### 409 — The document is not ready to be signed yet.
|
|
5781
6889
|
|
|
@@ -5805,7 +6913,7 @@ Example:
|
|
|
5805
6913
|
|
|
5806
6914
|
The signer declines to sign the document, giving a reason. Uses the signer access code.
|
|
5807
6915
|
|
|
5808
|
-
**Authentication:** signer access code (`
|
|
6916
|
+
**Authentication:** signer access code (`signer-access-code` query or body parameter).
|
|
5809
6917
|
|
|
5810
6918
|
#### Parameters
|
|
5811
6919
|
|
|
@@ -5840,6 +6948,8 @@ Example:
|
|
|
5840
6948
|
}
|
|
5841
6949
|
```
|
|
5842
6950
|
|
|
6951
|
+
##### 404 — The assignment is not the one this access code was issued for.
|
|
6952
|
+
|
|
5843
6953
|
##### 401 — Missing or invalid credentials.
|
|
5844
6954
|
|
|
5845
6955
|
```json
|
|
@@ -5866,7 +6976,7 @@ Example:
|
|
|
5866
6976
|
|
|
5867
6977
|
Sign several documents in one request, for a signer with multiple pending documents. Each document must be prepared for the **virtual** signature method. Uses the signer access code.
|
|
5868
6978
|
|
|
5869
|
-
**Authentication:** signer access code (`
|
|
6979
|
+
**Authentication:** signer access code (`signer-access-code` query or body parameter).
|
|
5870
6980
|
|
|
5871
6981
|
#### Request Body (required)
|
|
5872
6982
|
|
|
@@ -5879,8 +6989,8 @@ Example:
|
|
|
5879
6989
|
```json
|
|
5880
6990
|
{
|
|
5881
6991
|
"document_ids": [
|
|
5882
|
-
"
|
|
5883
|
-
"
|
|
6992
|
+
"example_id_37",
|
|
6993
|
+
"example_id_38"
|
|
5884
6994
|
]
|
|
5885
6995
|
}
|
|
5886
6996
|
```
|
|
@@ -5897,6 +7007,10 @@ Example:
|
|
|
5897
7007
|
}
|
|
5898
7008
|
```
|
|
5899
7009
|
|
|
7010
|
+
##### 400 — A listed document is not a virtual document of this signer, is not pending signature, or waits for an earlier signing step.
|
|
7011
|
+
|
|
7012
|
+
##### 404 — A listed document ID does not exist in the workspace. The message names the unknown IDs.
|
|
7013
|
+
|
|
5900
7014
|
##### 401 — Missing or invalid credentials.
|
|
5901
7015
|
|
|
5902
7016
|
```json
|
|
@@ -5923,7 +7037,7 @@ Example:
|
|
|
5923
7037
|
|
|
5924
7038
|
Decline several documents in one request. Uses the signer access code.
|
|
5925
7039
|
|
|
5926
|
-
**Authentication:** signer access code (`
|
|
7040
|
+
**Authentication:** signer access code (`signer-access-code` query or body parameter).
|
|
5927
7041
|
|
|
5928
7042
|
#### Request Body (required)
|
|
5929
7043
|
|
|
@@ -5937,8 +7051,8 @@ Example:
|
|
|
5937
7051
|
```json
|
|
5938
7052
|
{
|
|
5939
7053
|
"document_ids": [
|
|
5940
|
-
"
|
|
5941
|
-
"
|
|
7054
|
+
"example_id_37",
|
|
7055
|
+
"example_id_38"
|
|
5942
7056
|
],
|
|
5943
7057
|
"decline_reason": "Unfavorable terms."
|
|
5944
7058
|
}
|
|
@@ -5956,6 +7070,10 @@ Example:
|
|
|
5956
7070
|
}
|
|
5957
7071
|
```
|
|
5958
7072
|
|
|
7073
|
+
##### 400 — A listed document is not this signer's, is not pending signature, or waits for an earlier signing step. Nothing is declined.
|
|
7074
|
+
|
|
7075
|
+
##### 404 — A listed document ID does not exist in the workspace. The message names the unknown IDs.
|
|
7076
|
+
|
|
5959
7077
|
##### 401 — Missing or invalid credentials.
|
|
5960
7078
|
|
|
5961
7079
|
```json
|
|
@@ -5982,7 +7100,7 @@ Example:
|
|
|
5982
7100
|
|
|
5983
7101
|
Submit the verification code (OTP) sent to the signer to unlock the signing flow. Uses the signer access code.
|
|
5984
7102
|
|
|
5985
|
-
**Authentication:** signer access code (`
|
|
7103
|
+
**Authentication:** signer access code (`signer-access-code` query or body parameter).
|
|
5986
7104
|
|
|
5987
7105
|
#### Request Body (required)
|
|
5988
7106
|
|
|
@@ -6045,7 +7163,7 @@ Example:
|
|
|
6045
7163
|
|
|
6046
7164
|
The signer confirms or updates their data before signing. Uses the signer access code.
|
|
6047
7165
|
|
|
6048
|
-
**Authentication:** signer access code (`
|
|
7166
|
+
**Authentication:** signer access code (`signer-access-code` query or body parameter).
|
|
6049
7167
|
|
|
6050
7168
|
#### Parameters
|
|
6051
7169
|
|
|
@@ -6081,7 +7199,7 @@ Example:
|
|
|
6081
7199
|
"resource": "signer",
|
|
6082
7200
|
"id": "example_id_14",
|
|
6083
7201
|
"full_name": "Example User",
|
|
6084
|
-
"email": "
|
|
7202
|
+
"email": "user3@example.com",
|
|
6085
7203
|
"whatsapp_phone_number": "+5500000000000",
|
|
6086
7204
|
"government_id": "00000000000",
|
|
6087
7205
|
"has_accepted_terms": false
|
|
@@ -6117,7 +7235,7 @@ Example:
|
|
|
6117
7235
|
|
|
6118
7236
|
Record that the signer accepted the terms of use. Uses the signer access code.
|
|
6119
7237
|
|
|
6120
|
-
**Authentication:** signer access code (`
|
|
7238
|
+
**Authentication:** signer access code (`signer-access-code` query or body parameter).
|
|
6121
7239
|
|
|
6122
7240
|
#### Responses
|
|
6123
7241
|
|
|
@@ -6156,7 +7274,7 @@ Record that the signer accepted the terms of use. Uses the signer access code.
|
|
|
6156
7274
|
|
|
6157
7275
|
Upload the signer's signature (or initials) image as the raw request body. Uses the signer access code.
|
|
6158
7276
|
|
|
6159
|
-
**Authentication:** signer access code (`
|
|
7277
|
+
**Authentication:** signer access code (`signer-access-code` query or body parameter).
|
|
6160
7278
|
|
|
6161
7279
|
#### Parameters
|
|
6162
7280
|
|
|
@@ -6184,6 +7302,8 @@ Example:
|
|
|
6184
7302
|
}
|
|
6185
7303
|
```
|
|
6186
7304
|
|
|
7305
|
+
##### 400 — The image is not a PNG or JPEG file, or it is blank.
|
|
7306
|
+
|
|
6187
7307
|
##### 401 — Missing or invalid credentials.
|
|
6188
7308
|
|
|
6189
7309
|
```json
|
|
@@ -6210,7 +7330,7 @@ Example:
|
|
|
6210
7330
|
|
|
6211
7331
|
Download the signer's stored signature/initials image. Uses the signer access code.
|
|
6212
7332
|
|
|
6213
|
-
**Authentication:** signer access code (`
|
|
7333
|
+
**Authentication:** signer access code (`signer-access-code` query or body parameter).
|
|
6214
7334
|
|
|
6215
7335
|
#### Parameters
|
|
6216
7336
|
|
|
@@ -6256,9 +7376,9 @@ Download the signer's stored signature/initials image. Uses the signer access co
|
|
|
6256
7376
|
|
|
6257
7377
|
`GET /v1/signers/{signerId}/documents`
|
|
6258
7378
|
|
|
6259
|
-
List the documents a signer is party to. Accepts either the signer access code or the account's own credentials (API key or bearer token) — with account credentials, the signer must belong to that account's workspace.
|
|
7379
|
+
List the documents a signer is party to. Accepts either the signer access code or the account's own credentials (API key or bearer token) — with account credentials, the signer must belong to that account's workspace. With the signer access code, `signerId` must be the code's own signer (otherwise `403`), only documents whose signing step has been reached are listed, and each assignment leaves out `signing_urls`.
|
|
6260
7380
|
|
|
6261
|
-
**Authentication:** signer access code (`
|
|
7381
|
+
**Authentication:** signer access code (`signer-access-code` query or body parameter) or Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
6262
7382
|
|
|
6263
7383
|
#### Parameters
|
|
6264
7384
|
|
|
@@ -6287,6 +7407,8 @@ List the documents a signer is party to. Accepts either the signer access code o
|
|
|
6287
7407
|
},
|
|
6288
7408
|
"is_closed": false,
|
|
6289
7409
|
"signing_url": "https://example.com/example-url-3",
|
|
7410
|
+
"verification_code": "example_secret",
|
|
7411
|
+
"verification_url": "https://example.com/example-url-4",
|
|
6290
7412
|
"decline_reason": null,
|
|
6291
7413
|
"declined_by": null,
|
|
6292
7414
|
"tags": [
|
|
@@ -6302,9 +7424,10 @@ List the documents a signer is party to. Accepts either the signer access code o
|
|
|
6302
7424
|
"number": 1,
|
|
6303
7425
|
"height": 2100,
|
|
6304
7426
|
"width": 1275,
|
|
6305
|
-
"download_url": "https://example.com/example-url-
|
|
7427
|
+
"download_url": "https://example.com/example-url-5"
|
|
6306
7428
|
}
|
|
6307
7429
|
],
|
|
7430
|
+
"has_contract": true,
|
|
6308
7431
|
"created_at": "2026-06-03T03:54:16Z",
|
|
6309
7432
|
"updated_at": "2026-06-03T03:54:16Z"
|
|
6310
7433
|
}
|
|
@@ -6314,6 +7437,8 @@ List the documents a signer is party to. Accepts either the signer access code o
|
|
|
6314
7437
|
}
|
|
6315
7438
|
```
|
|
6316
7439
|
|
|
7440
|
+
##### 403 — The access code belongs to another signer.
|
|
7441
|
+
|
|
6317
7442
|
##### 401 — Missing or invalid credentials.
|
|
6318
7443
|
|
|
6319
7444
|
```json
|
|
@@ -6338,9 +7463,9 @@ List the documents a signer is party to. Accepts either the signer access code o
|
|
|
6338
7463
|
|
|
6339
7464
|
`GET /v1/signers/{signerId}/documents/search`
|
|
6340
7465
|
|
|
6341
|
-
Search the documents a signer is party to (compact representation). Accepts either the signer access code or the account's own credentials (API key or bearer token) — with account credentials, the signer must belong to that account's workspace.
|
|
7466
|
+
Search the documents a signer is party to (compact representation). Accepts either the signer access code or the account's own credentials (API key or bearer token) — with account credentials, the signer must belong to that account's workspace. With the signer access code, `signerId` must be the code's own signer (otherwise `403`), only documents whose signing step has been reached are listed, and each assignment leaves out `signing_urls`.
|
|
6342
7467
|
|
|
6343
|
-
**Authentication:** signer access code (`
|
|
7468
|
+
**Authentication:** signer access code (`signer-access-code` query or body parameter) or Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
6344
7469
|
|
|
6345
7470
|
#### Parameters
|
|
6346
7471
|
|
|
@@ -6368,6 +7493,8 @@ Search the documents a signer is party to (compact representation). Accepts eith
|
|
|
6368
7493
|
},
|
|
6369
7494
|
"is_closed": false,
|
|
6370
7495
|
"signing_url": "https://example.com/example-url-3",
|
|
7496
|
+
"verification_code": "example_secret",
|
|
7497
|
+
"verification_url": "https://example.com/example-url-4",
|
|
6371
7498
|
"decline_reason": null,
|
|
6372
7499
|
"declined_by": null,
|
|
6373
7500
|
"tags": [
|
|
@@ -6383,9 +7510,10 @@ Search the documents a signer is party to (compact representation). Accepts eith
|
|
|
6383
7510
|
"number": 1,
|
|
6384
7511
|
"height": 2100,
|
|
6385
7512
|
"width": 1275,
|
|
6386
|
-
"download_url": "https://example.com/example-url-
|
|
7513
|
+
"download_url": "https://example.com/example-url-5"
|
|
6387
7514
|
}
|
|
6388
7515
|
],
|
|
7516
|
+
"has_contract": true,
|
|
6389
7517
|
"created_at": "2026-06-03T03:54:16Z",
|
|
6390
7518
|
"updated_at": "2026-06-03T03:54:16Z"
|
|
6391
7519
|
}
|
|
@@ -6395,6 +7523,8 @@ Search the documents a signer is party to (compact representation). Accepts eith
|
|
|
6395
7523
|
}
|
|
6396
7524
|
```
|
|
6397
7525
|
|
|
7526
|
+
##### 403 — The access code belongs to another signer.
|
|
7527
|
+
|
|
6398
7528
|
##### 401 — Missing or invalid credentials.
|
|
6399
7529
|
|
|
6400
7530
|
```json
|
|
@@ -6485,7 +7615,7 @@ List the signers of a workspace.
|
|
|
6485
7615
|
"resource": "signer",
|
|
6486
7616
|
"id": "example_id_14",
|
|
6487
7617
|
"full_name": "Example User",
|
|
6488
|
-
"email": "
|
|
7618
|
+
"email": "user3@example.com",
|
|
6489
7619
|
"whatsapp_phone_number": "+5500000000000",
|
|
6490
7620
|
"government_id": "00000000000",
|
|
6491
7621
|
"has_accepted_terms": false
|
|
@@ -6544,7 +7674,7 @@ Example:
|
|
|
6544
7674
|
```json
|
|
6545
7675
|
{
|
|
6546
7676
|
"full_name": "Example User",
|
|
6547
|
-
"email": "
|
|
7677
|
+
"email": "user3@example.com",
|
|
6548
7678
|
"whatsapp_phone_number": "+5500000000000",
|
|
6549
7679
|
"government_id": "00000000000"
|
|
6550
7680
|
}
|
|
@@ -6560,7 +7690,7 @@ Example:
|
|
|
6560
7690
|
"resource": "signer",
|
|
6561
7691
|
"id": "example_id_14",
|
|
6562
7692
|
"full_name": "Example User",
|
|
6563
|
-
"email": "
|
|
7693
|
+
"email": "user3@example.com",
|
|
6564
7694
|
"whatsapp_phone_number": "+5500000000000",
|
|
6565
7695
|
"government_id": "00000000000",
|
|
6566
7696
|
"has_accepted_terms": false
|
|
@@ -6625,7 +7755,7 @@ Retrieve a signer's information.
|
|
|
6625
7755
|
"resource": "signer",
|
|
6626
7756
|
"id": "example_id_14",
|
|
6627
7757
|
"full_name": "Example User",
|
|
6628
|
-
"email": "
|
|
7758
|
+
"email": "user3@example.com",
|
|
6629
7759
|
"whatsapp_phone_number": "+5500000000000",
|
|
6630
7760
|
"government_id": "00000000000",
|
|
6631
7761
|
"has_accepted_terms": false
|
|
@@ -6669,7 +7799,9 @@ Retrieve a signer's information.
|
|
|
6669
7799
|
|
|
6670
7800
|
`PUT /v1/accounts/{accountId}/signers/{signerId}`
|
|
6671
7801
|
|
|
6672
|
-
Update a signer's information.
|
|
7802
|
+
Update a signer's information. Only the fields sent change; send just the ones you are changing.
|
|
7803
|
+
|
|
7804
|
+
**Clearing a field:** `null` or `"` clears `email`, `whatsapp_phone_number` and `government_id` (`whatsapp_phone_number` is stored as `null` either way; the other two keep the value sent). `full_name` cannot be cleared.
|
|
6673
7805
|
|
|
6674
7806
|
**Verification integrity:** `email` / `whatsapp_phone_number` cannot be changed while the signer has verified that channel on an in-flight (not yet certificated) document — the response is `400` naming the offending document(s). Already-certificated documents do not block updates. Changing a channel that has *unverified* in-flight requests rotates their access/verification codes (invalidating previously sent links/OTPs); use the resend endpoint to redeliver. `full_name` can always be updated.
|
|
6675
7807
|
|
|
@@ -6687,8 +7819,8 @@ Update a signer's information.
|
|
|
6687
7819
|
Fields (`application/json`):
|
|
6688
7820
|
|
|
6689
7821
|
- `full_name` (string)
|
|
6690
|
-
- `email` (string)
|
|
6691
|
-
- `whatsapp_phone_number` (string) — E.164; normalized on save.
|
|
7822
|
+
- `email` (string) — Can't be changed or cleared while the signer has verified it on an in-flight document (`400`).
|
|
7823
|
+
- `whatsapp_phone_number` (string) — E.164; normalized on save, and compared after normalizing, so the same number in another format is not a change. Can't be changed or cleared while the signer has verified it on an in-flight document (`400`).
|
|
6692
7824
|
- `government_id` (string) — Signer's CPF (11 digits) or CNPJ (14 characters; may be alphanumeric). Formatting is accepted and the value is normalized on save.
|
|
6693
7825
|
|
|
6694
7826
|
Example:
|
|
@@ -6696,7 +7828,7 @@ Example:
|
|
|
6696
7828
|
```json
|
|
6697
7829
|
{
|
|
6698
7830
|
"full_name": "Example User",
|
|
6699
|
-
"email": "
|
|
7831
|
+
"email": "user3@example.com",
|
|
6700
7832
|
"whatsapp_phone_number": "+5500000000000",
|
|
6701
7833
|
"government_id": "00000000000"
|
|
6702
7834
|
}
|
|
@@ -6712,7 +7844,7 @@ Example:
|
|
|
6712
7844
|
"resource": "signer",
|
|
6713
7845
|
"id": "example_id_14",
|
|
6714
7846
|
"full_name": "Example User",
|
|
6715
|
-
"email": "
|
|
7847
|
+
"email": "user3@example.com",
|
|
6716
7848
|
"whatsapp_phone_number": "+5500000000000",
|
|
6717
7849
|
"government_id": "00000000000",
|
|
6718
7850
|
"has_accepted_terms": false
|
|
@@ -7154,7 +8286,7 @@ The `status` field of a template is one of:
|
|
|
7154
8286
|
"data": [
|
|
7155
8287
|
{
|
|
7156
8288
|
"resource": "template",
|
|
7157
|
-
"id": "
|
|
8289
|
+
"id": "example_id_39",
|
|
7158
8290
|
"name": "template.pdf",
|
|
7159
8291
|
"document_name": null,
|
|
7160
8292
|
"message": null,
|
|
@@ -7165,7 +8297,7 @@ The `status` field of a template is one of:
|
|
|
7165
8297
|
"number": 1,
|
|
7166
8298
|
"height": 2100,
|
|
7167
8299
|
"width": 1275,
|
|
7168
|
-
"download_url": "https://example.com/example-url-
|
|
8300
|
+
"download_url": "https://example.com/example-url-15",
|
|
7169
8301
|
"fields": [
|
|
7170
8302
|
{
|
|
7171
8303
|
"id": "example_id_5",
|
|
@@ -7257,7 +8389,9 @@ Retrieve the account's oldest webhook endpoint — which events it is subscribed
|
|
|
7257
8389
|
"document_prepared"
|
|
7258
8390
|
],
|
|
7259
8391
|
"is_active": true,
|
|
7260
|
-
"
|
|
8392
|
+
"is_held": false,
|
|
8393
|
+
"held_since": null,
|
|
8394
|
+
"url": "https://example.com/example-url-17",
|
|
7261
8395
|
"email": "user11@example.com",
|
|
7262
8396
|
"updated_at": "2023-05-10T14:58:24Z"
|
|
7263
8397
|
},
|
|
@@ -7306,7 +8440,7 @@ Fields (`application/json`):
|
|
|
7306
8440
|
|
|
7307
8441
|
- `events` (array, required) — Event type codes to subscribe to (see `GET /v1/webhooks/event-types`).
|
|
7308
8442
|
- `is_active` (boolean, required) — Whether events should be delivered to the webhook.
|
|
7309
|
-
- `url` (string, required) — The URL that will receive events.
|
|
8443
|
+
- `url` (string, required) — The URL that will receive events: `https` for a new or changed URL (a URL stored before keeps working). Its host must resolve to a public address (`400` otherwise), and redirects are not followed.
|
|
7310
8444
|
- `email` (string, required) — Email that receives important webhook-communication notices.
|
|
7311
8445
|
|
|
7312
8446
|
Example:
|
|
@@ -7318,7 +8452,7 @@ Example:
|
|
|
7318
8452
|
"document_prepared"
|
|
7319
8453
|
],
|
|
7320
8454
|
"is_active": true,
|
|
7321
|
-
"url": "https://example.com/example-url-
|
|
8455
|
+
"url": "https://example.com/example-url-17",
|
|
7322
8456
|
"email": "user11@example.com"
|
|
7323
8457
|
}
|
|
7324
8458
|
```
|
|
@@ -7335,7 +8469,9 @@ Example:
|
|
|
7335
8469
|
"document_prepared"
|
|
7336
8470
|
],
|
|
7337
8471
|
"is_active": true,
|
|
7338
|
-
"
|
|
8472
|
+
"is_held": false,
|
|
8473
|
+
"held_since": null,
|
|
8474
|
+
"url": "https://example.com/example-url-17",
|
|
7339
8475
|
"email": "user11@example.com",
|
|
7340
8476
|
"updated_at": "2023-05-10T14:58:24Z"
|
|
7341
8477
|
},
|
|
@@ -7400,7 +8536,9 @@ Deactivate the account's oldest webhook endpoint. While inactive, no events are
|
|
|
7400
8536
|
"document_prepared"
|
|
7401
8537
|
],
|
|
7402
8538
|
"is_active": true,
|
|
7403
|
-
"
|
|
8539
|
+
"is_held": false,
|
|
8540
|
+
"held_since": null,
|
|
8541
|
+
"url": "https://example.com/example-url-17",
|
|
7404
8542
|
"email": "user11@example.com",
|
|
7405
8543
|
"updated_at": "2023-05-10T14:58:24Z"
|
|
7406
8544
|
},
|
|
@@ -7504,13 +8642,17 @@ Retrieve the delivery history for webhooks sent to the account's endpoints — u
|
|
|
7504
8642
|
"data": [
|
|
7505
8643
|
{
|
|
7506
8644
|
"resource": "activity_dispatching_history",
|
|
7507
|
-
"id": "
|
|
8645
|
+
"id": "example_id_40",
|
|
7508
8646
|
"event": "document_ready",
|
|
7509
8647
|
"activity_id": 456,
|
|
7510
|
-
"endpoint_id": "
|
|
7511
|
-
"endpoint": "https://example.com/example-url-
|
|
8648
|
+
"endpoint_id": "example_id_41",
|
|
8649
|
+
"endpoint": "https://example.com/example-url-18",
|
|
7512
8650
|
"payload": null,
|
|
7513
8651
|
"delivered": true,
|
|
8652
|
+
"webhook_id": "example_id_42",
|
|
8653
|
+
"attempt": 2,
|
|
8654
|
+
"kind": "scheduled",
|
|
8655
|
+
"will_retry": true,
|
|
7514
8656
|
"http_status": 200,
|
|
7515
8657
|
"response_body": "OK",
|
|
7516
8658
|
"error": null,
|
|
@@ -7547,7 +8689,7 @@ Retrieve the delivery history for webhooks sent to the account's endpoints — u
|
|
|
7547
8689
|
|
|
7548
8690
|
`POST /v1/accounts/{accountId}/webhooks/{historyId}/retry`
|
|
7549
8691
|
|
|
7550
|
-
|
|
8692
|
+
Sends the entry's event to the entry's endpoint once, now, even while the endpoint is paused, and returns the dispatch entry of that attempt; a delivery that gets through lifts the pause. Requires the `webhooks:write` OAuth scope.
|
|
7551
8693
|
|
|
7552
8694
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
7553
8695
|
|
|
@@ -7566,13 +8708,17 @@ Manually retry a webhook delivery for a specific entry, without waiting for auto
|
|
|
7566
8708
|
{
|
|
7567
8709
|
"data": {
|
|
7568
8710
|
"resource": "activity_dispatching_history",
|
|
7569
|
-
"id": "
|
|
8711
|
+
"id": "example_id_40",
|
|
7570
8712
|
"event": "document_ready",
|
|
7571
8713
|
"activity_id": 456,
|
|
7572
|
-
"endpoint_id": "
|
|
7573
|
-
"endpoint": "https://example.com/example-url-
|
|
8714
|
+
"endpoint_id": "example_id_41",
|
|
8715
|
+
"endpoint": "https://example.com/example-url-18",
|
|
7574
8716
|
"payload": null,
|
|
7575
8717
|
"delivered": true,
|
|
8718
|
+
"webhook_id": "example_id_42",
|
|
8719
|
+
"attempt": 2,
|
|
8720
|
+
"kind": "scheduled",
|
|
8721
|
+
"will_retry": true,
|
|
7576
8722
|
"http_status": 200,
|
|
7577
8723
|
"response_body": "OK",
|
|
7578
8724
|
"error": null,
|
|
@@ -7647,15 +8793,18 @@ List the account's webhook endpoints, oldest first. Requires the `account:read`
|
|
|
7647
8793
|
{
|
|
7648
8794
|
"data": [
|
|
7649
8795
|
{
|
|
7650
|
-
"
|
|
8796
|
+
"resource": "activity_event_subscription",
|
|
8797
|
+
"id": "example_id_41",
|
|
7651
8798
|
"name": "ERP",
|
|
7652
|
-
"url": "https://example.com/example-url-
|
|
8799
|
+
"url": "https://example.com/example-url-19",
|
|
7653
8800
|
"email": "user12@example.com",
|
|
7654
8801
|
"events": [
|
|
7655
8802
|
"document_ready",
|
|
7656
8803
|
"signer_signed_document"
|
|
7657
8804
|
],
|
|
7658
8805
|
"is_active": true,
|
|
8806
|
+
"is_held": false,
|
|
8807
|
+
"held_since": null,
|
|
7659
8808
|
"signing_enabled": true,
|
|
7660
8809
|
"created_at": "2026-10-01T12:00:00Z",
|
|
7661
8810
|
"updated_at": "2026-10-01T12:00:00Z"
|
|
@@ -7690,7 +8839,7 @@ List the account's webhook endpoints, oldest first. Requires the `account:read`
|
|
|
7690
8839
|
|
|
7691
8840
|
`POST /v1/accounts/{accountId}/webhooks/endpoints`
|
|
7692
8841
|
|
|
7693
|
-
Register a URL to receive the account's webhook events. An account can have 1 endpoint, or up to 3 on paid plans; creating one past the limit returns `403`. Each endpoint of a workspace must have a different `url` (`400` otherwise). When `signing_enabled` is `true`, a signing secret is generated and returned once, as `secret` in this response — store it, since it is never shown in list or view responses. It can be read again later with **Get webhook endpoint signing secret**, except by OAuth applications: an OAuth application that loses the secret
|
|
8842
|
+
Register a URL to receive the account's webhook events. An account can have 1 endpoint, or up to 3 on paid plans; creating one past the limit returns `403`. Each endpoint of a workspace must have a different `url` (`400` otherwise). When `signing_enabled` is `true`, a signing secret is generated and returned once, as `secret` in this response — store it, since it is never shown in list or view responses. It can be read again later with **Get webhook endpoint signing secret**, except by OAuth applications: an OAuth application that loses the secret gets a new one with **Rotate webhook endpoint signing secret**. Requires the `webhooks:write` OAuth scope.
|
|
7694
8843
|
|
|
7695
8844
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
7696
8845
|
|
|
@@ -7704,7 +8853,7 @@ Register a URL to receive the account's webhook events. An account can have 1 en
|
|
|
7704
8853
|
|
|
7705
8854
|
Fields (`application/json`):
|
|
7706
8855
|
|
|
7707
|
-
- `url` (string, required) — URL that receives the events
|
|
8856
|
+
- `url` (string, required) — URL that receives the events: `https` for a new or changed URL (a URL stored before keeps working). Its host must resolve to a public address; private, loopback, link-local and other reserved addresses are refused with `400`. Deliveries don't follow redirects: a `3xx` answer counts as a failed delivery.
|
|
7708
8857
|
- `email` (string, required) — Contact email for delivery-failure notices.
|
|
7709
8858
|
- `events` (array, required) — Event types to deliver (see `GET /v1/webhooks/event-types`).
|
|
7710
8859
|
- `name` (string) — Label to tell endpoints apart.
|
|
@@ -7715,7 +8864,7 @@ Example:
|
|
|
7715
8864
|
|
|
7716
8865
|
```json
|
|
7717
8866
|
{
|
|
7718
|
-
"url": "https://example.com/example-url-
|
|
8867
|
+
"url": "https://example.com/example-url-19",
|
|
7719
8868
|
"email": "user12@example.com",
|
|
7720
8869
|
"events": [
|
|
7721
8870
|
"document_ready",
|
|
@@ -7735,15 +8884,18 @@ Example:
|
|
|
7735
8884
|
{
|
|
7736
8885
|
"data": {
|
|
7737
8886
|
"secret": "example_secret",
|
|
7738
|
-
"
|
|
8887
|
+
"resource": "activity_event_subscription",
|
|
8888
|
+
"id": "example_id_41",
|
|
7739
8889
|
"name": "ERP",
|
|
7740
|
-
"url": "https://example.com/example-url-
|
|
8890
|
+
"url": "https://example.com/example-url-19",
|
|
7741
8891
|
"email": "user12@example.com",
|
|
7742
8892
|
"events": [
|
|
7743
8893
|
"document_ready",
|
|
7744
8894
|
"signer_signed_document"
|
|
7745
8895
|
],
|
|
7746
8896
|
"is_active": true,
|
|
8897
|
+
"is_held": false,
|
|
8898
|
+
"held_since": null,
|
|
7747
8899
|
"signing_enabled": true,
|
|
7748
8900
|
"created_at": "2026-10-01T12:00:00Z",
|
|
7749
8901
|
"updated_at": "2026-10-01T12:00:00Z"
|
|
@@ -7882,15 +9034,18 @@ Retrieve one webhook endpoint. Requires the `account:read` OAuth scope.
|
|
|
7882
9034
|
```json
|
|
7883
9035
|
{
|
|
7884
9036
|
"data": {
|
|
7885
|
-
"
|
|
9037
|
+
"resource": "activity_event_subscription",
|
|
9038
|
+
"id": "example_id_41",
|
|
7886
9039
|
"name": "ERP",
|
|
7887
|
-
"url": "https://example.com/example-url-
|
|
9040
|
+
"url": "https://example.com/example-url-19",
|
|
7888
9041
|
"email": "user12@example.com",
|
|
7889
9042
|
"events": [
|
|
7890
9043
|
"document_ready",
|
|
7891
9044
|
"signer_signed_document"
|
|
7892
9045
|
],
|
|
7893
9046
|
"is_active": true,
|
|
9047
|
+
"is_held": false,
|
|
9048
|
+
"held_since": null,
|
|
7894
9049
|
"signing_enabled": true,
|
|
7895
9050
|
"created_at": "2026-10-01T12:00:00Z",
|
|
7896
9051
|
"updated_at": "2026-10-01T12:00:00Z"
|
|
@@ -7934,7 +9089,7 @@ Retrieve one webhook endpoint. Requires the `account:read` OAuth scope.
|
|
|
7934
9089
|
|
|
7935
9090
|
`PUT /v1/accounts/{accountId}/webhooks/endpoints/{endpointId}`
|
|
7936
9091
|
|
|
7937
|
-
Change a webhook endpoint. Only the fields sent are updated; `url` cannot be one another endpoint of the workspace already uses (`400`). Setting `signing_enabled` to `true` generates a secret if the endpoint has none and keeps the current one otherwise; setting it to `false` discards the secret. Requires the `webhooks:write` OAuth scope.
|
|
9092
|
+
Change a webhook endpoint. Only the fields sent are updated; `url` cannot be one another endpoint of the workspace already uses, nor point to a private or reserved address (`400`). Setting `signing_enabled` to `true` generates a secret if the endpoint has none and keeps the current one otherwise; setting it to `false` discards the secret. When this request turns signing on, the new secret is returned once, as `secret` in this response, as on create; otherwise `secret` is absent. Requires the `webhooks:write` OAuth scope.
|
|
7938
9093
|
|
|
7939
9094
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
7940
9095
|
|
|
@@ -7960,7 +9115,7 @@ Example:
|
|
|
7960
9115
|
|
|
7961
9116
|
```json
|
|
7962
9117
|
{
|
|
7963
|
-
"url": "https://example.com/example-url-
|
|
9118
|
+
"url": "https://example.com/example-url-19",
|
|
7964
9119
|
"email": "user12@example.com",
|
|
7965
9120
|
"events": [
|
|
7966
9121
|
"document_ready"
|
|
@@ -7978,15 +9133,19 @@ Example:
|
|
|
7978
9133
|
```json
|
|
7979
9134
|
{
|
|
7980
9135
|
"data": {
|
|
7981
|
-
"
|
|
9136
|
+
"secret": "example_secret",
|
|
9137
|
+
"resource": "activity_event_subscription",
|
|
9138
|
+
"id": "example_id_41",
|
|
7982
9139
|
"name": "ERP",
|
|
7983
|
-
"url": "https://example.com/example-url-
|
|
9140
|
+
"url": "https://example.com/example-url-19",
|
|
7984
9141
|
"email": "user12@example.com",
|
|
7985
9142
|
"events": [
|
|
7986
9143
|
"document_ready",
|
|
7987
9144
|
"signer_signed_document"
|
|
7988
9145
|
],
|
|
7989
9146
|
"is_active": true,
|
|
9147
|
+
"is_held": false,
|
|
9148
|
+
"held_since": null,
|
|
7990
9149
|
"signing_enabled": true,
|
|
7991
9150
|
"created_at": "2026-10-01T12:00:00Z",
|
|
7992
9151
|
"updated_at": "2026-10-01T12:00:00Z"
|
|
@@ -8097,7 +9256,7 @@ Stop delivering events to an endpoint and free its slot. Requires the `webhooks:
|
|
|
8097
9256
|
|
|
8098
9257
|
`GET /v1/accounts/{accountId}/webhooks/endpoints/{endpointId}/secret`
|
|
8099
9258
|
|
|
8100
|
-
Return the secret used to sign deliveries to this endpoint (see **Webhook Payloads → Verifying signatures**). Returns `400` when signing is disabled. Not available to OAuth applications
|
|
9259
|
+
Return the secret used to sign deliveries to this endpoint (see **Webhook Payloads → Verifying signatures**). Returns `400` when signing is disabled. Not available to OAuth applications: they receive a secret only when one is generated, in the **Create webhook endpoint** or **Update webhook endpoint** response (when that request turns signing on) or from **Rotate webhook endpoint signing secret**.
|
|
8101
9260
|
|
|
8102
9261
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
8103
9262
|
|
|
@@ -8166,7 +9325,7 @@ Return the secret used to sign deliveries to this endpoint (see **Webhook Payloa
|
|
|
8166
9325
|
|
|
8167
9326
|
`POST /v1/accounts/{accountId}/webhooks/endpoints/{endpointId}/secret/rotate`
|
|
8168
9327
|
|
|
8169
|
-
Replace the endpoint's signing secret and return the new one. The old secret stops working immediately, so update your receiver right away. Returns `400` when signing is disabled.
|
|
9328
|
+
Replace the endpoint's signing secret and return the new one. The old secret stops working immediately, so update your receiver right away. Returns `400` when signing is disabled. Requires the `webhooks:write` OAuth scope.
|
|
8170
9329
|
|
|
8171
9330
|
**Authentication:** Bearer access token (`Authorization: Bearer ...`) or API key (`X-Api-Key` header).
|
|
8172
9331
|
|