Skip to content

Commit 4d10aa1

Browse files
Nicolas Frynicolasiscoding
authored andcommitted
[Trace] Accuracy fixes from SDK-main/backend-master review
1 parent 7129a46 commit 4d10aa1

11 files changed

Lines changed: 21 additions & 18 deletions

‎docs/API/create-image-variable-folder.api.mdx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ curl -X POST "https://api.turbodocx.com/Variable" \
4040
}'
4141
```
4242

43-
Send exactly one of `templateFolderId` (scopes the variable to that folder) or `isGlobal: true` (adds it to your org-wide knowledge base); sending both is rejected. `text` must be a base64 `data:` URI when `mimeType` is `"image"`, or plain text/HTML otherwise. `placeholder` must be unique within its folder or knowledge base and, if set, must be wrapped in curly braces, for example `{CompanyLogo}`.
43+
Optionally send `templateFolderId` (scopes the variable to that folder) or `isGlobal: true` (adds it to your org-wide knowledge base); at most one may be set, and sending both is rejected. `text` must be a base64 `data:` URI when `mimeType` is `"image"`, or plain text/HTML otherwise. `placeholder` must be unique within its folder or knowledge base and, if set, must be wrapped in curly braces, for example `{CompanyLogo}`.
4444

4545
## Example response
4646

@@ -73,8 +73,9 @@ On success the endpoint returns the created variable:
7373
| ------ | ---- | ------------- |
7474
| 401 | Missing or invalid API key/token, or the organization cannot be resolved | Empty (status only) |
7575
| 403 | The key's role is not administrator, contributor, or user | Empty (status only) |
76-
| 400 | `mimeType` or `text` is missing, `placeholder` is not wrapped in `{ }`, or both `isGlobal` and `templateFolderId` are set | `{ "message", "type": "ValidationError", "data": { "errors": [...] } }` |
77-
| 400 | `placeholder` already exists in that folder or knowledge base | `{ "message", "type": "TemplateError", "data": [{ "message", "type", "data": { "explanation", "context" } }] }` |
76+
| 403 | `isGlobal: true` and the key's role is `user` (creating a knowledge-base variable requires administrator or contributor) | Empty (status only) |
77+
| 400 | `mimeType` or `text` is missing, or both `isGlobal` and `templateFolderId` are set | `{ "message", "type": "ValidationError", "data": { "errors": [...] } }` |
78+
| 400 | `placeholder` is not wrapped in `{ }`, or already exists in that folder or knowledge base | `{ "message", "type": "TemplateError", "data": [{ "message", "type", "data": { "explanation", "context" } }] }` |
7879

7980
## Related endpoints
8081

‎docs/API/create-webhook.api.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ custom_edit_url: null
1717

1818
# Create Webhook
1919

20-
The Create Webhook endpoint registers a webhook that TurboDocx calls when TurboSign events happen in your organization, such as a document being signed or completed. Each webhook needs a unique `name` within your org; every TurboDocx SDK sends `"signature"`, so a second create call with the default name fails with a conflict instead of creating a duplicate.
20+
The Create Webhook endpoint registers a webhook that TurboDocx calls when TurboSign events happen in your organization, such as a document being signed or completed. Each webhook needs a unique `name` among your org's active webhooks; every TurboDocx SDK sends `"signature"`. A second create call with that name conflicts (409) only while an active webhook already has it; if you paused a webhook via [Update Webhook](/docs/API/update-webhook)'s `isActive: false` instead of deleting it, creating a new one with the same name succeeds and leaves two rows sharing that name, and by-name lookups on the other endpoints may then hit either one. Delete the old webhook (see [Delete Webhook](/docs/API/delete-webhook)) before reusing its name, rather than just pausing it.
2121

2222
## When to use it
2323

@@ -70,7 +70,7 @@ On success the endpoint returns `201 Created`:
7070
| ------ | ---- | ------------- |
7171
| 401 | Missing or invalid API key/token, or the organization cannot be resolved | Empty (status only) |
7272
| 403 | The key's role is not administrator | Empty (status only) |
73-
| 400 | `name`, `urls`, or `events` is missing or invalid, or any URL is not HTTPS | `{ "error": "..." }` (validation) |
73+
| 400 | `name`, `urls`, or `events` is missing or invalid, or any URL is not HTTPS | `{ "message", "type": "ValidationError", "data": { "errors": [...] } }` |
7474
| 409 | A webhook named `signature` already exists in your organization | `{ "message", "error": "WebhookNameTaken", "data": { "constraint", "orgId", "name" } }` |
7575

7676
## Related endpoints

‎docs/API/extract-template-placeholders-and-generate-preview.api.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ With `skipFile=true`:
5757
}
5858
```
5959

60-
Without `skipFile`, the response also includes `templatePdf`, a base64-encoded PDF rendering of the uploaded file. Pass the `vars` array as the `variables` field (JSON-stringified) when you subsequently call [Upload Template with Optional Default Values](/docs/API/upload-template-with-optional-default-values).
60+
Without `skipFile`, the response also includes `templatePdf`, the rendered PDF of the uploaded file. It is a JSON-serialized Node.js Buffer, not a base64 string: an object of the form `{"type": "Buffer", "data": [37, 80, 68, 70, ...]}`, where `data` is an array of the PDF's raw bytes. To use it, reconstruct the binary from the byte array, for example `Buffer.from(templatePdf.data)` in Node.js or `new Uint8Array(templatePdf.data)` in the browser. Pass the `vars` array as the `variables` field (JSON-stringified) when you subsequently call [Upload Template with Optional Default Values](/docs/API/upload-template-with-optional-default-values).
6161

6262
## Common errors
6363

‎docs/API/list-webhook-deliveries.api.mdx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ curl "https://api.turbodocx.com/api/webhooks/signature/deliveries?limit=20&offse
3434

3535
Supported filters: `eventType`, `isDelivered` (`true`/`false`), and `httpStatus` (an exact status code). `limit` defaults to `20`, `offset` to `0`.
3636

37+
> **Known limitation:** `isDelivered=true` and `httpStatus` do not currently filter results correctly due to a backend issue: `isDelivered=true` returns the same (undelivered-only) results as `isDelivered=false`, and `httpStatus` is ignored entirely regardless of value. Only `isDelivered=false` behaves as documented today.
38+
3739
## Example response
3840

3941
```json
@@ -64,7 +66,7 @@ Supported filters: `eventType`, `isDelivered` (`true`/`false`), and `httpStatus`
6466
}
6567
```
6668

67-
`status` summarizes the row as `"delivered"`, `"failed"` (all `maxAttempts` attempts exhausted), `"retrying"`, or `"pending"`. Failed deliveries retry automatically with backoff (1, 5, then 10 minutes) up to `maxAttempts` (3) before landing in the dead-letter state.
69+
`status` summarizes the row as `"delivered"`, `"failed"` (all `maxAttempts` attempts exhausted), `"retrying"`, or `"pending"`. Failed deliveries retry automatically with backoff (immediate, then +1 minute, then +5 minutes) for up to `maxAttempts` (3) attempts total before landing in the dead-letter state.
6870

6971
## Common errors
7072

‎docs/API/read-tag.api.mdx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ custom_edit_url: null
1717

1818
# Read Tag
1919

20-
The Read Tag endpoint lists the active tags in your organization, sorted alphabetically by `label` by default. Despite the singular name, it returns a paginated array, not a single tag; there is no dedicated "get tag by ID" endpoint.
20+
The Read Tag endpoint lists the active tags in your organization, sorted alphabetically by `label` by default. Despite the singular name, it returns a paginated array, not a single tag. To fetch one tag by its ID, use `GET /Tag/:id`, which returns a single tag object under `data.results` (404 if not found).
2121

2222
## When to use it
2323

@@ -67,6 +67,7 @@ curl "https://api.turbodocx.com/Tag?limit=25&offset=0&query=legal" \
6767
- [Create Tag](/docs/API/create-tag) to add a new tag
6868
- [Update Tag](/docs/API/update-tag) to rename an existing tag
6969
- [Delete Tags (by IDs)](/docs/API/delete-tags-by-i-ds) to remove tags in bulk
70+
- `GET /Tag/:id` to fetch a single tag by ID
7071

7172
<DisplayEndpoint method="GET" endpoint="/Tag"/>
7273
<QueryTable title="query" data="W3sia2V5IjoibGltaXQiLCJleGFtcGxlIjoiIn1d" />

‎docs/API/read-variables-folder.api.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ curl "https://api.turbodocx.com/Variable?isGlobal=true&limit=25&offset=0&showTag
3232
-H "Accept: application/json"
3333
```
3434

35-
Pass exactly one of `isGlobal=true` (your org-wide knowledge base) or `templateFolderId=<folder id>` (a specific folder); the two are mutually exclusive. `limit` defaults to `6`, `offset` to `0`, and `query` filters by name.
35+
Optionally pass `isGlobal=true` (your org-wide knowledge base) or `templateFolderId=<folder id>` (a specific folder) to scope the list; at most one may be set, and passing both is rejected. Omit both to list across your accessible scope. `limit` defaults to `6`, `offset` to `0`, and `query` filters by name.
3636

3737
## Example response
3838

‎docs/API/replay-webhook-delivery.api.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: replay-webhook-delivery
33
title: "Replay Webhook Delivery"
4-
description: "Manually retry one past delivery by its ID. Creates a new delivery row and immediately attempts redelivery to all configured URLs."
4+
description: "Manually retry one past delivery by its ID. Creates a new delivery row and immediately re-sends the event to the URL the original delivery targeted."
55
sidebar_label: "Replay Webhook Delivery"
66
hide_title: true
77
hide_table_of_contents: true
@@ -17,7 +17,7 @@ custom_edit_url: null
1717

1818
# Replay Webhook Delivery
1919

20-
The Replay Webhook Delivery endpoint manually retries a specific past delivery, identified by its `deliveryId`. It creates a brand-new delivery row for the attempt (the original row is left as-is) and immediately re-sends the event to the webhook's configured URL.
20+
The Replay Webhook Delivery endpoint manually retries a specific past delivery, identified by its `deliveryId`. It creates a brand-new delivery row for the attempt (the original row is left as-is) and immediately re-sends the event to the URL the original delivery was made to (not every URL configured on the webhook, if it has more than one).
2121

2222
## When to use it
2323

‎docs/API/test-webhook.api.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Both `eventType` and `payload` are optional; omit them to send a default sample
6161
}
6262
```
6363

64-
If a URL returns a non-2xx status or times out, its entry has `isDelivered: false`, `status: "retrying"` or `"failed"`, and the failure is counted in `summary.failed` with a message in `summary.errors`.
64+
If a URL returns a non-2xx status or times out, its entry has `isDelivered: false` and `status: "retrying"` (while attempts remain) or `"failed"` (once all attempts are exhausted), with details in `errorMessage`. `summary.failed`/`summary.errors` do not currently reflect HTTP-level failures; they only count a database error while creating the delivery record, so a URL that returns 4xx/5xx or times out through all attempts still increments `summary.successful` and leaves `summary.errors` empty. Inspect each `deliveries[]` entry's `isDelivered`, `status`, and `errorMessage` to detect a failing receiver rather than relying on `summary.failed`.
6565

6666
## Common errors
6767

‎docs/API/update-tag.api.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ custom_edit_url: null
1717

1818
# Update Tag
1919

20-
The Update Tag endpoint changes a tag's `label`. It is a `PUT`, but in practice `label` is the only field you can usefully send; the tag's other fields (`id`, `orgId`) are not accepted in the body.
20+
The Update Tag endpoint changes a tag's `label`. It is a `PUT`, but in practice `label` is the only field you should send. `orgId` is not an accepted body field and returns a validation error if sent. `id` is different: it isn't rejected by validation, and it isn't ignored either; the endpoint applies whatever body you send, so an `id` that differs from the `TagId` in the URL will overwrite the tag's actual `id` instead of being discarded. Omit `id` from the body and let the URL path segment identify the tag to update.
2121

2222
## When to use it
2323

‎docs/API/update-variable-by-id.api.mdx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ custom_edit_url: null
1717

1818
# Update Variable (by ID)
1919

20-
The Update Variable (by ID) endpoint replaces a knowledge-base or template-folder variable's content and metadata. Unlike [Edit Template Metadata](/docs/API/edit-template-metadata), this is a full replace, not a partial patch: `mimeType` and `text` are required on every call, along with either `isGlobal` or `templateFolderId`.
20+
The Update Variable (by ID) endpoint replaces a knowledge-base or template-folder variable's content and metadata. Unlike [Edit Template Metadata](/docs/API/edit-template-metadata), this is a full replace, not a partial patch: `mimeType` and `text` are required on every call. `isGlobal` and `templateFolderId` are both optional; at most one may be set.
2121

2222
## When to use it
2323

@@ -41,7 +41,7 @@ curl -X PUT "https://api.turbodocx.com/Variable/e4f5a6b7-8c9d-4e0f-a1b2-3c4d5e6f
4141
}'
4242
```
4343

44-
`{VariableId}` in the path is the `variableMapId` returned by [Read Variables (Folder)](/docs/API/read-variables-folder), not the underlying `Variable.id`. Send exactly one of `isGlobal: true` or `templateFolderId`; sending both is rejected. For an image variable, set `mimeType` to `"image"` and `text` to a base64 data string.
44+
`{VariableId}` in the path is the `variableMapId` returned by [Read Variables (Folder)](/docs/API/read-variables-folder), not the underlying `Variable.id`. Optionally send `isGlobal: true` or `templateFolderId`, but not both; sending both is rejected. For an image variable, set `mimeType` to `"image"` and `text` to a base64 data string.
4545

4646
## Example response
4747

@@ -67,8 +67,7 @@ On success the endpoint returns `200 OK` with the updated variable wrapped in a
6767
| Status | When | Response body |
6868
| ------ | ---- | ------------- |
6969
| 401 | Missing or invalid API key/token, or the organization cannot be resolved | Empty (status only) |
70-
| 403 | The key's role is not administrator, contributor, or user | Empty (status only) |
71-
| 423 | The template the variable belongs to is locked | `{ "error": "Resource is locked", "message", "data": { "locked": true, "lockedBy", "lockedOn" } }` |
70+
| 403 | The key's role is not administrator, contributor, or user. For `isGlobal: true` updates (as in the example above), only administrator and contributor are allowed; the `user` role is also rejected with `403`. | Empty (status only) |
7271
| 400 | `mimeType` or `text` is missing, or both `isGlobal` and `templateFolderId` are set | `{ "message", "type": "ValidationError", "data": { "errors": [...] } }` |
7372
| 409 | The variable was deleted or modified by someone else before this update landed | `{ "error", "data": { "explanation" } }` |
7473

0 commit comments

Comments
 (0)