Skip to main content

Update Variable (by ID)

The Update Variable (by ID) endpoint replaces a knowledge-base or template-folder variable's content and metadata. Unlike 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.

When to use it​

Use this endpoint to edit a reusable variable you found with Read Variables (Folder), for example correcting its text, changing its name, or replacing its tag list.

Example request​

curl -X PUT "https://api.turbodocx.com/Variable/e4f5a6b7-8c9d-4e0f-a1b2-3c4d5e6f7a8b" \
-H "Authorization: Bearer $TURBODOCX_API_KEY" \
-H "x-rapiddocx-org-id: $TURBODOCX_ORG_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "Company Address",
"placeholder": "{CompanyAddress}",
"mimeType": "text",
"text": "123 Main St, Suite 400, Austin, TX 78701",
"allowRichTextInjection": true,
"isGlobal": true,
"tags": []
}'

{VariableId} in the path is the variableMapId returned by 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.

Example response​

On success the endpoint returns 200 OK with the updated variable wrapped in a variable key (not the data envelope most other TurboDocx endpoints use):

{
"variable": {
"id": "e4f5a6b7-8c9d-4e0f-a1b2-3c4d5e6f7a8b",
"name": "Company Address",
"placeholder": "{CompanyAddress}",
"mimeType": "text",
"text": "123 Main St, Suite 400, Austin, TX 78701",
"isGlobal": true,
"templateFolderId": null,
"updatedOn": "2026-05-02T09:00:00.000Z"
}
}

Common errors​

StatusWhenResponse body
401Missing or invalid API key/token, or the organization cannot be resolvedEmpty (status only)
403The 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)
400mimeType or text is missing, or both isGlobal and templateFolderId are set{ "message", "type": "ValidationError", "data": { "errors": [...] } }
409The variable was deleted or modified by someone else before this update landed{ "error", "data": { "explanation" } }