@assinafy/cli 2.5.3 → 2.6.1
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 +121 -20
- package/dist/api.cjs.map +1 -1
- package/dist/api.js +121 -20
- package/dist/api.js.map +1 -1
- package/dist/cli.cjs +601 -407
- 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 +1 -0
- package/dist/types/api/resources/documents.d.ts.map +1 -1
- package/dist/types/api/resources/signer-documents.d.ts +8 -4
- 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 +5 -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 +473 -46
- package/docs/assignments.md +67 -9
- package/docs/sdk-reference.md +84 -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
|
}>;
|
|
@@ -151,7 +152,7 @@ interface IDocumentUploadOptions {
|
|
|
151
152
|
|
|
152
153
|
Uploads must be non-empty PDFs up to 25 MiB. `DocumentArtifactName` is `original | certificated | certificate-page | pades | bundle`; `bundle` is ZIP and the other document artifacts are PDF. `sendToken(documentId, 'signer@example.com')` emails a one-time access token to a signer who has not signed a pending document yet and sends `{ "channel": "email", "recipient": "signer@example.com" }`. Only the `email` channel is accepted; any other channel is rejected locally. The `{ email }` overload sends the same body.
|
|
153
154
|
|
|
154
|
-
Template document creation sends `{ signers, name?, message?, expires_at?, editor_fields?, tags? }`. Each signer is `{ role_id, id, verification_method?, notification_methods?, step? }`; each editor field is `{ field_id, value: string }`. Template cost estimation publishes `{ signers: Array<{ role_id, verification_method?, notification_methods? }> }`. The optional cost-signer `id` and `step` properties remain compatibility extensions for existing integrations.
|
|
155
|
+
Template document creation sends `{ signers, name?, message?, expires_at?, editor_fields?, tags? }`. Each signer is `{ role_id, id, verification_method?, notification_methods?, step? }`; each editor field is `{ field_id, value: string }`. Template cost estimation publishes `{ signers: Array<{ role_id, verification_method?, notification_methods? }> }`. The optional cost-signer `id` and `step` properties remain compatibility extensions for existing integrations. A template with placed signer fields creates a `collect` assignment, so it cannot use a `DigitalCertificate` signer. For certificate-bearing template create and estimate calls, the SDK reads the template details first and rejects placed fields with `ValidationError.errors.code` set to `digital_certificate_requires_virtual`.
|
|
155
156
|
|
|
156
157
|
Document list params are `{ page?, per_page?, status?, method?, tags?, search?, sort? }`; search params omit `method`/`tags`. Supported sort values are `name`, `-name`, `updated_at`, and `-updated_at`.
|
|
157
158
|
|
|
@@ -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
|
}>;
|
|
@@ -194,7 +198,7 @@ Assignment payload:
|
|
|
194
198
|
|
|
195
199
|
Production defaults `notification_methods: []` to `['Email']` and sends an invitation. An empty array is not a way to disable delivery. Choose the intended supported channel explicitly before creating an assignment.
|
|
196
200
|
|
|
197
|
-
`buildAssignmentPayload(payload, options?)` is exported for callers that need the same normalization. It resolves synchronously to the JSON assignment body above; no HTTP call occurs. Options are `{ allowSignersWithoutId?: boolean; skipDigitalCertificateStepValidation?: boolean }`, both false by default. Both support cost estimation: the first accepts signer descriptors without an `id`, and the second bypasses signing-order and certificate-step checks for estimates. An empty signer list always throws `ValidationError('At least one signer is required')`, in `virtual` and `collect` modes and in cost estimates alike. `create` enforces complete contiguous signing steps from 1 when supplied and requires each digital-certificate signer to be alone in its step. The estimate schema has no `step`, so `estimateCost` passes `skipDigitalCertificateStepValidation` to skip that create-only rule. Assignment list params are pagination plus the compatible `sort?: 'created_at' | '-created_at'`; the runtime endpoint requires the SDK's `accountId` query even though the published parameter table omits it. Assignment `search` is unsupported and rejected locally.
|
|
201
|
+
`buildAssignmentPayload(payload, options?)` is exported for callers that need the same normalization. It resolves synchronously to the JSON assignment body above; no HTTP call occurs. Options are `{ allowSignersWithoutId?: boolean; skipDigitalCertificateStepValidation?: boolean }`, both false by default. Both support cost estimation: the first accepts signer descriptors without an `id`, and the second bypasses signing-order and certificate-step checks for estimates. An empty signer list always throws `ValidationError('At least one signer is required')`, in `virtual` and `collect` modes and in cost estimates alike. `DigitalCertificate` signers require `method: 'virtual'`: `create` and `estimateCost` reject `collect` before sending a request with `ValidationError.errors.code` set to `digital_certificate_requires_virtual`. `create` also enforces complete contiguous signing steps from 1 when supplied and requires each digital-certificate signer to be alone in its step. The estimate schema has no `step`, so `estimateCost` passes `skipDigitalCertificateStepValidation` to skip that create-only rule. Assignment list params are pagination plus the compatible `sort?: 'created_at' | '-created_at'`; the runtime endpoint requires the SDK's `accountId` query even though the published parameter table omits it. Assignment `search` is unsupported and rejected locally.
|
|
198
202
|
|
|
199
203
|
`estimateResendCost(documentId, assignmentId, signerId)` sends a POST without a body. Its production result is:
|
|
200
204
|
|
|
@@ -220,7 +224,7 @@ 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
|
|
|
@@ -240,6 +244,8 @@ These methods use the private `signer-access-code`, not the workspace API key, e
|
|
|
240
244
|
| `acceptTerms(accessCode)` | [`PUT /signers/accept-terms`](./api-reference.md#accept-terms-signer) | `ISignerTermsAcceptance \| IStatusResponse` |
|
|
241
245
|
| `verifyCode(payload: IVerifySignerCodePayload)` | [`POST /verify`](./api-reference.md#verify-signer-code-otp); email or WhatsApp OTP | `IEmptyResult \| IStatusResponse` |
|
|
242
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 }` |
|
|
243
249
|
| `startCertificate(accessCode)` | [`POST /signers/certificate/start`](#icp-brasil-a1a3-certificates) | `ICertificateStartResponse` (`{ token: string }`) |
|
|
244
250
|
| `completeCertificate(accessCode, token)` | [`POST /signers/certificate/complete`](#icp-brasil-a1a3-certificates) | `ICertificateCompleteResponse` (`{ signerName: string }`) |
|
|
245
251
|
| `confirmData(documentId, accessCode, payload)` | [`PUT /documents/{documentId}/signers/confirm-data`](./api-reference.md#confirm-signer-data) | `ISigner \| IEmptyResult` |
|
|
@@ -275,6 +281,7 @@ Assignment and template signer descriptors use the same combinations:
|
|
|
275
281
|
| `Email` | `["Email"]` | Email address |
|
|
276
282
|
| `Whatsapp` | `["Whatsapp"]` | `whatsapp_phone_number` and an eligible paid workspace |
|
|
277
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 |
|
|
278
285
|
|
|
279
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.
|
|
280
287
|
|
|
@@ -293,11 +300,74 @@ await client.signerDocuments.verifyCode({
|
|
|
293
300
|
|
|
294
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.
|
|
295
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
|
+
|
|
296
366
|
### ICP-Brasil A1/A3 certificates
|
|
297
367
|
|
|
298
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.
|
|
299
369
|
|
|
300
|
-
1. Create or select the signer and set their CPF/CNPJ with `signers.update(signerId, { government_id })`. An existing signer returned by `create` is reused without updating their data. Configure an eligible workspace, estimate cost, then create
|
|
370
|
+
1. Create or select the signer and set their CPF/CNPJ with `signers.update(signerId, { government_id })`. An existing signer returned by `create` is reused without updating their data. Configure an eligible workspace, estimate cost, then create a `virtual` assignment with `DigitalCertificate` and one delivery channel. Use contiguous steps beginning at `1`, with each certificate signer alone in their step. The same descriptor works for template roles only when the template has no placed signer fields.
|
|
301
371
|
2. Obtain the private signer access code through the delivered link. Load `self` and `getAssignment` to confirm the identity and document. Present the document and terms; call `acceptTerms` only after the signer agrees.
|
|
302
372
|
3. Call `startCertificate(accessCode)` and retain its operation token with that signer session.
|
|
303
373
|
4. On the signer's device, use an initialized Web PKI browser client to select their A1 certificate or A3 device and execute `pki.signWithRestPki({ thumbprint, token })`. Wait for its success callback. The private key, PFX password, and device PIN stay with the local certificate provider.
|
|
@@ -528,11 +598,12 @@ An account can register 1 webhook endpoint, or up to 3 on paid plans. Each endpo
|
|
|
528
598
|
|
|
529
599
|
| SDK method | HTTP operation | Resolves to |
|
|
530
600
|
| --- | --- | --- |
|
|
531
|
-
| `listEndpoints(accountId?)` | [`GET /accounts/{accountId}/webhooks/endpoints`](./api-reference.md#list-webhook-endpoints) | `IWebhookEndpoint[]`, oldest first |
|
|
532
|
-
| `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`) |
|
|
533
603
|
| `getEndpoint(endpointId, accountId?)` | [`GET /accounts/{accountId}/webhooks/endpoints/{endpointId}`](./api-reference.md#get-webhook-endpoint) | `IWebhookEndpoint` |
|
|
534
604
|
| `updateEndpoint(endpointId, payload, accountId?)` | [`PUT /accounts/{accountId}/webhooks/endpoints/{endpointId}`](./api-reference.md#update-webhook-endpoint) | `IWebhookEndpointUpdatePayload` → `IWebhookEndpoint` |
|
|
535
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 |
|
|
536
607
|
| `getEndpointSecret(endpointId, accountId?)` | [`GET /accounts/{accountId}/webhooks/endpoints/{endpointId}/secret`](./api-reference.md#get-webhook-endpoint-signing-secret) | `IWebhookEndpointSecret` (`{ secret }`) |
|
|
537
608
|
| `rotateEndpointSecret(endpointId, accountId?)` | [`POST /accounts/{accountId}/webhooks/endpoints/{endpointId}/secret/rotate`](./api-reference.md#rotate-webhook-endpoint-signing-secret) | `IWebhookEndpointSecret` |
|
|
538
609
|
| `register(payload, accountId?)` | [`PUT /accounts/{accountId}/webhooks/subscriptions`](./api-reference.md#update-webhook-subscription) | `IWebhookSubscription` (oldest endpoint) |
|
|
@@ -552,10 +623,12 @@ const endpoint = await client.webhooks.createEndpoint({
|
|
|
552
623
|
events: ['document_ready', 'signer_signed_document'],
|
|
553
624
|
signing_enabled: true,
|
|
554
625
|
});
|
|
555
|
-
const { secret } =
|
|
626
|
+
const { secret } = endpoint;
|
|
556
627
|
// Store `secret` in your receiver's secret manager.
|
|
557
628
|
```
|
|
558
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
|
+
|
|
559
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`.
|
|
560
633
|
|
|
561
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.
|
|
@@ -613,7 +686,7 @@ Verify the raw bytes before parsing; re-serialized JSON does not match. The enve
|
|
|
613
686
|
|
|
614
687
|
## Contract boundaries
|
|
615
688
|
|
|
616
|
-
- Production OpenAPI currently publishes
|
|
617
|
-
- 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.
|
|
618
691
|
- The SDK retains the two template compatibility routes above. Both `sendToken` call forms send the email-only production body.
|
|
619
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
|