@assinafy/cli 2.5.2 → 2.6.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/.env.example +1 -1
- package/README.en.md +24 -3
- package/README.md +22 -2
- package/dist/api.cjs +124 -29
- package/dist/api.cjs.map +1 -1
- package/dist/api.js +124 -29
- package/dist/api.js.map +1 -1
- package/dist/cli.cjs +606 -418
- package/dist/types/api/client.d.ts.map +1 -1
- package/dist/types/api/resources/assignments.d.ts +7 -1
- package/dist/types/api/resources/assignments.d.ts.map +1 -1
- package/dist/types/api/resources/documents.d.ts.map +1 -1
- package/dist/types/api/resources/signer-documents.d.ts +24 -11
- package/dist/types/api/resources/signer-documents.d.ts.map +1 -1
- package/dist/types/api/resources/webhooks.d.ts +10 -5
- package/dist/types/api/resources/webhooks.d.ts.map +1 -1
- package/dist/types/api/support/webhook-verifier.d.ts.map +1 -1
- package/dist/types/api/types.d.ts +87 -4
- package/dist/types/api/types.d.ts.map +1 -1
- package/dist/types/api/utils.d.ts.map +1 -1
- package/docs/README.md +1 -1
- package/docs/api-operations.json +49 -1
- package/docs/api-reference.md +464 -45
- package/docs/assignments.md +67 -9
- package/docs/sdk-reference.md +86 -11
- package/docs/signer.md +27 -0
- package/docs/signers.md +14 -12
- package/docs/webhooks.md +18 -2
- package/package.json +1 -1
package/docs/assignments.md
CHANGED
|
@@ -8,17 +8,20 @@ Usage: assinafy assignments [options] [command]
|
|
|
8
8
|
Create and manage signing assignments
|
|
9
9
|
|
|
10
10
|
Options:
|
|
11
|
-
-h, --help
|
|
11
|
+
-h, --help display help for command
|
|
12
12
|
|
|
13
13
|
Commands:
|
|
14
|
-
list [options]
|
|
15
|
-
create [options] <documentId>
|
|
16
|
-
estimate-cost [options] <documentId>
|
|
17
|
-
reset-expiration [options] <documentId> <assignmentId>
|
|
18
|
-
resend <documentId> <assignmentId> <signerId>
|
|
19
|
-
estimate-resend-cost <documentId> <assignmentId> <signerId>
|
|
20
|
-
whatsapp-notifications <documentId> <assignmentId>
|
|
21
|
-
|
|
14
|
+
list [options] List assignments across the account
|
|
15
|
+
create [options] <documentId> Create a signing assignment for a document
|
|
16
|
+
estimate-cost [options] <documentId> Estimate the credit cost of an assignment
|
|
17
|
+
reset-expiration [options] <documentId> <assignmentId> Update an assignment expiration date
|
|
18
|
+
resend <documentId> <assignmentId> <signerId> Resend the signing notification to a signer
|
|
19
|
+
estimate-resend-cost <documentId> <assignmentId> <signerId> Estimate the cost of resending a signer notification
|
|
20
|
+
whatsapp-notifications <documentId> <assignmentId> List WhatsApp notifications sent for an assignment
|
|
21
|
+
identity-verification <documentId> <assignmentId> <signerId> Fetch a signer identity review and its evidence summary
|
|
22
|
+
identity-image [options] <documentId> <assignmentId> <signerId> Download identity review evidence while the review is open
|
|
23
|
+
review-identity [options] <documentId> <assignmentId> <signerId> Approve certification or reject and cancel the document after identity review
|
|
24
|
+
help [command] display help for command
|
|
22
25
|
```
|
|
23
26
|
|
|
24
27
|
### `assinafy assignments list`
|
|
@@ -145,3 +148,58 @@ Arguments:
|
|
|
145
148
|
Options:
|
|
146
149
|
-h, --help display help for command
|
|
147
150
|
```
|
|
151
|
+
|
|
152
|
+
### `assinafy assignments identity-verification`
|
|
153
|
+
|
|
154
|
+
```text
|
|
155
|
+
Usage: assinafy assignments identity-verification [options] <documentId> <assignmentId> <signerId>
|
|
156
|
+
|
|
157
|
+
Fetch a signer identity review and its evidence summary
|
|
158
|
+
|
|
159
|
+
Arguments:
|
|
160
|
+
documentId Document ID
|
|
161
|
+
assignmentId Assignment ID
|
|
162
|
+
signerId Signer ID
|
|
163
|
+
|
|
164
|
+
Options:
|
|
165
|
+
-h, --help display help for command
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### `assinafy assignments identity-image`
|
|
169
|
+
|
|
170
|
+
```text
|
|
171
|
+
Usage: assinafy assignments identity-image [options] <documentId> <assignmentId> <signerId>
|
|
172
|
+
|
|
173
|
+
Download identity review evidence while the review is open
|
|
174
|
+
|
|
175
|
+
Arguments:
|
|
176
|
+
documentId Document ID
|
|
177
|
+
assignmentId Assignment ID
|
|
178
|
+
signerId Signer ID
|
|
179
|
+
|
|
180
|
+
Options:
|
|
181
|
+
--name <name> Evidence image name (choices: "document_front",
|
|
182
|
+
"document_back", "document_pdf", "face")
|
|
183
|
+
-o, --output <path> Output path for JPEG/PNG evidence or the document PDF
|
|
184
|
+
--force Overwrite the output file if it already exists
|
|
185
|
+
-h, --help display help for command
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### `assinafy assignments review-identity`
|
|
189
|
+
|
|
190
|
+
```text
|
|
191
|
+
Usage: assinafy assignments review-identity [options] <documentId> <assignmentId> <signerId>
|
|
192
|
+
|
|
193
|
+
Approve certification or reject and cancel the document after identity review
|
|
194
|
+
|
|
195
|
+
Arguments:
|
|
196
|
+
documentId Document ID
|
|
197
|
+
assignmentId Assignment ID
|
|
198
|
+
signerId Signer ID
|
|
199
|
+
|
|
200
|
+
Options:
|
|
201
|
+
--decision <decision> Review decision (choices: "Approved", "Rejected")
|
|
202
|
+
--note <note> Private review note (at most 2000 characters)
|
|
203
|
+
-y, --yes Skip the confirmation prompt
|
|
204
|
+
-h, --help display help for command
|
|
205
|
+
```
|
package/docs/sdk-reference.md
CHANGED
|
@@ -73,8 +73,9 @@ const publicClient = new AssinafyClient({ allowUnauthenticated: true });
|
|
|
73
73
|
whatsapp_phone_number?: string;
|
|
74
74
|
phone?: string;
|
|
75
75
|
cpf?: string;
|
|
76
|
+
government_id?: string;
|
|
76
77
|
metadata?: Record<string, unknown>;
|
|
77
|
-
verification_method?: 'Email' | 'Whatsapp' | 'DigitalCertificate';
|
|
78
|
+
verification_method?: 'Email' | 'Whatsapp' | 'DigitalCertificate' | 'IdDocumentFaceMatchBasic';
|
|
78
79
|
notification_methods?: Array<'Email' | 'Whatsapp'>;
|
|
79
80
|
step?: number;
|
|
80
81
|
}>;
|
|
@@ -170,6 +171,9 @@ Document responses expose typed `IDocumentArtifacts`, `IDocumentPage`, inline ta
|
|
|
170
171
|
| `resendNotification(documentId, assignmentId, signerId)` | [`PUT …/signers/{signerId}/resend`](./api-reference.md#resend-signature-request) | `IResendEmailResponse` |
|
|
171
172
|
| `estimateResendCost(documentId, assignmentId, signerId)` | [`POST …/estimate-resend-cost`](./api-reference.md#estimate-resend-cost) | `IResendCostEstimate` |
|
|
172
173
|
| `listWhatsAppNotifications(documentId, assignmentId)` | [`GET …/whatsapp-notifications`](./api-reference.md#list-whatsapp-notifications) | `IWhatsAppNotification[]` |
|
|
174
|
+
| `getIdentityVerification(documentId, assignmentId, signerId)` | [`GET …/signers/{signerId}/identity-verification`](./api-reference.md#signer-identity-review) | `ISignerIdentityReview` |
|
|
175
|
+
| `downloadIdentityVerificationImage(documentId, assignmentId, signerId, name)` | [`GET …/identity-verification/images/{name}`](./api-reference.md#signer-identity-review-image) | `Buffer` (JPEG, PNG or PDF) |
|
|
176
|
+
| `reviewIdentityVerification(documentId, assignmentId, signerId, payload)` | [`POST …/identity-verification/review`](./api-reference.md#decide-signer-identity-review) | `ISignerIdentityReview`; payload is `IIdentityReviewPayload` |
|
|
173
177
|
|
|
174
178
|
Assignment payload:
|
|
175
179
|
|
|
@@ -179,7 +183,7 @@ Assignment payload:
|
|
|
179
183
|
signers?: Array<string | {
|
|
180
184
|
id?: string;
|
|
181
185
|
signer_id?: string;
|
|
182
|
-
verification_method?: 'Email' | 'Whatsapp' | 'DigitalCertificate';
|
|
186
|
+
verification_method?: 'Email' | 'Whatsapp' | 'DigitalCertificate' | 'IdDocumentFaceMatchBasic';
|
|
183
187
|
notification_methods?: Array<'Email' | 'Whatsapp'>;
|
|
184
188
|
step?: number;
|
|
185
189
|
}>;
|
|
@@ -220,17 +224,19 @@ Production defaults `notification_methods: []` to `['Email']` and sends an invit
|
|
|
220
224
|
| `delete(signerId, accountId?)` | [`DELETE /accounts/{accountId}/signers/{signerId}`](./api-reference.md#delete-signer) | `IEmptyResult` (`unknown[]`) |
|
|
221
225
|
| `findByEmail(email, accountId?)` | SDK helper over `list({ search: email })` | `ISigner | null` |
|
|
222
226
|
|
|
223
|
-
Create payload: `{ full_name: string; email?; whatsapp_phone_number?; phone?; cpf?; metadata? }`. Update payload: `{ full_name?; email?; whatsapp_phone_number?; phone?; government_id?; cpf? }`. `phone`, create-time `cpf`/`metadata`, and update-time `cpf` are compatibility extensions;
|
|
227
|
+
Create payload: `{ full_name: string; email?; whatsapp_phone_number?; government_id?; phone?; cpf?; metadata? }`. Update payload: `{ full_name?; email?; whatsapp_phone_number?; phone?; government_id?; cpf? }`. `government_id` accepts CPF or numeric/alphanumeric CNPJ and is forwarded unchanged for server normalization. `phone`, create-time `cpf`/`metadata`, and update-time `cpf` are compatibility extensions; the `cpf` alias retains its digit-only normalization. New integrations should use the published fields. Creation is idempotent by exact case-insensitive email when email is supplied; full-name-only signers are valid. Existing email matches are reused without updating their government ID; call `update` explicitly when needed. List params support published `search` and compatible `sort?: 'full_name' | '-full_name'`; ignored sort fields are rejected locally.
|
|
224
228
|
|
|
225
229
|
## Signer-side flows (`client.signerDocuments`)
|
|
226
230
|
|
|
227
|
-
These methods use the private `signer-access-code`, not the workspace API key, except for the artifact download that the API publishes as a public route. `
|
|
231
|
+
These methods use the private `signer-access-code`, not the workspace API key, except for the artifact download that the API publishes as a public route. `listAsOwner` and `searchAsOwner` call the same routes with the client's API key or bearer token instead; the signer must belong to that workspace. For email or WhatsApp verification, obtain the access code from the verification link and the OTP from the same message. An invitation containing only a document ID and recipient is not an access code. Call `self` and `getAssignment` to confirm the signer and document before submitting a decision; keep each document's verification credentials together.
|
|
228
232
|
|
|
229
233
|
| SDK method | HTTP operation | Resolves to |
|
|
230
234
|
| --- | --- | --- |
|
|
231
235
|
| `getCurrent(signerId, accessCode)` | [`GET /signers/{signerId}/document`](./api-reference.md#get-signers-document) | `IDocumentDetailsResponse` |
|
|
232
|
-
| `list(signerId, accessCode
|
|
233
|
-
| `
|
|
236
|
+
| `list(signerId, accessCode, params?)` | [`GET /signers/{signerId}/documents`](./api-reference.md#list-signers-documents) | `IDocumentListResponse` |
|
|
237
|
+
| `listAsOwner(signerId, params?)` | [`GET /signers/{signerId}/documents`](./api-reference.md#list-signers-documents) with owner credentials | `IDocumentListResponse` |
|
|
238
|
+
| `search(signerId, search, accessCode)` | [`GET /signers/{signerId}/documents/search`](./api-reference.md#search-signers-documents) | `IDocumentListResponse` |
|
|
239
|
+
| `searchAsOwner(signerId, search)` | [`GET /signers/{signerId}/documents/search`](./api-reference.md#search-signers-documents) with owner credentials | `IDocumentListResponse` |
|
|
234
240
|
| `download(signerId, documentId, artifact, accessCode?)` | [`GET /signers/{signerId}/documents/{documentId}/download/{artifact}`](./api-reference.md#download-signers-document-artifact) | `Buffer` |
|
|
235
241
|
| `signMultiple(documentIds, accessCode)` | [`PUT /signers/documents/sign-multiple`](./api-reference.md#sign-multiple-documents) | `unknown[]` |
|
|
236
242
|
| `declineMultiple(documentIds, reason, accessCode)` | [`PUT /signers/documents/decline-multiple`](./api-reference.md#decline-multiple-documents) | `unknown[]` |
|
|
@@ -238,6 +244,8 @@ These methods use the private `signer-access-code`, not the workspace API key, e
|
|
|
238
244
|
| `acceptTerms(accessCode)` | [`PUT /signers/accept-terms`](./api-reference.md#accept-terms-signer) | `ISignerTermsAcceptance \| IStatusResponse` |
|
|
239
245
|
| `verifyCode(payload: IVerifySignerCodePayload)` | [`POST /verify`](./api-reference.md#verify-signer-code-otp); email or WhatsApp OTP | `IEmptyResult \| IStatusResponse` |
|
|
240
246
|
| `verifyEmail(payload: IVerifySignerCodePayload)` | Compatibility alias for `verifyCode` | `IEmptyResult \| IStatusResponse` |
|
|
247
|
+
| `getIdentityVerification(accessCode)` | [`GET /signers/identity-verification`](./api-reference.md#identity-document-verification-status) | `IIdentityVerificationState` |
|
|
248
|
+
| `startIdentityVerification(accessCode, payload)` | [`POST /signers/identity-verification`](./api-reference.md#start-identity-document-verification) | `IIdentityVerificationSession`; payload is `{ consent: true }` |
|
|
241
249
|
| `startCertificate(accessCode)` | [`POST /signers/certificate/start`](#icp-brasil-a1a3-certificates) | `ICertificateStartResponse` (`{ token: string }`) |
|
|
242
250
|
| `completeCertificate(accessCode, token)` | [`POST /signers/certificate/complete`](#icp-brasil-a1a3-certificates) | `ICertificateCompleteResponse` (`{ signerName: string }`) |
|
|
243
251
|
| `confirmData(documentId, accessCode, payload)` | [`PUT /documents/{documentId}/signers/confirm-data`](./api-reference.md#confirm-signer-data) | `ISigner \| IEmptyResult` |
|
|
@@ -273,6 +281,7 @@ Assignment and template signer descriptors use the same combinations:
|
|
|
273
281
|
| `Email` | `["Email"]` | Email address |
|
|
274
282
|
| `Whatsapp` | `["Whatsapp"]` | `whatsapp_phone_number` and an eligible paid workspace |
|
|
275
283
|
| `DigitalCertificate` (A1 or A3) | `["Email"]` or `["Whatsapp"]` | CPF/CNPJ in `government_id`, matching certificate, delivery contact, and the Digital Certificate workspace feature |
|
|
284
|
+
| `IdDocumentFaceMatchBasic` | `["Email"]` or `["Whatsapp"]` | Valid CPF in `government_id`, delivery contact, the ID Document + Face Match feature, and explicit biometric consent |
|
|
276
285
|
|
|
277
286
|
Choose one notification channel. With neither field specified, the API defaults to Email; with only one specified, it infers the other. Estimate cost before creating assignments, including those created from templates: WhatsApp notifications and certificate signatures consume credits. Each certificate signer must be alone in its signing step.
|
|
278
287
|
|
|
@@ -291,6 +300,69 @@ await client.signerDocuments.verifyCode({
|
|
|
291
300
|
|
|
292
301
|
The token request body is `{ "channel": "email", "recipient": "signer@example.com" }` and the response data is `{ "document": { "resource": "document", "id": "example_document", "name": "Contract.pdf", "page_count": 3, "created_by": "Example User" }, "channel": "email", "recipient": "signer@example.com" }`. WhatsApp-verified signers receive their code in the WhatsApp invitation itself. Verification sends `{ "verification-code": "012345" }` with `?signer-access-code=example_access_code`; a successful envelope `{ "status": 200, "message": "", "data": [] }` resolves to `[]`. Invalid codes surface as `ApiError` with the server's status and message. `verifyEmail` remains a compatible alias. Continue with data confirmation and virtual/collect signing as described above.
|
|
293
302
|
|
|
303
|
+
### Biometric identity verification
|
|
304
|
+
|
|
305
|
+
Use `IdDocumentFaceMatchBasic` for government-ID photos, a photo of the signer holding the ID, and liveness. Create or explicitly update the signer with a valid CPF in `government_id`, estimate cost, and create the assignment with either notification channel. Assignment, template, estimate, and `uploadAndRequestSignatures` signer descriptors accept this method. The provider collects biometric data on its hosted page; these SDK endpoints do not upload biometric images.
|
|
306
|
+
|
|
307
|
+
1. Read `signerDocuments.self(accessCode)` and its `verification_method`. Present the document, terms and biometric consent to the signer.
|
|
308
|
+
2. Read `getIdentityVerification(accessCode)`. Start only when `can_start` is true and the signer consents, using `startIdentityVerification(accessCode, { consent: true })`.
|
|
309
|
+
3. Open the returned `url` exactly as received, including any `#t=` fragment. It is a private bearer link: never log it or persist it in browser storage. Read status again after capture.
|
|
310
|
+
4. `Pending` retains the existing capture link. Only `Expired` permits another session; `Declined` and `Abandoned` require a new document and assignment. Resending an invitation does not replace a live session; restarts do not charge a second per-signer fee.
|
|
311
|
+
5. `Approved` and `InReview` let the signer continue to data confirmation and virtual/collect signing. `InReview` holds certification, not signing; when everyone has signed, the document remains `pending_identity_review` until the account decides.
|
|
312
|
+
6. The account reads `assignments.getIdentityVerification(documentId, assignmentId, signerId)`. While `InReview`, `downloadIdentityVerificationImage(..., name)` accepts `document_front`, `document_back`, `document_pdf` or `face` from the review's `images`. It returns JPEG/PNG/PDF bytes; images return 404 after the review closes. Protect downloaded evidence under your retention policy.
|
|
313
|
+
7. Submit `reviewIdentityVerification(..., { decision: 'Approved' | 'Rejected', note?: string | null })`. Notes allow at most 2,000 Unicode characters, are recorded and sent to the provider, and stay hidden from the signer. Approval allows certification after all signatures and reviews complete. Rejection cancels the document as `rejected_by_user` and notifies signers and copy receivers. Writes are never retried automatically.
|
|
314
|
+
|
|
315
|
+
Signer requests and complete unwrapped responses:
|
|
316
|
+
|
|
317
|
+
```http
|
|
318
|
+
GET /v1/signers/identity-verification?signer-access-code=example_access_code
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
```json
|
|
322
|
+
{ "can_start": true, "status": null, "url": null, "expires_at": null, "completed_at": null }
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
```http
|
|
326
|
+
POST /v1/signers/identity-verification?signer-access-code=example_access_code
|
|
327
|
+
Content-Type: application/json
|
|
328
|
+
|
|
329
|
+
{ "consent": true }
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
```json
|
|
333
|
+
{ "id": "example_verification", "url": "https://example.com/capture#t=example_secret", "expires_at": null }
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
`status` is `Pending`, `InReview`, `Approved`, `Declined`, `Expired`, `Abandoned` or `null`. `url` is the existing capture URL only while Pending, otherwise null; `expires_at` and `completed_at` are nullable timestamps. Missing consent, a live session, invalid access codes, or unavailable features surface through the shared `ValidationError`/`ApiError` contract. Both signer methods strip owner headers.
|
|
337
|
+
|
|
338
|
+
Account GET/review responses resolve to this complete `ISignerIdentityReview` shape (all sensitive values below are synthetic):
|
|
339
|
+
|
|
340
|
+
```json
|
|
341
|
+
{
|
|
342
|
+
"id": "example_verification",
|
|
343
|
+
"status": "InReview",
|
|
344
|
+
"provider": "AssinafyVerify",
|
|
345
|
+
"verification_method": "IdDocumentFaceMatchBasic",
|
|
346
|
+
"reason_codes": [{ "code": "NAME_MISMATCH", "description": "Name differs" }],
|
|
347
|
+
"evidence_available": true,
|
|
348
|
+
"expected": { "name": "Example Signer", "cpf": "00000000000" },
|
|
349
|
+
"document": { "type": "CNH", "name": "Example Name", "cpf": "00000000000" },
|
|
350
|
+
"matches": { "cpf": true, "name": 0.52, "birth_date": null },
|
|
351
|
+
"checks": [{ "name": "name", "result": "review", "score": 0.52, "reasons": ["NAME_MISMATCH"] }],
|
|
352
|
+
"images": ["document_front", "document_back", "face"],
|
|
353
|
+
"ruleset_version": "example-rules",
|
|
354
|
+
"evidence_sha256": null,
|
|
355
|
+
"reviewed_by": null,
|
|
356
|
+
"reviewed_at": null,
|
|
357
|
+
"review_note": null,
|
|
358
|
+
"completed_at": null
|
|
359
|
+
}
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
`expected`, `document`, `matches`, `reviewed_by`, timestamps, ruleset and evidence hash can be null. `reviewed_by` becomes `{ id, name }` after a review. Unknown provider reason codes retain their descriptions. `evidence_available: false` means the provider has no summary or it has not been fetched; direct approvals expose evidence on the `signer_identity_verified` activity instead. The [published review operation](./api-reference.md#decide-signer-identity-review) gives full HTTP envelopes and error responses.
|
|
363
|
+
|
|
364
|
+
CLI: `signer identity-status`, `signer identity-start --consent`, `assignments identity-verification <documentId> <assignmentId> <signerId>`, `assignments identity-image … --name face --output evidence.bin`, and `assignments review-identity … --decision Approved|Rejected [--note ...]`. Review decisions require confirmation or `--yes`; evidence downloads require an explicit output path and `--force` to overwrite.
|
|
365
|
+
|
|
294
366
|
### ICP-Brasil A1/A3 certificates
|
|
295
367
|
|
|
296
368
|
Both A1 and A3 use `verification_method: "DigitalCertificate"`; they are not separate API method names. Assinafy's [signing documentation](https://api.assinafy.com.br/v1/docs) directs these signers to the certificate handshake. The two routes below follow the deployed [Assinafy signing application](https://app.assinafy.com.br), which supplies their request and response shapes; they are not yet OpenAPI paths and availability on other deployments may differ.
|
|
@@ -526,11 +598,12 @@ An account can register 1 webhook endpoint, or up to 3 on paid plans. Each endpo
|
|
|
526
598
|
|
|
527
599
|
| SDK method | HTTP operation | Resolves to |
|
|
528
600
|
| --- | --- | --- |
|
|
529
|
-
| `listEndpoints(accountId?)` | [`GET /accounts/{accountId}/webhooks/endpoints`](./api-reference.md#list-webhook-endpoints) | `IWebhookEndpoint[]`, oldest first |
|
|
530
|
-
| `createEndpoint(payload, accountId?)` | [`POST /accounts/{accountId}/webhooks/endpoints`](./api-reference.md#create-webhook-endpoint) | `IWebhookEndpointCreatePayload` → `
|
|
601
|
+
| `listEndpoints(accountId?, params?)` | [`GET /accounts/{accountId}/webhooks/endpoints`](./api-reference.md#list-webhook-endpoints), with optional `{ url: string }` exact-match filter | `IWebhookEndpoint[]`, oldest first |
|
|
602
|
+
| `createEndpoint(payload, accountId?)` | [`POST /accounts/{accountId}/webhooks/endpoints`](./api-reference.md#create-webhook-endpoint) | `IWebhookEndpointCreatePayload` → `IWebhookEndpointCreateResponse` (endpoint plus optional `secret`) |
|
|
531
603
|
| `getEndpoint(endpointId, accountId?)` | [`GET /accounts/{accountId}/webhooks/endpoints/{endpointId}`](./api-reference.md#get-webhook-endpoint) | `IWebhookEndpoint` |
|
|
532
604
|
| `updateEndpoint(endpointId, payload, accountId?)` | [`PUT /accounts/{accountId}/webhooks/endpoints/{endpointId}`](./api-reference.md#update-webhook-endpoint) | `IWebhookEndpointUpdatePayload` → `IWebhookEndpoint` |
|
|
533
605
|
| `deleteEndpoint(endpointId, accountId?)` | [`DELETE /accounts/{accountId}/webhooks/endpoints/{endpointId}`](./api-reference.md#delete-webhook-endpoint) | `IEmptyResult` (`[]`) |
|
|
606
|
+
| `deleteEndpointByUrl(url, accountId?)` | [`DELETE /accounts/{accountId}/webhooks/endpoints?url=…`](./api-reference.md#delete-webhook-endpoint-by-url) | `IEmptyResult` (`[]`); exact registered URL required |
|
|
534
607
|
| `getEndpointSecret(endpointId, accountId?)` | [`GET /accounts/{accountId}/webhooks/endpoints/{endpointId}/secret`](./api-reference.md#get-webhook-endpoint-signing-secret) | `IWebhookEndpointSecret` (`{ secret }`) |
|
|
535
608
|
| `rotateEndpointSecret(endpointId, accountId?)` | [`POST /accounts/{accountId}/webhooks/endpoints/{endpointId}/secret/rotate`](./api-reference.md#rotate-webhook-endpoint-signing-secret) | `IWebhookEndpointSecret` |
|
|
536
609
|
| `register(payload, accountId?)` | [`PUT /accounts/{accountId}/webhooks/subscriptions`](./api-reference.md#update-webhook-subscription) | `IWebhookSubscription` (oldest endpoint) |
|
|
@@ -550,10 +623,12 @@ const endpoint = await client.webhooks.createEndpoint({
|
|
|
550
623
|
events: ['document_ready', 'signer_signed_document'],
|
|
551
624
|
signing_enabled: true,
|
|
552
625
|
});
|
|
553
|
-
const { secret } =
|
|
626
|
+
const { secret } = endpoint;
|
|
554
627
|
// Store `secret` in your receiver's secret manager.
|
|
555
628
|
```
|
|
556
629
|
|
|
630
|
+
When signing is enabled, endpoint creation returns `secret` once, including to OAuth applications. List/get responses omit it. OAuth applications cannot read or rotate it later: if lost, delete and recreate the endpoint. The CLI prints the creation secret in human and JSON output; store that output securely. `webhooks endpoints list --url <url>` and `delete-by-url --url <url> [--yes]` match the exact registered URL, including its query string. Deletion returns 404 if no endpoint matches. Existing endpoint-ID and subscription methods remain supported.
|
|
631
|
+
|
|
557
632
|
Registration payload: `{ url: string; email: string; events?: string[]; is_active?: boolean }`. When `events` is omitted on `register` or `createEndpoint`, the SDK uses `document_ready`, `document_prepared`, `signer_signed_document`, `signer_rejected_document`, and `document_processing_failed`; pass `[]` deliberately for none. Dispatch filters extend pagination with `{ endpoint_id?, event?, delivered?, from?, to?, sort?: 'created_at' | '-created_at' }`; sort is a compatibility extension. Dispatch records include `endpoint_id`. Dispatch `search` is unsupported and rejected locally. Retrying re-sends only to that entry's endpoint and requires the endpoint to be active. There is no delete-subscription operation; delete a specific endpoint with `deleteEndpoint` or deactivate the oldest with `inactivate`.
|
|
558
633
|
|
|
559
634
|
Decline operations require a non-empty reason of at most 2,000 Unicode characters. `signers.findByEmail` follows pagination metadata until an exact case-insensitive email match is found or the search is exhausted; when a response carries no pagination metadata a partial page ends the search, and the scan is bounded at 100 pages.
|
|
@@ -611,7 +686,7 @@ Verify the raw bytes before parsing; re-serialized JSON does not match. The enve
|
|
|
611
686
|
|
|
612
687
|
## Contract boundaries
|
|
613
688
|
|
|
614
|
-
- Production OpenAPI currently publishes
|
|
615
|
-
- Certificate start/complete are deployed production extensions, exposed by `startCertificate` and `completeCertificate` with the signing application's payloads. They supplement the
|
|
689
|
+
- Production OpenAPI currently publishes 112 operations. Some sandbox deployments lag it; account/user statistics and user notification-preference routes may return route-level 404s even though production documentation includes them.
|
|
690
|
+
- Certificate start/complete are deployed production extensions, exposed by `startCertificate` and `completeCertificate` with the signing application's payloads. They supplement the 112 OpenAPI operations; the API manifest contains only published paths.
|
|
616
691
|
- The SDK retains the two template compatibility routes above. Both `sendToken` call forms send the email-only production body.
|
|
617
692
|
- Signer artifact downloads are public in the published contract. Supplying a signer access code opts into an SDK identity preflight; it does not change the server route into a private endpoint.
|
package/docs/signer.md
CHANGED
|
@@ -16,6 +16,8 @@ Commands:
|
|
|
16
16
|
search [options] <signerId> <query> Search the signer's documents
|
|
17
17
|
download [options] <signerId> <documentId> <artifact> Download a signer document artifact
|
|
18
18
|
self [options] Fetch the signer's own profile
|
|
19
|
+
identity-status [options] Fetch biometric verification status and the private capture URL
|
|
20
|
+
identity-start [options] Open a biometric verification session with the signer’s explicit consent
|
|
19
21
|
accept-terms [options] Accept the platform terms as the signer
|
|
20
22
|
verify-code|verify-email [options] Verify an email or WhatsApp OTP for a signer
|
|
21
23
|
certificate-start [options] Start an ICP-Brasil A1/A3 signature and return the Web PKI token
|
|
@@ -116,6 +118,31 @@ Options:
|
|
|
116
118
|
-h, --help display help for command
|
|
117
119
|
```
|
|
118
120
|
|
|
121
|
+
### `assinafy signer identity-status`
|
|
122
|
+
|
|
123
|
+
```text
|
|
124
|
+
Usage: assinafy signer identity-status [options]
|
|
125
|
+
|
|
126
|
+
Fetch biometric verification status and the private capture URL
|
|
127
|
+
|
|
128
|
+
Options:
|
|
129
|
+
--access-code <code> Signer access code (env: ASSINAFY_SIGNER_ACCESS_CODE)
|
|
130
|
+
-h, --help display help for command
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### `assinafy signer identity-start`
|
|
134
|
+
|
|
135
|
+
```text
|
|
136
|
+
Usage: assinafy signer identity-start [options]
|
|
137
|
+
|
|
138
|
+
Open a biometric verification session with the signer’s explicit consent
|
|
139
|
+
|
|
140
|
+
Options:
|
|
141
|
+
--access-code <code> Signer access code (env: ASSINAFY_SIGNER_ACCESS_CODE)
|
|
142
|
+
--consent The signer explicitly consents to biometric processing
|
|
143
|
+
-h, --help display help for command
|
|
144
|
+
```
|
|
145
|
+
|
|
119
146
|
### `assinafy signer accept-terms`
|
|
120
147
|
|
|
121
148
|
```text
|
package/docs/signers.md
CHANGED
|
@@ -29,12 +29,13 @@ Usage: assinafy signers create [options]
|
|
|
29
29
|
Create a signer (reuses an existing one with the same email)
|
|
30
30
|
|
|
31
31
|
Options:
|
|
32
|
-
--name <name>
|
|
33
|
-
--email <email>
|
|
34
|
-
--phone <number>
|
|
35
|
-
--cpf <cpf>
|
|
36
|
-
--
|
|
37
|
-
|
|
32
|
+
--name <name> Signer full name
|
|
33
|
+
--email <email> Email address
|
|
34
|
+
--phone <number> WhatsApp phone number (E.164)
|
|
35
|
+
--cpf <cpf> Brazilian tax ID (CPF); non-digits are stripped
|
|
36
|
+
--government-id <id> CPF or numeric/alphanumeric CNPJ
|
|
37
|
+
--metadata <json> JSON object of metadata
|
|
38
|
+
-h, --help display help for command
|
|
38
39
|
```
|
|
39
40
|
|
|
40
41
|
### `assinafy signers list`
|
|
@@ -74,14 +75,15 @@ Usage: assinafy signers update [options] <id>
|
|
|
74
75
|
Update a signer
|
|
75
76
|
|
|
76
77
|
Arguments:
|
|
77
|
-
id
|
|
78
|
+
id Signer ID
|
|
78
79
|
|
|
79
80
|
Options:
|
|
80
|
-
--name <name>
|
|
81
|
-
--email <email>
|
|
82
|
-
--phone <number>
|
|
83
|
-
--cpf <cpf>
|
|
84
|
-
-
|
|
81
|
+
--name <name> Signer full name
|
|
82
|
+
--email <email> Email address
|
|
83
|
+
--phone <number> WhatsApp phone number (E.164)
|
|
84
|
+
--cpf <cpf> Brazilian tax ID (CPF/CNPJ), sent as government_id
|
|
85
|
+
--government-id <id> CPF or numeric/alphanumeric CNPJ
|
|
86
|
+
-h, --help display help for command
|
|
85
87
|
```
|
|
86
88
|
|
|
87
89
|
### `assinafy signers delete`
|
package/docs/webhooks.md
CHANGED
|
@@ -38,7 +38,7 @@ Options:
|
|
|
38
38
|
-h, --help display help for command
|
|
39
39
|
|
|
40
40
|
Commands:
|
|
41
|
-
list|ls
|
|
41
|
+
list|ls [options] List webhook endpoints, oldest first
|
|
42
42
|
create [options] Register a webhook endpoint (1 per
|
|
43
43
|
account, up to 3 on paid plans)
|
|
44
44
|
get <endpointId> Show one webhook endpoint
|
|
@@ -46,6 +46,8 @@ Commands:
|
|
|
46
46
|
endpoint
|
|
47
47
|
delete|rm [options] <endpointId> Delete a webhook endpoint and free its
|
|
48
48
|
slot
|
|
49
|
+
delete-by-url [options] Delete the webhook endpoint with exactly
|
|
50
|
+
this registered URL
|
|
49
51
|
secret <endpointId> Print the endpoint signing secret
|
|
50
52
|
(signing must be enabled; not available
|
|
51
53
|
via OAuth)
|
|
@@ -62,7 +64,8 @@ Usage: assinafy webhooks endpoints list|ls [options]
|
|
|
62
64
|
List webhook endpoints, oldest first
|
|
63
65
|
|
|
64
66
|
Options:
|
|
65
|
-
|
|
67
|
+
--url <url> Only the endpoint registered with exactly this URL
|
|
68
|
+
-h, --help display help for command
|
|
66
69
|
```
|
|
67
70
|
|
|
68
71
|
#### `assinafy webhooks endpoints create`
|
|
@@ -135,6 +138,19 @@ Options:
|
|
|
135
138
|
-h, --help display help for command
|
|
136
139
|
```
|
|
137
140
|
|
|
141
|
+
#### `assinafy webhooks endpoints delete-by-url`
|
|
142
|
+
|
|
143
|
+
```text
|
|
144
|
+
Usage: assinafy webhooks endpoints delete-by-url [options]
|
|
145
|
+
|
|
146
|
+
Delete the webhook endpoint with exactly this registered URL
|
|
147
|
+
|
|
148
|
+
Options:
|
|
149
|
+
--url <url> Registered endpoint URL
|
|
150
|
+
-y, --yes Skip the confirmation prompt
|
|
151
|
+
-h, --help display help for command
|
|
152
|
+
```
|
|
153
|
+
|
|
138
154
|
#### `assinafy webhooks endpoints secret`
|
|
139
155
|
|
|
140
156
|
```text
|