signedly 0.1.2__tar.gz → 0.1.3__tar.gz
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.
- signedly-0.1.3/PKG-INFO +18 -0
- {signedly-0.1.2 → signedly-0.1.3}/README.md +185 -28
- {signedly-0.1.2 → signedly-0.1.3}/pyproject.toml +7 -7
- signedly-0.1.3/setup.py +51 -0
- signedly-0.1.3/signedly/__init__.py +95 -0
- {signedly-0.1.2 → signedly-0.1.3}/signedly/api/api_request_logs_api.py +54 -20
- {signedly-0.1.2 → signedly-0.1.3}/signedly/api/authentication_api.py +4 -4
- {signedly-0.1.2 → signedly-0.1.3}/signedly/api/bulk_sending_api.py +1 -1
- {signedly-0.1.2 → signedly-0.1.3}/signedly/api/documents_api.py +49 -55
- {signedly-0.1.2 → signedly-0.1.3}/signedly/api/downloads_api.py +22 -7
- {signedly-0.1.2 → signedly-0.1.3}/signedly/api/fields_api.py +16 -16
- {signedly-0.1.2 → signedly-0.1.3}/signedly/api/sending_api.py +10 -10
- {signedly-0.1.2 → signedly-0.1.3}/signedly/api/signatories_api.py +7 -7
- {signedly-0.1.2 → signedly-0.1.3}/signedly/api/templates_api.py +19 -22
- {signedly-0.1.2 → signedly-0.1.3}/signedly/api/webhooks_api.py +17 -16
- {signedly-0.1.2 → signedly-0.1.3}/signedly/api_client.py +2 -2
- signedly-0.1.3/signedly/configuration.py +596 -0
- signedly-0.1.3/signedly/exceptions.py +200 -0
- {signedly-0.1.2 → signedly-0.1.3}/signedly/helpers.py +27 -9
- signedly-0.1.3/signedly/models/__init__.py +69 -0
- signedly-0.1.3/signedly/models/create_bulk_send202_response.py +105 -0
- signedly-0.1.3/signedly/models/create_bulk_send_request.py +101 -0
- signedly-0.1.3/signedly/models/create_document_fields_request_inner.py +158 -0
- signedly-0.1.3/signedly/models/create_document_from_template200_response.py +101 -0
- signedly-0.1.3/signedly/models/create_document_from_template_request.py +115 -0
- signedly-0.1.3/signedly/models/create_document_from_template_request_recipients_inner.py +92 -0
- signedly-0.1.3/signedly/models/create_signatories_request.py +100 -0
- signedly-0.1.3/signedly/models/create_signatories_request_signatories_inner.py +92 -0
- signedly-0.1.3/signedly/models/create_signatory_request.py +94 -0
- signedly-0.1.3/signedly/models/create_template_fields_request_inner.py +160 -0
- signedly-0.1.3/signedly/models/create_webhook_endpoint_request.py +103 -0
- signedly-0.1.3/signedly/models/delete_document204_response.py +88 -0
- signedly-0.1.3/signedly/models/delete_field_request.py +88 -0
- signedly-0.1.3/signedly/models/document.py +158 -0
- signedly-0.1.3/signedly/models/document_page.py +112 -0
- signedly-0.1.3/signedly/models/document_status_page.py +112 -0
- signedly-0.1.3/signedly/models/document_status_row.py +90 -0
- signedly-0.1.3/signedly/models/fill_and_send_document_request.py +116 -0
- signedly-0.1.3/signedly/models/fill_and_send_document_request_elements_inner.py +96 -0
- signedly-0.1.3/signedly/models/get_access_token_request.py +90 -0
- signedly-0.1.3/signedly/models/get_audit_trail_link200_response.py +88 -0
- signedly-0.1.3/signedly/models/get_download_status200_response.py +90 -0
- signedly-0.1.3/signedly/models/list_bulk_send_columns200_response_inner.py +92 -0
- signedly-0.1.3/signedly/models/model_field.py +201 -0
- signedly-0.1.3/signedly/models/page.py +102 -0
- signedly-0.1.3/signedly/models/refresh_access_token200_response.py +99 -0
- signedly-0.1.3/signedly/models/refresh_access_token_request.py +88 -0
- signedly-0.1.3/signedly/models/request_count_page.py +112 -0
- signedly-0.1.3/signedly/models/request_hit.py +92 -0
- signedly-0.1.3/signedly/models/request_log.py +107 -0
- signedly-0.1.3/signedly/models/request_log_page.py +112 -0
- signedly-0.1.3/signedly/models/rotate_webhook_secret_request.py +88 -0
- signedly-0.1.3/signedly/models/send_document200_response.py +96 -0
- signedly-0.1.3/signedly/models/send_document200_response_existing_signatures.py +95 -0
- signedly-0.1.3/signedly/models/send_document_by_link200_response.py +98 -0
- signedly-0.1.3/signedly/models/send_document_by_link_request.py +91 -0
- signedly-0.1.3/signedly/models/send_document_request.py +102 -0
- signedly-0.1.3/signedly/models/signatory.py +118 -0
- signedly-0.1.3/signedly/models/template.py +124 -0
- signedly-0.1.3/signedly/models/template_field.py +208 -0
- signedly-0.1.3/signedly/models/template_page.py +112 -0
- signedly-0.1.3/signedly/models/update_document_field_by_body_request.py +160 -0
- signedly-0.1.3/signedly/models/update_document_field_by_body_request_items_inner.py +92 -0
- signedly-0.1.3/signedly/models/update_webhook_endpoint_request.py +105 -0
- signedly-0.1.3/signedly/models/upload.py +109 -0
- signedly-0.1.3/signedly/models/upload_document_for_one_signer200_response.py +98 -0
- signedly-0.1.3/signedly/models/upload_document_for_one_signer_request.py +96 -0
- signedly-0.1.3/signedly/models/upload_document_request.py +101 -0
- signedly-0.1.3/signedly/models/webhook_delivery.py +139 -0
- signedly-0.1.3/signedly/models/webhook_delivery_page.py +112 -0
- signedly-0.1.3/signedly/models/webhook_endpoint.py +119 -0
- signedly-0.1.3/signedly/models/webhook_endpoint_with_secret.py +123 -0
- signedly-0.1.3/signedly/rest.py +258 -0
- signedly-0.1.3/signedly.egg-info/PKG-INFO +18 -0
- {signedly-0.1.2 → signedly-0.1.3}/signedly.egg-info/SOURCES.txt +6 -0
- signedly-0.1.3/test/test_delete_document204_response.py +52 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_helpers.py +51 -0
- signedly-0.1.3/test/test_rotate_webhook_secret_request.py +52 -0
- signedly-0.1.3/test/test_send_document200_response_existing_signatures.py +55 -0
- signedly-0.1.2/PKG-INFO +0 -18
- signedly-0.1.2/setup.py +0 -51
- signedly-0.1.2/signedly/__init__.py +0 -92
- signedly-0.1.2/signedly/configuration.py +0 -596
- signedly-0.1.2/signedly/exceptions.py +0 -200
- signedly-0.1.2/signedly/models/__init__.py +0 -66
- signedly-0.1.2/signedly/models/create_bulk_send202_response.py +0 -105
- signedly-0.1.2/signedly/models/create_bulk_send_request.py +0 -101
- signedly-0.1.2/signedly/models/create_document_fields_request_inner.py +0 -156
- signedly-0.1.2/signedly/models/create_document_from_template200_response.py +0 -101
- signedly-0.1.2/signedly/models/create_document_from_template_request.py +0 -115
- signedly-0.1.2/signedly/models/create_document_from_template_request_recipients_inner.py +0 -92
- signedly-0.1.2/signedly/models/create_signatories_request.py +0 -100
- signedly-0.1.2/signedly/models/create_signatories_request_signatories_inner.py +0 -92
- signedly-0.1.2/signedly/models/create_signatory_request.py +0 -94
- signedly-0.1.2/signedly/models/create_template_fields_request_inner.py +0 -156
- signedly-0.1.2/signedly/models/create_webhook_endpoint_request.py +0 -103
- signedly-0.1.2/signedly/models/delete_field_request.py +0 -88
- signedly-0.1.2/signedly/models/document.py +0 -158
- signedly-0.1.2/signedly/models/document_page.py +0 -112
- signedly-0.1.2/signedly/models/document_status_page.py +0 -112
- signedly-0.1.2/signedly/models/document_status_row.py +0 -90
- signedly-0.1.2/signedly/models/fill_and_send_document_request.py +0 -116
- signedly-0.1.2/signedly/models/fill_and_send_document_request_elements_inner.py +0 -96
- signedly-0.1.2/signedly/models/get_access_token_request.py +0 -90
- signedly-0.1.2/signedly/models/get_audit_trail_link200_response.py +0 -88
- signedly-0.1.2/signedly/models/get_download_status200_response.py +0 -90
- signedly-0.1.2/signedly/models/list_bulk_send_columns200_response_inner.py +0 -92
- signedly-0.1.2/signedly/models/model_field.py +0 -201
- signedly-0.1.2/signedly/models/page.py +0 -102
- signedly-0.1.2/signedly/models/refresh_access_token200_response.py +0 -99
- signedly-0.1.2/signedly/models/refresh_access_token_request.py +0 -88
- signedly-0.1.2/signedly/models/request_count_page.py +0 -112
- signedly-0.1.2/signedly/models/request_hit.py +0 -92
- signedly-0.1.2/signedly/models/request_log.py +0 -107
- signedly-0.1.2/signedly/models/request_log_page.py +0 -112
- signedly-0.1.2/signedly/models/send_document200_response.py +0 -88
- signedly-0.1.2/signedly/models/send_document_by_link200_response.py +0 -90
- signedly-0.1.2/signedly/models/send_document_by_link_request.py +0 -91
- signedly-0.1.2/signedly/models/send_document_request.py +0 -102
- signedly-0.1.2/signedly/models/signatory.py +0 -118
- signedly-0.1.2/signedly/models/template.py +0 -124
- signedly-0.1.2/signedly/models/template_field.py +0 -201
- signedly-0.1.2/signedly/models/template_page.py +0 -112
- signedly-0.1.2/signedly/models/update_document_field_by_body_request.py +0 -158
- signedly-0.1.2/signedly/models/update_document_field_by_body_request_items_inner.py +0 -92
- signedly-0.1.2/signedly/models/update_webhook_endpoint_request.py +0 -105
- signedly-0.1.2/signedly/models/upload.py +0 -109
- signedly-0.1.2/signedly/models/upload_document_for_one_signer200_response.py +0 -90
- signedly-0.1.2/signedly/models/upload_document_for_one_signer_request.py +0 -96
- signedly-0.1.2/signedly/models/upload_document_request.py +0 -101
- signedly-0.1.2/signedly/models/webhook_delivery.py +0 -139
- signedly-0.1.2/signedly/models/webhook_delivery_page.py +0 -112
- signedly-0.1.2/signedly/models/webhook_endpoint.py +0 -115
- signedly-0.1.2/signedly/models/webhook_endpoint_with_secret.py +0 -119
- signedly-0.1.2/signedly/rest.py +0 -258
- signedly-0.1.2/signedly.egg-info/PKG-INFO +0 -18
- {signedly-0.1.2 → signedly-0.1.3}/LICENSE +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/setup.cfg +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/signedly/api/__init__.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/signedly/api_response.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/signedly/py.typed +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/signedly.egg-info/dependency_links.txt +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/signedly.egg-info/requires.txt +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/signedly.egg-info/top_level.txt +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_api_request_logs_api.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_authentication_api.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_bulk_sending_api.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_create_bulk_send202_response.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_create_bulk_send_request.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_create_document_fields_request_inner.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_create_document_from_template200_response.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_create_document_from_template_request.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_create_document_from_template_request_recipients_inner.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_create_signatories_request.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_create_signatories_request_signatories_inner.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_create_signatory_request.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_create_template_fields_request_inner.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_create_webhook_endpoint_request.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_delete_field_request.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_document.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_document_page.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_document_status_page.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_document_status_row.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_documents_api.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_downloads_api.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_fields_api.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_fill_and_send_document_request.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_fill_and_send_document_request_elements_inner.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_get_access_token_request.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_get_audit_trail_link200_response.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_get_download_status200_response.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_list_bulk_send_columns200_response_inner.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_model_field.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_page.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_refresh_access_token200_response.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_refresh_access_token_request.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_request_count_page.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_request_hit.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_request_log.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_request_log_page.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_send_document200_response.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_send_document_by_link200_response.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_send_document_by_link_request.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_send_document_request.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_sending_api.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_signatories_api.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_signatory.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_template.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_template_field.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_template_page.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_templates_api.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_update_document_field_by_body_request.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_update_document_field_by_body_request_items_inner.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_update_webhook_endpoint_request.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_upload.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_upload_document_for_one_signer200_response.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_upload_document_for_one_signer_request.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_upload_document_request.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_webhook_delivery.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_webhook_delivery_page.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_webhook_endpoint.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_webhook_endpoint_with_secret.py +0 -0
- {signedly-0.1.2 → signedly-0.1.3}/test/test_webhooks_api.py +0 -0
signedly-0.1.3/PKG-INFO
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: signedly
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: Signedly API
|
|
5
|
+
Home-page: https://github.com/signedly/signedly-sdks
|
|
6
|
+
Author: Signedly
|
|
7
|
+
Author-email: support@signedly.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: OpenAPI,OpenAPI-Generator,Signedly API
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: urllib3<3.0.0,>=1.25.3
|
|
13
|
+
Requires-Dist: python-dateutil>=2.8.2
|
|
14
|
+
Requires-Dist: pydantic>=2
|
|
15
|
+
Requires-Dist: typing-extensions>=4.7.1
|
|
16
|
+
|
|
17
|
+
The Signedly REST API lets your system upload documents, add signatories and fields, send them for signing and download the signed result. Every path starts with `/ap1/`, and every request and response body is JSON unless an endpoint says otherwise (the uploads are `multipart/form-data`). ## Authentication 1. In the Signedly web app, your organisation's **super admin** opens **Account & Settings → API** and generates a **client ID** and **client secret**. Only the super admin can see, regenerate or replace the keys and manage webhooks there, because a key acts for the organisation admin. 2. `POST /ap1/token/` with them. You get an `access_token` (valid **2 hours**) and a `refresh_token` (valid **7 days**). While both are still valid, calling `/ap1/token/` again returns the same pair. 3. Send the access token on every other call: `Authorization: Bearer <access_token>`. 4. When the access token expires, `POST /ap1/refreshtoken/` with the refresh token for a new access token. The refresh token stays the same and each refresh keeps it valid for 7 more days, up to 30 days after `/ap1/token/` made it. When it has expired, call `/ap1/token/` again. Your key pair has one token, shared by all your processes: after a refresh, the access token it replaced keeps working for 60 seconds (never past its own expiry), so another process using it isn't refused mid-call; switch every process to the new one. `/ap1/token/` and `/ap1/refreshtoken/` allow 60 calls a minute per IP address; more answer 429. Every other call counts against your API client, separately for the live and the test keys: **600 calls a minute** in all, of which **120 a minute** may upload or send documents (`upload/`, `upload_app/`, `document/send/`, `document/send_url/`, `document/update_and_send/`, `documents/fromtemplate/`, `bulk-sends/`; a bulk send counts once, however many rows it has). Over a limit the call answers 429 with `Retry-After` (seconds until the next minute) and `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` (Unix time); wait that long and retry. Contact support@signedly.com if your integration needs more. A missing, unknown or expired access token answers 403 (`\"Client not found\"` or `\"Access token expired\"`). The API acts for your **organisation's admin account**: documents you upload belong to it and appear in its Signedly web app, and you can reach only that account's documents, templates, signatories and fields, plus every document your API client made. When your super admin hands the organisation over, the API acts for the new super admin and still reaches what it made before. Another organisation's IDs answer 404, as if they didn't exist. ## Plans What the API allows depends on the Signedly plan of your **organisation's admin account** (Account & Settings → Account & Plan). The same rules apply to live and test keys. | What | Free | Personal Pro | Business Pro | Teams | |---|---|---|---|---| | Generate live and test keys (Account & Settings → API) | – | ✓ | ✓ | ✓ | | Every endpoint, `/ap1/token/` and `/ap1/refreshtoken/` included | – | ✓ | ✓ | ✓ | | `require_email_otp` on `POST /ap1/signatories/` and `POST /ap1/signatories/bulk/` | – | ✓ | ✓ | ✓ | | Bulk send: `GET /ap1/bulk-sends/columns/` and `POST /ap1/bulk-sends/` | – | – | – | ✓ | The API is part of the paid plans. On Free (or with no plan) every call answers 403 `\"... Your plan doesn't include API access.\"`, with live or test keys, also with a token or keys made earlier; they work again once the plan is paid. On a paid plan, a feature it doesn't include answers 400 with `\"Your plan doesn't include ...\"` and changes nothing, and `GET /ap1/bulk-sends/{id}/` still reports bulk sends already made. Live documents also need an API contract with Signedly. Without one, or with an unpaid API invoice, `POST /ap1/upload/` (except templates), `/ap1/upload_app/`, `/ap1/documents/fromtemplate/`, `/ap1/bulk-sends/` and sending a draft already uploaded (`/ap1/document/send/`, `/ap1/document/send_url/`, `/ap1/document/update_and_send/`) answer 402 with live keys. Test keys work without a contract (see Sandbox). ## API billing Live API documents are billed per document under your organisation's API contract, on top of its Signedly plan. List prices (a contract can differ; prices exclude tax): | Tier | Per document | Monthly minimum | |---|---|---| | Basic | $0.80 / ₹60 | 100 documents | | Standard | $0.50 / ₹40 | 250 documents | | Premium | $0.25 / ₹20 | 1,000 documents | - **What counts:** a live document your API client sends, once, when it's sent. `/ap1/upload_app/` documents count when they're made, because that route returns a signing link straight away. Every document of an API bulk send counts. Drafts never sent, templates, test-key documents and documents sent from the web app don't count. Sending again or archiving doesn't count twice. Months are calendar months in UTC; the API page in Account & Settings shows this month's count. - **Rejected, voided and expired documents** are still billed: a document is billed when it's sent, whatever happens to it afterwards. A send refused before it goes out (a 4xx answer) isn't billed. - **Minimum and overage:** on the 1st of each month your invoice charges that month's minimum upfront, plus last month's documents above its minimum at last month's price. Unused documents of the minimum don't roll over. The first month is charged in full, whatever day the contract starts. - **Changing or ending a contract:** new terms apply from the next invoice. When a contract ends, live documents keep working to the end of its last month; the next invoice charges only that month's overage, and live documents are then refused (402) until a contract is in place again. - **Paying:** an invoice is due 7 days after it's issued. Reminders go out 1, 7 and 13 days after the due date; 14 days after it, live documents are paused (402) until every overdue invoice is paid, and work again as soon as it is. Test keys, your data and documents already sent are never affected. - **Tax:** prices exclude tax; INR invoices show GST as its own line when it applies. - **Refunds** are handled by hand: email support@signedly.com. ## Sending a document for signing 1. `POST /ap1/upload/` a PDF or DOCX (`type` 2). The document is prepared in the background: find it in `GET /ap1/documents/?name=<name>` (its `upload.id` is the upload's `id`), and wait until `GET /ap1/documents/{id}/pages/` lists its pages. 2. `POST /ap1/signatories/` (one) or `POST /ap1/signatories/bulk/` (several) to add the people who sign. 3. `POST /ap1/documents/fields/` to place the fields each signatory fills in. 4. Send it: - `POST /ap1/document/send/` emails every signatory a signing link (with ordered signing, only the first; each next one is emailed in turn), or - `POST /ap1/document/send_url/` returns the first signatory's signing link, for you to show or send yourself, and emails them nothing; any other signatories are emailed as by `send/` (all at once, or with ordered signing each in turn after the one before signs). 5. Poll `GET /ap1/documents-status-list/` (or `GET /ap1/documents/`) until the status is 6 (Completed), then `GET /ap1/document/download-link/` for the signed PDF and `GET /ap1/document/download-audit-link/` for its audit trail. **The two document lists differ on purpose.** `GET /ap1/documents/` lists only the documents this API client made through the API. `GET /ap1/documents-status-list/` lists every document of the organisation's admin, including ones made in the web app. Use the first to see your integration's own documents, and the second for everything the admin account owns. **From a template:** upload with `type` 4 and a `template_name` (or make the template in the web app), place its fields with `POST /ap1/templates/fields/` (each on the role named by its `signatory_id`, a role's `id` from `GET /ap1/signatories/?document_id=<template ID>`; without one, on the first role), then for each signing make a document with `POST /ap1/documents/fromtemplate/`, add its signatory, and send it. **One signer, one call:** `POST /ap1/upload_app/` uploads a PDF or DOCX for one signer and returns their signing link in `redirect_url`; the signer places their own signature. After signing they go to the `redirect_url` you sent, and the signed PDF and its audit trail are emailed to `final_email` (otherwise to your organisation's admin). **A PDF that is already digitally signed** (Adobe, DocuSign, a DSC or Aadhaar eSign) is accepted, but signing it on Signedly invalidates those signatures. The upload and send answers (`upload/`, `upload_app/`, `send/`, `send_url/`, `update_and_send/`) say so: `existing_signatures` has the `count` (null when the file couldn't be checked) and the signers' `names`, and `warnings` holds the text to show your user, e.g. \"This PDF already has 1 digital signature (by Asha Rao). Signing it on Signedly will invalidate it.\" `warnings` is empty when there is nothing to warn about. Nothing is refused because of it. ## Quick start with curl Each step uses an ID from the step before. `$API` is this server, e.g. `https://l0ads.signedly.com`. ```bash # 1. Token curl -X POST $API/ap1/token/ -H 'Content-Type: application/json' \ -d '{\"client_id\": \"<client id>\", \"client_secret\": \"<client secret>\"}' TOKEN=<access_token from the answer> # 2. Upload a PDF (answers with the upload's id) curl -X POST $API/ap1/upload/ -H \"Authorization: Bearer $TOKEN\" \ -F file=@nda.pdf -F name=nda-ann-lee -F type=2 # 3. Find the document, then wait until it has pages curl \"$API/ap1/documents/?name=nda-ann-lee\" -H \"Authorization: Bearer $TOKEN\" DOC=<results[0].id> curl $API/ap1/documents/$DOC/pages/ -H \"Authorization: Bearer $TOKEN\" PAGE=<[0].id> # 4. Add the signatory curl -X POST $API/ap1/signatories/ -H \"Authorization: Bearer $TOKEN\" \ -H 'Content-Type: application/json' \ -d '{\"document_id\": \"'$DOC'\", \"name\": \"Ann Lee\", \"email\": \"ann@example.com\"}' SIGNER=<id from the answer> # 5. Place her signature: 150 × 40 points, 72 points from the left, 640 from the top curl -X POST $API/ap1/documents/fields/ -H \"Authorization: Bearer $TOKEN\" \ -H 'Content-Type: application/json' \ -d '[{\"document_id\": \"'$DOC'\", \"signatory_id\": \"'$SIGNER'\", \"kind\": 2, \"label\": \"Signature\", \"placeholder\": \"Sign here\", \"page\": \"'$PAGE'\", \"page_number\": 0, \"x\": 72, \"y\": 640, \"width\": 150, \"height\": 40}]' # 6. Send it (Ann gets the signing email) curl -X POST $API/ap1/document/send/ -H \"Authorization: Bearer $TOKEN\" \ -H 'Content-Type: application/json' \ -d '{\"document_id\": \"'$DOC'\", \"subject\": \"Please sign the NDA\", \"message\": \"Hi Ann, please sign by Friday.\", \"expiry_date\": \"2026-12-31\"}' # 7. Poll until status is 6 (Completed), then get the signed PDF curl \"$API/ap1/documents-status-list/?document_ids=$DOC\" -H \"Authorization: Bearer $TOKEN\" curl \"$API/ap1/document/download-link/?id=$DOC\" -H \"Authorization: Bearer $TOKEN\" ``` ## Postman Import the whole API into Postman with **Import → Link** and `<this server>/swaggerap1/postman.json`. Set `client_id` and `client_secret` in the collection's **Variables**, run **Get an access token** (it saves the token for every other request), and set `document_id` when a request needs one. ## SDKs Official client libraries, generated from this API's spec. Each also gets and renews the access token for you and checks webhook signatures: | Language | Install | |---|---| | Python 3.8+ | `pip install signedly` | | Node / TypeScript | `npm install @signedly/sdk` | | PHP 7.4+ | `composer require signedly/sdk` | | Java 11+ | Maven or Gradle `com.signedly:signedly-sdk` | Source and a quick start for each language: https://github.com/signedly/signedly-sdks ## Webhooks Instead of polling, add an endpoint with `POST /ap1/webhooks/` (or in **Account & Settings → API**) and Signedly posts your organisation's document events to it: `document.sent`, `document.viewed`, `document.signed`, `document.approved`, `document.completed`, `document.rejected`, `document.expired` and `document.voided` (all of them, or the `events` you choose). Each is a JSON `POST`: ```json {\"id\": \"5b7f…\", \"type\": \"document.signed\", \"created_at\": \"2026-10-27T09:12:00+00:00\", \"test\": false, \"data\": {\"document\": {\"id\": \"6f0c…\", \"name\": \"nda.pdf\", \"status\": 5}, \"recipient\": {\"id\": \"0b6e…\", \"email\": \"ann@example.com\", \"name\": \"Ann Lee\", \"role\": \"signer\"}}} ``` `recipient` is null for events no recipient caused (sent, completed, expired); `test` is true for documents made with your test keys. Fetch anything else, such as download links, with your access token: events never carry links. **Check every event is from Signedly.** The `Signedly-Signature` header is `t=<unix seconds>,v1=<signature>`, where the signature is the hex HMAC-SHA256 of `<t>.<raw body>` with the endpoint's secret. Refuse an event whose signature doesn't match or whose `t` is more than 5 minutes off. The header can carry more than one `v1` (after you rotate the secret, see below): accept the event if any of them matches. The signature with the old secret is always the last `v1`, so a check that reads only the last one keeps working until you switch secrets. ```python import hashlib, hmac, time def is_from_signedly(secret, header, raw_body): items = [item.split(\"=\", 1) for item in header.split(\",\")] t = next(value for name, value in items if name == \"t\") signed = f\"{t}.{raw_body.decode()}\".encode() expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest() fresh = abs(time.time() - int(t)) <= 300 return fresh and any( hmac.compare_digest(value, expected) for name, value in items if name == \"v1\" ) ``` **Rotating the secret** (`POST /ap1/webhooks/{id}/rotate-secret/`, or in Account & Settings → API) gives a new secret. For the next 24 hours every event is signed with both the new and the old one, so you can deploy the new secret without refusing events; `previous_secret_expires_at` says when the old one stops. If the old secret leaked, send `{\"expire_previous\": true}` and it stops at once. **Answer 2xx within 10 seconds**, then do the work. Anything else is retried after 1 and 5 minutes, then 30 minutes and 2, 5 and 10 hours (7 tries in about 18 hours). `Signedly-Event-Id` is the same on every try of an event: use it to ignore repeats. After 20 events in a row fail for good, Signedly switches the endpoint off and emails your organisation's admin; switch it on again with `PUT /ap1/webhooks/{id}/` and `\"is_active\": true`. Each endpoint's deliveries and their last answers are at `GET /ap1/webhooks/{id}/deliveries/`, and any can be sent again. Webhook history is kept for **30 days**: a delivery that succeeded or failed more than 30 days ago is deleted and can't be sent again. **Delivery is at least once and in no set order.** Build your endpoint for both: - *The same event can arrive more than once:* an answer that came after the 10 seconds, a lost connection after your server got the event, or a delivery you send again from the deliveries list. Every copy has the same `Signedly-Event-Id` and the same body (`id`, `created_at`, `data`); only `t` and the signature in `Signedly-Signature` are new. Keep the event ids you've handled and skip repeats. - *Events can arrive out of order:* each is sent on its own and retries mix in, so `document.signed` can come after `document.completed`. `created_at` is when the event happened, not when it was sent: order by it, or fetch the document (`GET /ap1/documents-status/{id}/`) for its current status. - *What counts as a failure:* any answer that isn't 2xx within 10 seconds, redirects (3xx) included, since they aren't followed; timeouts; connection and TLS errors; and a URL that no longer points to a public address. Each is retried on the schedule above. An endpoint that is switched off, or an organisation whose plan has no API access, gets nothing, and those deliveries fail at once without counting toward switching the endpoint off. - *Where events go:* only `https://` URLs on public internet addresses, checked when you save the endpoint and before every try. ## Sandbox Build and test against the API without paying for documents: in **Account & Settings → API**, generate your **test keys**, and get a token with them at `/ap1/token/` as usual. Everything works the same, except that what you upload or make from a template with a test token is a **test document** (`is_test` on its upload): - every page of its PDF and of its audit trail says **TEST – NOT LEGALLY BINDING**; - its emails are real, with `[TEST]` at the start of the subject; - it isn't billed or counted toward your plan; - your organisation can make 50 a calendar month (templates don't count); the next upload answers 429; - a test token sees and acts only on test documents: a live document answers 404 and isn't listed. It can use your templates (list them, read their fields, make documents and bulk sends from them) but not change or delete a live one. - `/ap1/logs/` and `/ap1/logs/hits/` show a test token only calls made with your test keys, and a live token only live calls (add `is_test=true` to see the test calls). Webhook deliveries listed or resent with a test token are only those of test documents' events (`\"test\": true`). ## Fields Positions and sizes are in **PDF points** (1/72 inch), measured from the **top-left corner** of the page as it is displayed (rotation applied). `page_number` counts pages from 0: send the `id` and `page_number` that `GET /ap1/documents/{id}/pages/` lists for the same page. A field needs a known `kind` and a `width` and `height` above 0, and must sit wholly on its page (1 point of tolerance); otherwise it is refused with 400. A field's page and signatory can't be changed later: delete the field and add it again. ## Status values **Document `status`:** 1 Draft · 2 Signees Added · 3 Prepared · 4 Sent · 5 In Progress · 6 Completed · 7 Rejected · 8 Archived · 9 Expired · 10 Voided (stopped by its sender in the web app; its links no longer sign). Signatories, fields and sends are only accepted while a document is 1–3 (not yet sent). **Signatory `status`:** 1 Waiting · 2 Invited · 3 Signed · 4 Viewed · 5 Rejected. ## Lists `GET /ap1/documents/`, `/ap1/documents-status-list/`, `/ap1/templates/`, `/ap1/logs/` and `/ap1/logs/hits/` are paged: pass `limit` (default 10, at most 100; a larger value gets 100) and `offset`, and read `count`, `next`, `previous` and `results` from the response. Follow `next` until it is null to read every result. ## Errors | Status | Meaning | |---|---| | 400 | The request was refused, also when your plan doesn't include it (see Plans); the body says why (`{\"error\": \"...\"}`, or the name of each bad field with its messages). Nothing was changed. | | 403 | The access token is missing, unknown or expired; the client ID and secret or the refresh token were refused; the organisation's plan has no API access (Free, see Plans); or an `expiry_date` isn't in the future (`\"Invalid Date Entered\"`). | | 402 | No API contract, or an unpaid API invoice: live documents are refused (test keys keep working). | | 404 | The document, template, signatory or field doesn't exist or isn't yours. | | 429 | Too many requests this minute (see the limits under Authentication; wait `Retry-After` seconds), or this month's 50 test documents are used. | | 5xx | Our side failed; retry later. | A send that times out may still have worked: check the document's status before sending again (a second send of a sent document answers 400). Download, view and audit links are valid for about 7 days; ask for a new one whenever you need it. ## Versioning and changes The API has one version today, `/ap1/`. A **breaking change** is only ever made in a new version path (for example `/ap1/v2/`): the current one keeps working, and its end (sunset) date is announced at least **6 months** ahead, by email to every API client's organisation admin and here in these docs. Breaking means: removing or renaming a route, a field or an enum value; a new required input; a changed status code or error shape; a changed meaning of an existing field. Not breaking, and made without notice: new routes; new optional inputs; new fields in responses and webhook payloads; new webhook event types; new enum values in responses; clearer error messages. **Ignore fields and event types you don't know**, so these changes never break your integration. The SDKs follow the API: a breaking change comes with a new major SDK version (see SDKs).
|
|
18
|
+
|
|
@@ -7,25 +7,41 @@ otherwise (the uploads are `multipart/form-data`).
|
|
|
7
7
|
|
|
8
8
|
## Authentication
|
|
9
9
|
|
|
10
|
-
1. In the Signedly web app,
|
|
11
|
-
**client ID** and **client secret
|
|
10
|
+
1. In the Signedly web app, your organisation's **super admin** opens **Account &
|
|
11
|
+
Settings → API** and generates a **client ID** and **client secret**. Only the
|
|
12
|
+
super admin can see, regenerate or replace the keys and manage webhooks there,
|
|
13
|
+
because a key acts for the organisation admin.
|
|
12
14
|
2. `POST /ap1/token/` with them. You get an `access_token` (valid **2 hours**) and
|
|
13
15
|
a `refresh_token` (valid **7 days**). While both are still valid, calling
|
|
14
16
|
`/ap1/token/` again returns the same pair.
|
|
15
17
|
3. Send the access token on every other call:
|
|
16
18
|
`Authorization: Bearer <access_token>`.
|
|
17
19
|
4. When the access token expires, `POST /ap1/refreshtoken/` with the refresh token
|
|
18
|
-
for a new access token.
|
|
19
|
-
`/ap1/token/`
|
|
20
|
+
for a new access token. The refresh token stays the same and each refresh keeps
|
|
21
|
+
it valid for 7 more days, up to 30 days after `/ap1/token/` made it. When it has
|
|
22
|
+
expired, call `/ap1/token/` again. Your key pair has one token, shared by all your
|
|
23
|
+
processes: after a refresh, the access token it replaced keeps working for 60
|
|
24
|
+
seconds (never past its own expiry), so another process using it isn't refused
|
|
25
|
+
mid-call; switch every process to the new one.
|
|
20
26
|
|
|
21
27
|
`/ap1/token/` and `/ap1/refreshtoken/` allow 60 calls a minute per IP address;
|
|
22
|
-
more answer 429.
|
|
28
|
+
more answer 429. Every other call counts against your API client, separately for
|
|
29
|
+
the live and the test keys: **600 calls a minute** in all, of which **120 a
|
|
30
|
+
minute** may upload or send documents (`upload/`, `upload_app/`, `document/send/`,
|
|
31
|
+
`document/send_url/`, `document/update_and_send/`, `documents/fromtemplate/`,
|
|
32
|
+
`bulk-sends/`; a bulk send counts once, however many rows it has). Over a limit
|
|
33
|
+
the call answers 429 with `Retry-After` (seconds until the next minute) and
|
|
34
|
+
`X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` (Unix time);
|
|
35
|
+
wait that long and retry. Contact support@signedly.com if your integration needs
|
|
36
|
+
more. A missing, unknown or expired access token answers 403
|
|
23
37
|
(`\"Client not found\"` or `\"Access token expired\"`).
|
|
24
38
|
|
|
25
39
|
The API acts for your **organisation's admin account**: documents you upload
|
|
26
40
|
belong to it and appear in its Signedly web app, and you can reach only that
|
|
27
|
-
account's documents, templates, signatories and fields
|
|
28
|
-
|
|
41
|
+
account's documents, templates, signatories and fields, plus every document your
|
|
42
|
+
API client made. When your super admin hands the organisation over, the API acts
|
|
43
|
+
for the new super admin and still reaches what it made before. Another
|
|
44
|
+
organisation's IDs answer 404, as if they didn't exist.
|
|
29
45
|
|
|
30
46
|
## Plans
|
|
31
47
|
|
|
@@ -49,9 +65,48 @@ paid plan, a feature it doesn't include answers 400 with
|
|
|
49
65
|
|
|
50
66
|
Live documents also need an API contract with Signedly. Without one, or with an
|
|
51
67
|
unpaid API invoice, `POST /ap1/upload/` (except templates), `/ap1/upload_app/`,
|
|
52
|
-
`/ap1/documents/fromtemplate
|
|
68
|
+
`/ap1/documents/fromtemplate/`, `/ap1/bulk-sends/` and sending a draft already
|
|
69
|
+
uploaded (`/ap1/document/send/`, `/ap1/document/send_url/`,
|
|
70
|
+
`/ap1/document/update_and_send/`) answer 402 with live keys.
|
|
53
71
|
Test keys work without a contract (see Sandbox).
|
|
54
72
|
|
|
73
|
+
## API billing
|
|
74
|
+
|
|
75
|
+
Live API documents are billed per document under your organisation's API contract,
|
|
76
|
+
on top of its Signedly plan. List prices (a contract can differ; prices exclude
|
|
77
|
+
tax):
|
|
78
|
+
|
|
79
|
+
| Tier | Per document | Monthly minimum |
|
|
80
|
+
|---|---|---|
|
|
81
|
+
| Basic | $0.80 / ₹60 | 100 documents |
|
|
82
|
+
| Standard | $0.50 / ₹40 | 250 documents |
|
|
83
|
+
| Premium | $0.25 / ₹20 | 1,000 documents |
|
|
84
|
+
|
|
85
|
+
- **What counts:** a live document your API client sends, once, when it's sent.
|
|
86
|
+
`/ap1/upload_app/` documents count when they're made, because that route returns
|
|
87
|
+
a signing link straight away. Every document of an API bulk send counts. Drafts
|
|
88
|
+
never sent, templates, test-key documents and documents sent from the web app
|
|
89
|
+
don't count. Sending again or archiving doesn't count twice. Months are calendar
|
|
90
|
+
months in UTC; the API page in Account & Settings shows this month's count.
|
|
91
|
+
- **Rejected, voided and expired documents** are still billed: a document is
|
|
92
|
+
billed when it's sent, whatever happens to it afterwards. A send refused before it
|
|
93
|
+
goes out (a 4xx answer) isn't billed.
|
|
94
|
+
- **Minimum and overage:** on the 1st of each month your invoice charges that
|
|
95
|
+
month's minimum upfront, plus last month's documents above its minimum at last
|
|
96
|
+
month's price. Unused documents of the minimum don't roll over. The first month
|
|
97
|
+
is charged in full, whatever day the contract starts.
|
|
98
|
+
- **Changing or ending a contract:** new terms apply from the next invoice. When a
|
|
99
|
+
contract ends, live documents keep working to the end of its last month; the next
|
|
100
|
+
invoice charges only that month's overage, and live documents are then refused
|
|
101
|
+
(402) until a contract is in place again.
|
|
102
|
+
- **Paying:** an invoice is due 7 days after it's issued. Reminders go out 1, 7 and
|
|
103
|
+
13 days after the due date; 14 days after it, live documents are paused (402)
|
|
104
|
+
until every overdue invoice is paid, and work again as soon as it is. Test keys,
|
|
105
|
+
your data and documents already sent are never affected.
|
|
106
|
+
- **Tax:** prices exclude tax; INR invoices show GST as its own line when it
|
|
107
|
+
applies.
|
|
108
|
+
- **Refunds** are handled by hand: email support@signedly.com.
|
|
109
|
+
|
|
55
110
|
## Sending a document for signing
|
|
56
111
|
|
|
57
112
|
1. `POST /ap1/upload/` a PDF or DOCX (`type` 2). The document is prepared in the
|
|
@@ -65,14 +120,24 @@ Test keys work without a contract (see Sandbox).
|
|
|
65
120
|
- `POST /ap1/document/send/` emails every signatory a signing link (with
|
|
66
121
|
ordered signing, only the first; each next one is emailed in
|
|
67
122
|
turn), or
|
|
68
|
-
- `POST /ap1/document/send_url/`
|
|
69
|
-
|
|
123
|
+
- `POST /ap1/document/send_url/` returns the first signatory's signing
|
|
124
|
+
link, for you to show or send yourself, and emails them nothing; any other
|
|
125
|
+
signatories are emailed as by `send/` (all at once, or with ordered signing
|
|
126
|
+
each in turn after the one before signs).
|
|
70
127
|
5. Poll `GET /ap1/documents-status-list/` (or `GET /ap1/documents/`) until the
|
|
71
128
|
status is 6 (Completed), then `GET /ap1/document/download-link/` for the
|
|
72
129
|
signed PDF and `GET /ap1/document/download-audit-link/` for its audit trail.
|
|
73
130
|
|
|
131
|
+
**The two document lists differ on purpose.** `GET /ap1/documents/` lists only the
|
|
132
|
+
documents this API client made through the API. `GET /ap1/documents-status-list/`
|
|
133
|
+
lists every document of the organisation's admin, including ones made in the web app.
|
|
134
|
+
Use the first to see your integration's own documents, and the second for everything
|
|
135
|
+
the admin account owns.
|
|
136
|
+
|
|
74
137
|
**From a template:** upload with `type` 4 and a `template_name` (or make the
|
|
75
|
-
template in the web app), place its fields with `POST /ap1/templates/fields
|
|
138
|
+
template in the web app), place its fields with `POST /ap1/templates/fields/`
|
|
139
|
+
(each on the role named by its `signatory_id`, a role's `id` from
|
|
140
|
+
`GET /ap1/signatories/?document_id=<template ID>`; without one, on the first role),
|
|
76
141
|
then for each signing make a document with `POST /ap1/documents/fromtemplate/`,
|
|
77
142
|
add its signatory, and send it.
|
|
78
143
|
|
|
@@ -82,6 +147,15 @@ own signature. After signing they go to the `redirect_url` you sent, and the
|
|
|
82
147
|
signed PDF and its audit trail are emailed to `final_email` (otherwise to your
|
|
83
148
|
organisation's admin).
|
|
84
149
|
|
|
150
|
+
**A PDF that is already digitally signed** (Adobe, DocuSign, a DSC or Aadhaar
|
|
151
|
+
eSign) is accepted, but signing it on Signedly invalidates those signatures. The
|
|
152
|
+
upload and send answers (`upload/`, `upload_app/`, `send/`, `send_url/`,
|
|
153
|
+
`update_and_send/`) say so: `existing_signatures` has the `count` (null when the
|
|
154
|
+
file couldn't be checked) and the signers' `names`, and `warnings` holds the text
|
|
155
|
+
to show your user, e.g. \"This PDF already has 1 digital signature (by Asha Rao).
|
|
156
|
+
Signing it on Signedly will invalidate it.\" `warnings` is empty when there is
|
|
157
|
+
nothing to warn about. Nothing is refused because of it.
|
|
158
|
+
|
|
85
159
|
## Quick start with curl
|
|
86
160
|
|
|
87
161
|
Each step uses an ID from the step before. `$API` is this server, e.g.
|
|
@@ -134,12 +208,28 @@ Import the whole API into Postman with **Import → Link** and
|
|
|
134
208
|
collection's **Variables**, run **Get an access token** (it saves the token for
|
|
135
209
|
every other request), and set `document_id` when a request needs one.
|
|
136
210
|
|
|
211
|
+
## SDKs
|
|
212
|
+
|
|
213
|
+
Official client libraries, generated from this API's spec. Each also gets and
|
|
214
|
+
renews the access token for you and checks webhook signatures:
|
|
215
|
+
|
|
216
|
+
| Language | Install |
|
|
217
|
+
|---|---|
|
|
218
|
+
| Python 3.8+ | `pip install signedly` |
|
|
219
|
+
| Node / TypeScript | `npm install @signedly/sdk` |
|
|
220
|
+
| PHP 7.4+ | `composer require signedly/sdk` |
|
|
221
|
+
| Java 11+ | Maven or Gradle `com.signedly:signedly-sdk` |
|
|
222
|
+
|
|
223
|
+
Source and a quick start for each language:
|
|
224
|
+
https://github.com/signedly/signedly-sdks
|
|
225
|
+
|
|
137
226
|
## Webhooks
|
|
138
227
|
|
|
139
228
|
Instead of polling, add an endpoint with `POST /ap1/webhooks/` (or in **Account &
|
|
140
229
|
Settings → API**) and Signedly posts your organisation's document events to it:
|
|
141
230
|
`document.sent`, `document.viewed`, `document.signed`, `document.approved`,
|
|
142
|
-
`document.completed`, `document.rejected
|
|
231
|
+
`document.completed`, `document.rejected`, `document.expired` and
|
|
232
|
+
`document.voided` (all of them,
|
|
143
233
|
or the `events` you choose). Each is a JSON `POST`:
|
|
144
234
|
|
|
145
235
|
```json
|
|
@@ -157,19 +247,31 @@ as download links, with your access token: events never carry links.
|
|
|
157
247
|
**Check every event is from Signedly.** The `Signedly-Signature` header is
|
|
158
248
|
`t=<unix seconds>,v1=<signature>`, where the signature is the hex HMAC-SHA256 of
|
|
159
249
|
`<t>.<raw body>` with the endpoint's secret. Refuse an event whose signature
|
|
160
|
-
doesn't match or whose `t` is more than 5 minutes off
|
|
250
|
+
doesn't match or whose `t` is more than 5 minutes off. The header can carry more
|
|
251
|
+
than one `v1` (after you rotate the secret, see below): accept the event if any
|
|
252
|
+
of them matches. The signature with the old secret is always the last `v1`, so a
|
|
253
|
+
check that reads only the last one keeps working until you switch secrets.
|
|
161
254
|
|
|
162
255
|
```python
|
|
163
256
|
import hashlib, hmac, time
|
|
164
257
|
|
|
165
258
|
def is_from_signedly(secret, header, raw_body):
|
|
166
|
-
|
|
167
|
-
|
|
259
|
+
items = [item.split(\"=\", 1) for item in header.split(\",\")]
|
|
260
|
+
t = next(value for name, value in items if name == \"t\")
|
|
261
|
+
signed = f\"{t}.{raw_body.decode()}\".encode()
|
|
168
262
|
expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
|
|
169
|
-
fresh = abs(time.time() - int(
|
|
170
|
-
return fresh and
|
|
263
|
+
fresh = abs(time.time() - int(t)) <= 300
|
|
264
|
+
return fresh and any(
|
|
265
|
+
hmac.compare_digest(value, expected) for name, value in items if name == \"v1\"
|
|
266
|
+
)
|
|
171
267
|
```
|
|
172
268
|
|
|
269
|
+
**Rotating the secret** (`POST /ap1/webhooks/{id}/rotate-secret/`, or in Account &
|
|
270
|
+
Settings → API) gives a new secret. For the next 24 hours every event is signed
|
|
271
|
+
with both the new and the old one, so you can deploy the new secret without
|
|
272
|
+
refusing events; `previous_secret_expires_at` says when the old one stops. If the
|
|
273
|
+
old secret leaked, send `{\"expire_previous\": true}` and it stops at once.
|
|
274
|
+
|
|
173
275
|
**Answer 2xx within 10 seconds**, then do the work. Anything else is retried after
|
|
174
276
|
1 and 5 minutes, then 30 minutes and 2, 5 and 10 hours (7 tries in about 18
|
|
175
277
|
hours). `Signedly-Event-Id` is the same on every try of an event: use it to
|
|
@@ -177,7 +279,28 @@ ignore repeats. After 20 events in a row fail for good, Signedly switches the
|
|
|
177
279
|
endpoint off and emails your organisation's admin; switch it on again with
|
|
178
280
|
`PUT /ap1/webhooks/{id}/` and `\"is_active\": true`. Each endpoint's deliveries and
|
|
179
281
|
their last answers are at `GET /ap1/webhooks/{id}/deliveries/`, and any can be
|
|
180
|
-
sent again.
|
|
282
|
+
sent again. Webhook history is kept for **30 days**: a delivery that succeeded or
|
|
283
|
+
failed more than 30 days ago is deleted and can't be sent again.
|
|
284
|
+
|
|
285
|
+
**Delivery is at least once and in no set order.** Build your endpoint for both:
|
|
286
|
+
|
|
287
|
+
- *The same event can arrive more than once:* an answer that came after the 10
|
|
288
|
+
seconds, a lost connection after your server got the event, or a delivery you
|
|
289
|
+
send again from the deliveries list. Every copy has the same `Signedly-Event-Id`
|
|
290
|
+
and the same body (`id`, `created_at`, `data`); only `t` and the signature in
|
|
291
|
+
`Signedly-Signature` are new. Keep the event ids you've handled and skip repeats.
|
|
292
|
+
- *Events can arrive out of order:* each is sent on its own and retries mix in, so
|
|
293
|
+
`document.signed` can come after `document.completed`. `created_at` is when the
|
|
294
|
+
event happened, not when it was sent: order by it, or fetch the document
|
|
295
|
+
(`GET /ap1/documents-status/{id}/`) for its current status.
|
|
296
|
+
- *What counts as a failure:* any answer that isn't 2xx within 10 seconds,
|
|
297
|
+
redirects (3xx) included, since they aren't followed; timeouts; connection and
|
|
298
|
+
TLS errors; and a URL that no longer points to a public address. Each is retried
|
|
299
|
+
on the schedule above. An endpoint that is switched off, or an organisation
|
|
300
|
+
whose plan has no API access, gets nothing, and those deliveries fail at once
|
|
301
|
+
without counting toward switching the endpoint off.
|
|
302
|
+
- *Where events go:* only `https://` URLs on public internet addresses, checked
|
|
303
|
+
when you save the endpoint and before every try.
|
|
181
304
|
|
|
182
305
|
## Sandbox
|
|
183
306
|
|
|
@@ -191,20 +314,30 @@ upload):
|
|
|
191
314
|
- its emails are real, with `[TEST]` at the start of the subject;
|
|
192
315
|
- it isn't billed or counted toward your plan;
|
|
193
316
|
- your organisation can make 50 a calendar month (templates don't count); the next
|
|
194
|
-
upload answers 429
|
|
317
|
+
upload answers 429;
|
|
318
|
+
- a test token sees and acts only on test documents: a live document answers 404
|
|
319
|
+
and isn't listed. It can use your templates (list them, read their fields, make
|
|
320
|
+
documents and bulk sends from them) but not change or delete a live one.
|
|
321
|
+
- `/ap1/logs/` and `/ap1/logs/hits/` show a test token only calls made with your
|
|
322
|
+
test keys, and a live token only live calls (add `is_test=true` to see the
|
|
323
|
+
test calls). Webhook deliveries listed or resent with a test token are only
|
|
324
|
+
those of test documents' events (`\"test\": true`).
|
|
195
325
|
|
|
196
326
|
## Fields
|
|
197
327
|
|
|
198
328
|
Positions and sizes are in **PDF points** (1/72 inch), measured from the
|
|
199
329
|
**top-left corner** of the page as it is displayed (rotation applied).
|
|
200
|
-
`page_number` counts pages from 0
|
|
330
|
+
`page_number` counts pages from 0: send the `id` and `page_number` that
|
|
331
|
+
`GET /ap1/documents/{id}/pages/` lists for the same page. A field needs a known
|
|
332
|
+
`kind` and a `width` and `height` above 0, and must sit wholly on its page (1 point
|
|
201
333
|
of tolerance); otherwise it is refused with 400. A field's page and signatory
|
|
202
334
|
can't be changed later: delete the field and add it again.
|
|
203
335
|
|
|
204
336
|
## Status values
|
|
205
337
|
|
|
206
338
|
**Document `status`:** 1 Draft · 2 Signees Added · 3 Prepared · 4 Sent ·
|
|
207
|
-
5 In Progress · 6 Completed · 7 Rejected · 8 Archived · 9 Expired
|
|
339
|
+
5 In Progress · 6 Completed · 7 Rejected · 8 Archived · 9 Expired · 10 Voided
|
|
340
|
+
(stopped by its sender in the web app; its links no longer sign). Signatories,
|
|
208
341
|
fields and sends are only accepted while a document is 1–3 (not yet sent).
|
|
209
342
|
|
|
210
343
|
**Signatory `status`:** 1 Waiting · 2 Invited · 3 Signed · 4 Viewed · 5 Rejected.
|
|
@@ -212,8 +345,9 @@ fields and sends are only accepted while a document is 1–3 (not yet sent).
|
|
|
212
345
|
## Lists
|
|
213
346
|
|
|
214
347
|
`GET /ap1/documents/`, `/ap1/documents-status-list/`, `/ap1/templates/`,
|
|
215
|
-
`/ap1/logs/` and `/ap1/logs/hits/` are paged: pass `limit` (default 10
|
|
216
|
-
`offset`, and read `count`, `next`, `previous` and
|
|
348
|
+
`/ap1/logs/` and `/ap1/logs/hits/` are paged: pass `limit` (default 10, at most
|
|
349
|
+
100; a larger value gets 100) and `offset`, and read `count`, `next`, `previous` and
|
|
350
|
+
`results` from the response. Follow `next` until it is null to read every result.
|
|
217
351
|
|
|
218
352
|
## Errors
|
|
219
353
|
|
|
@@ -223,7 +357,7 @@ fields and sends are only accepted while a document is 1–3 (not yet sent).
|
|
|
223
357
|
| 403 | The access token is missing, unknown or expired; the client ID and secret or the refresh token were refused; the organisation's plan has no API access (Free, see Plans); or an `expiry_date` isn't in the future (`\"Invalid Date Entered\"`). |
|
|
224
358
|
| 402 | No API contract, or an unpaid API invoice: live documents are refused (test keys keep working). |
|
|
225
359
|
| 404 | The document, template, signatory or field doesn't exist or isn't yours. |
|
|
226
|
-
| 429 | Too many
|
|
360
|
+
| 429 | Too many requests this minute (see the limits under Authentication; wait `Retry-After` seconds), or this month's 50 test documents are used. |
|
|
227
361
|
| 5xx | Our side failed; retry later. |
|
|
228
362
|
|
|
229
363
|
A send that times out may still have worked: check the document's status before
|
|
@@ -232,11 +366,30 @@ sending again (a second send of a sent document answers 400).
|
|
|
232
366
|
Download, view and audit links are valid for about 7 days; ask for a new one
|
|
233
367
|
whenever you need it.
|
|
234
368
|
|
|
369
|
+
## Versioning and changes
|
|
370
|
+
|
|
371
|
+
The API has one version today, `/ap1/`. A **breaking change** is only ever made in
|
|
372
|
+
a new version path (for example `/ap1/v2/`): the current one keeps working, and
|
|
373
|
+
its end (sunset) date is announced at least **6 months** ahead, by email to every
|
|
374
|
+
API client's organisation admin and here in these docs.
|
|
375
|
+
|
|
376
|
+
Breaking means: removing or renaming a route, a field or an enum value; a new
|
|
377
|
+
required input; a changed status code or error shape; a changed meaning of an
|
|
378
|
+
existing field.
|
|
379
|
+
|
|
380
|
+
Not breaking, and made without notice: new routes; new optional inputs; new fields
|
|
381
|
+
in responses and webhook payloads; new webhook event types; new enum values in
|
|
382
|
+
responses; clearer error messages. **Ignore fields and event types you don't
|
|
383
|
+
know**, so these changes never break your integration.
|
|
384
|
+
|
|
385
|
+
The SDKs follow the API: a breaking change comes with a new major SDK version
|
|
386
|
+
(see SDKs).
|
|
387
|
+
|
|
235
388
|
|
|
236
389
|
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
|
237
390
|
|
|
238
391
|
- API version: v1
|
|
239
|
-
- Package version: 0.1.
|
|
392
|
+
- Package version: 0.1.3
|
|
240
393
|
- Generator version: 7.10.0
|
|
241
394
|
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
|
|
242
395
|
For more information, please visit [https://signedly.com](https://signedly.com)
|
|
@@ -300,12 +453,13 @@ with signedly.ApiClient(configuration) as api_client:
|
|
|
300
453
|
api_instance = signedly.APIRequestLogsApi(api_client)
|
|
301
454
|
method = 'method_example' # str | Only this HTTP method. (optional)
|
|
302
455
|
path = 'path_example' # str | Only paths that contain this, e.g. `/ap1/document/`. (optional)
|
|
303
|
-
|
|
456
|
+
is_test = True # bool | Live token only: `true` lists the calls made with your test keys instead of the live ones. A test token always sees only test-key calls. (optional)
|
|
457
|
+
limit = 56 # int | How many results to return (default 10, at most 100). (optional)
|
|
304
458
|
offset = 56 # int | How many results to skip. (optional)
|
|
305
459
|
|
|
306
460
|
try:
|
|
307
461
|
# Count your API calls per path
|
|
308
|
-
api_response = api_instance.list_request_counts(method=method, path=path, limit=limit, offset=offset)
|
|
462
|
+
api_response = api_instance.list_request_counts(method=method, path=path, is_test=is_test, limit=limit, offset=offset)
|
|
309
463
|
print("The response of APIRequestLogsApi->list_request_counts:\n")
|
|
310
464
|
pprint(api_response)
|
|
311
465
|
except ApiException as e:
|
|
@@ -331,7 +485,7 @@ Class | Method | HTTP request | Description
|
|
|
331
485
|
*DocumentsApi* | [**get_download_status**](docs/DocumentsApi.md#get_download_status) | **GET** /ap1/documents-status/{id}/ | Check whether the signed PDF is ready
|
|
332
486
|
*DocumentsApi* | [**list_document_pages**](docs/DocumentsApi.md#list_document_pages) | **GET** /ap1/documents/{id}/pages/ | List a document's pages and their fields
|
|
333
487
|
*DocumentsApi* | [**list_document_statuses**](docs/DocumentsApi.md#list_document_statuses) | **GET** /ap1/documents-status-list/ | List the status of your organisation's documents
|
|
334
|
-
*DocumentsApi* | [**list_documents**](docs/DocumentsApi.md#list_documents) | **GET** /ap1/documents/ | List
|
|
488
|
+
*DocumentsApi* | [**list_documents**](docs/DocumentsApi.md#list_documents) | **GET** /ap1/documents/ | List your organisation's documents
|
|
335
489
|
*DocumentsApi* | [**upload_document**](docs/DocumentsApi.md#upload_document) | **POST** /ap1/upload/ | Upload a document or template
|
|
336
490
|
*DocumentsApi* | [**upload_document_for_one_signer**](docs/DocumentsApi.md#upload_document_for_one_signer) | **POST** /ap1/upload_app/ | Upload a document for one signer and get their signing link
|
|
337
491
|
*DownloadsApi* | [**get_audit_trail_link**](docs/DownloadsApi.md#get_audit_trail_link) | **GET** /ap1/document/download-audit-link/ | Get a link to the audit trail
|
|
@@ -381,6 +535,7 @@ Class | Method | HTTP request | Description
|
|
|
381
535
|
- [CreateSignatoryRequest](docs/CreateSignatoryRequest.md)
|
|
382
536
|
- [CreateTemplateFieldsRequestInner](docs/CreateTemplateFieldsRequestInner.md)
|
|
383
537
|
- [CreateWebhookEndpointRequest](docs/CreateWebhookEndpointRequest.md)
|
|
538
|
+
- [DeleteDocument204Response](docs/DeleteDocument204Response.md)
|
|
384
539
|
- [DeleteFieldRequest](docs/DeleteFieldRequest.md)
|
|
385
540
|
- [Document](docs/Document.md)
|
|
386
541
|
- [DocumentPage](docs/DocumentPage.md)
|
|
@@ -400,7 +555,9 @@ Class | Method | HTTP request | Description
|
|
|
400
555
|
- [RequestHit](docs/RequestHit.md)
|
|
401
556
|
- [RequestLog](docs/RequestLog.md)
|
|
402
557
|
- [RequestLogPage](docs/RequestLogPage.md)
|
|
558
|
+
- [RotateWebhookSecretRequest](docs/RotateWebhookSecretRequest.md)
|
|
403
559
|
- [SendDocument200Response](docs/SendDocument200Response.md)
|
|
560
|
+
- [SendDocument200ResponseExistingSignatures](docs/SendDocument200ResponseExistingSignatures.md)
|
|
404
561
|
- [SendDocumentByLink200Response](docs/SendDocumentByLink200Response.md)
|
|
405
562
|
- [SendDocumentByLinkRequest](docs/SendDocumentByLinkRequest.md)
|
|
406
563
|
- [SendDocumentRequest](docs/SendDocumentRequest.md)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "signedly"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.3"
|
|
4
4
|
description = "Signedly API"
|
|
5
5
|
authors = ["Signedly <support@signedly.com>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -18,12 +18,12 @@ pydantic = ">= 2"
|
|
|
18
18
|
typing-extensions = ">= 4.7.1"
|
|
19
19
|
|
|
20
20
|
[tool.poetry.dev-dependencies]
|
|
21
|
-
pytest = ">=
|
|
22
|
-
pytest-cov = ">=
|
|
23
|
-
tox = ">=
|
|
24
|
-
flake8 = ">=
|
|
25
|
-
types-python-dateutil = ">= 2.
|
|
26
|
-
mypy = ">= 1
|
|
21
|
+
pytest = ">= 9.2.0"
|
|
22
|
+
pytest-cov = ">= 7.1.0"
|
|
23
|
+
tox = ">= 4.67.12"
|
|
24
|
+
flake8 = ">= 7.5.0"
|
|
25
|
+
types-python-dateutil = ">= 2.9.0.20261104"
|
|
26
|
+
mypy = ">= 2.4.1"
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
[build-system]
|