Overview
A decision request asks named people on the team for a decision with a deadline. It has two shapes:
- Approval (
preset: approval): approve or reject. The first answer decides. Use it for a quote before it reaches the customer, a discount or a booking exception. The reviewer may correct editable values and the outgoing email before approving. - Job offer (
preset: assignment): accept or decline. A decline or silence moves the request to the next person; withescalate_to_adminsthe team's admins are asked last. Use it to offer an incident to the technicians of a department one at a time.
Totem alerts each person in the app, and through the team's alert plan by WhatsApp, call or email with a signed answer link. People who only receive alerts, such as outside technicians, answer from that link. Your integration never sees responder phone numbers or links.
Create an integration with the operations profile to authorize decisions:write and decisions:read; rotating an older key does not add them. Select the team with Totem-Team and use a new Idempotency-Key for each request you create.
Create a request
POST /v1/decision-requests accepts the request as an operation. One Idempotency-Key creates at most one request: retry with the same key and body after an uncertain answer. Wait for status: succeeded; the result is a decision_request_receipt with the opaque drq_ id, its state and its resolution.
- With
type_id, the type configured in Settings › Automations › Approvals and job offers decides who is asked, routing, deadline, alert plan and effects. A type that decides by policy, such as one that only asks whenm2 > 100, can already beresolvedin the receipt. - Without a type, set
preset,type_name,responders(adepartment_id, ormember_idsfromGET /v1/members),routingandexpires_hours. Withoutrespondersthe team's admins are asked. fieldsare the values the person sees, and may correct wheneditable.messageis the email Totem sends to the lead from the team's automation mailbox when the request is approved.metadataholds up to 20 of your own string values, such as your quote id. Totem returns them unchanged and never shows them to people.
Files travel inline in attachments, base64-encoded: PDF, PNG, JPEG, WEBP, plain text or CSV, up to five. The whole JSON body is limited to 128 KiB and base64 grows a file by a third, so in practice the files share about 90 KB before encoding. Send a larger document as a link in summary instead.
React to the outcome
When the request ends, Totem records decision_request.resolved for the integration that created it. Read it from GET /v1/events: resource_id is the drq_ id and status is the resolution, one of approved, rejected, accepted, unanswered, expired or cancelled. The n8n Events trigger reads the same feed.
Then call GET /v1/decision-requests/{id}. It returns who decided (decided_by: a member id, policy, system or integration), the deciding answer's comment and via, the final_fields and final_message when approved or accepted, what Totem did afterwards in effects, and your metadata. Only the integration that created a request can read it; any other request answers 404 resource_missing.
Cancel a request
POST /v1/decision-requests/{id}/cancel takes an empty JSON object and returns an operation. Totem withdraws the pending alerts and records decision_request.resolved with cancelled. Cancelling a request that already ended is safe; the receipt shows how it ended.
POST /
Accepts a decision request (an approval, or a job offered one person at a time) as a durable operation; the receipt carries its opaque drq_ id. Totem alerts the responders, moves on when they decline or stay silent, and emits decision_request.resolved to this integration when it ends. One Idempotency-Key creates at most one request; the type, responders and lead are checked again before it is created.
Headers
Totem-Teamstring Conditional ID prefixteam_…The team to read, as a
team_…id. Omit it when the key reads one team; it is required when the key reads several (400 team_required). When you send it, it must name a team the key reads: a malformed id gets400 invalid_request, and a team outside the key gets404 team_not_accessible, as does a request without it once the key reads no team at all.Idempotency-Keystring Required 1–255 chars Pattern^[\x21-\x7e]+$One unique visible-ASCII key per logical write; reuse exactly on retries and never retry outcome_unknown automatically.
Request body
Ask named people on the selected team for a decision with a deadline. Source and actor are set by the server; member, department and lead ids must belong to the selected team.
type_idstring Pattern^[a-z0-9][a-z0-9_-]{0,47}$A request type configured in Settings › Automations › Approvals and job offers. The type decides its kind, who is asked, routing, deadline, alert plan and effects; omit it to describe all of that in this request.
presetstringOnly without type_id: approval (approve or reject, the first answer decides) or assignment (accept or decline, a decline or silence moves on to the next person). Defaults to approval.
Possible valuesapprovalassignment
type_namestring 1–60 charsOnly without type_id: the label responders see, such as "Quote", up to 60 characters.
titlestring Required 1–200 charsWhat must be decided, up to 200 characters.
summarystring ≤ 4000 charsContext for the responder, up to 4,000 characters.
referencestring ≤ 80 charsYour short reference, such as a quote or incident number, up to 80 characters.
lead_idstring ID prefixlead_…A current lead of the selected team the decision is about. Its outcome note and the approved email use it; responders never see its contact details.
fieldsArray<object> ≤ 24 itemsUp to 24 values with unique keys.
keystring Required 1–64 charsStable key of the value, unique in this request, up to 64 characters without surrounding spaces. A type condition such as
m2 > 100reads it.labelstring Required 1–80 charsWhat the responder sees beside the value, up to 80 characters.
valuestring Required ≤ 2000 charsThe value as text, up to 2,000 characters.
kindstringHow the value is shown and validated when edited; defaults to text.
Possible valuestextlongtextnumbermoney
editablebooleanThe responder may correct this value before a positive answer; defaults to false.
requiredbooleanAn editable value the responder must fill before a positive answer; ignored unless editable.
messageobjectThe email Totem sends to the lead from the team's automation mailbox when the request is approved and its email effect is on.
subjectstring Required 1–300 charsEmail subject, up to 300 characters.
bodystring Required 1–20000 charsEmail body as plain text, up to 20,000 characters.
editablebooleanThe responder may rewrite subject and body before approving; defaults to true.
attach_filesbooleanAttach this request's files to that email; defaults to true.
attachmentsArray<object> ≤ 5 itemsUp to 5 files sent inline. The whole JSON body is limited to 128 KiB and base64 grows a file by a third, so in practice the files share about 90 KB before encoding.
namestring Required 1–120 charsFile name shown to the responder, up to 120 characters.
content_typestring RequiredPDF, PNG, JPEG, WEBP, plain text or CSV.
Possible valuesapplication/pdfimage/pngimage/jpegimage/webptext/plaintext/csv
content_base64string Required 4–131072 chars Pattern^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$The file, base64-encoded with padding.
respondersobjectWho is asked when the type lets each request choose, or there is no type. Without it, the team's admins are asked.
department_idstring 1–128 charsA notification department of the team (
generalis the call-transfer team); its people are asked in its order. Takes precedence over member_ids.member_idsArray<string> ID prefixmem_…1–30 itemsUp to 30 current members, asked in this order.
routingobjectOverrides of the type's routing, or the routing of a request without a type.
modestringone_by_one asks each responder in turn; everyone asks them all at once and the first answer counts.
Possible valuesone_by_oneeveryone
step_minutesinteger Range 1–10080Minutes each turn waits, 1 to 10080.
escalate_to_adminsbooleanAfter every responder passed, ask the team's admins once more.
rotatebooleanone_by_one with a type only: start after whoever accepted the last request of that type.
expires_hoursinteger Range 1–720The whole request ends as expired after this many hours, 1 to 720.
alert_plan_idstring Pattern^[A-Za-z0-9_-]{1,64}$A team alert plan (WhatsApp, call, email steps) used to reach responders beyond the app.
effectsobjectOverrides of what Totem does after the request ends.
note_on_leadbooleanWrite the outcome as a note on the lead.
email_on_approvalbooleanSend message to the lead when approved.
alert_when_unansweredbooleanAlert the team's admins in the app when nobody answered or the request expired.
metadataobjectUp to 20 of your own string values, returned unchanged by decision_requests.get. Keys use letters, digits, dot, dash and underscore; values up to 500 characters. Never put secrets or contact data here.
Returns
Returns an Operation object.
objectstringAlways operation.
idstring ID prefixop_…Opaque durable operation id.
statusstringDurable operation state; outcome_unknown must be reconciled before repeating the effect.
Possible valuesqueuedrunningsucceededfailedcancelledoutcome_unknown
endpointstringThe original endpoint executed by this operation.
Possible valuestasks.createtasks.completenotifications.createdecision_requests.createdecision_requests.cancelbookings.createbookings.cancelbookings.reschedulebookingPayments.sendLinkmessages.sendmessages.requestInfomessages.prepareReplycalls.startlibrary.sendcatalog.sendquotes.recordOutcomeassistants.run
created_atstring Formatdate-timeWhen this operation was accepted, in UTC.
updated_atstring Formatdate-timeWhen its current state was recorded, in UTC.
resultTaskReceipt | NotificationReceipt | DecisionRequestReceipt | BookingReceipt | BookingPaymentReceipt | MessageReceipt | RequestedInfoReceipt | FirstReplyReceipt | CallStartReceipt | QuoteOutcomeReceipt | AssistantRunReceipt | LibraryDeliveryReceipt | CatalogSendReceipt NullableMinimal public resource receipt after success, otherwise null.
errorobject NullableSafe failure information, or null.
codestringClosed failure code without provider text, task content or credentials.
Possible valuesauthorization_failedconfiguration_missinginput_expiredinvalid_inputresource_missingexecution_failedoutcome_unknown
Errors
- 400
idempotency_key_requiredIdempotency key required - 400
team_requiredTeam required - 403
team_state_restrictedTeam restricted - 403
sector_restrictedSector restricted - 404
team_not_accessibleTeam not accessible - 409
idempotency_key_reusedIdempotency key reused - 409
idempotency_in_progressWrite in progress - 409
outcome_unknownWrite outcome unknown - 409
capture_not_readyTeam data is still being prepared - 429
quota_exceededDaily quota exceeded
# Fictional fixtures: replace references and dates with current API values.
# Send consent or confirmation attestations only after the person confirms.
curl -X POST 'https://api.totemstudio.ai/v1/decision-requests' \
-H "Authorization: Bearer $TOTEM_API_KEY" \
-H "Totem-Team: $TOTEM_TEAM_ID" \
-H "Idempotency-Key: ${TOTEM_IDEMPOTENCY_KEY:?Set one unique key for this logical write}" \
-H "Content-Type: application/json" \
--data '{"preset": "approval", "type_name": "Quote", "title": "Approve the quote for 120 m²", "reference": "Q-1042", "lead_id": "lead_r72EfbRNUzuqORFJR0O8HxAwEXd93jGUTYMaMMXKSF0QbLS8CiUKJpEP34LFQG", "fields": [{"key":"total","label":"Total (EUR)","value":"2350","kind":"money","editable":true}], "expires_hours": 48, "metadata": {"quote_id":"Q-1042"}}'{
"object": "operation",
"id": "op_m3yGe1tkVy6hn3m9LH9m7e640wg0O",
"status": "queued",
"endpoint": "decision_requests.create",
"created_at": "2026-10-01T09:30:00.000Z",
"updated_at": "2026-10-01T09:30:00.000Z",
"result": null,
"error": null
}GET /
Returns a decision request this integration created in the selected team: its state, resolution, who decided and how, the final values and email when approved or accepted, what Totem did afterwards and your metadata. Requests created by people or by another integration answer 404 resource_missing. It never returns lead contact data, responder phone numbers or answer links.
Path parameters
idstring Required ID prefixdrq_…The decision request's public id.
Headers
Totem-Teamstring Conditional ID prefixteam_…The team to read, as a
team_…id. Omit it when the key reads one team; it is required when the key reads several (400 team_required). When you send it, it must name a team the key reads: a malformed id gets400 invalid_request, and a team outside the key gets404 team_not_accessible, as does a request without it once the key reads no team at all.
Returns
Returns a DecisionRequest object.
objectstringAlways decision_request.
idstring ID prefixdrq_…Opaque decision request id bound to its team and incarnation; never parse it.
type_idstring NullableThe request type, or null without one.
type_namestringThe label responders saw.
presetstringapproval or assignment.
Possible valuesapprovalassignment
titlestringWhat had to be decided.
referencestring NullableYour reference, or null.
statestringopen while people are being asked; resolved once it ended.
Possible valuesopenresolved
resolutionstring NullableHow it ended: approved, rejected, accepted, unanswered (everyone declined or stayed silent), expired or cancelled; null while open.
Possible valuesapprovedrejectedacceptedunansweredexpiredcancelled
created_atstring Formatdate-timeWhen the request was created, in UTC.
expires_atstring Formatdate-timeWhen the request ends as expired if nobody decided, in UTC.
resolved_atstring Nullable Formatdate-timeWhen it ended, in UTC; null while open.
assigneestring Nullable ID prefixmem_…Assignment only: the member who accepted the job (or whom the type's policy picked); otherwise null.
decided_bystring Nullable ID prefixmem_…Who ended it: the deciding member, policy (the type decided alone), system (deadlines, nobody left to ask) or integration (cancelled through the API); null while open.
Possible valuespolicysystemintegration
commentstring NullableThe deciding answer's comment, or null.
viastring NullableWhere the deciding answer came from: the app, the signed response link, an admin answering for the team, or the alert call; null when no person decided.
Possible valuesapplinkadmincall
final_fieldsobject NullableApproved or accepted only: every field key with its final value, including the responder's corrections; otherwise null.
final_messageobject NullableApproved or accepted only, with a message: the email as approved; otherwise null.
subjectstringFinal email subject.
bodystringFinal email body.
effectsobjectWhat Totem did after the request ended.
lead_notestringThe outcome note on the lead.
Possible valuespendingdoneskippedneeds_review
emailstringThe approved email to the lead; done means sent, needs_review means a person must send it.
Possible valuespendingdoneskippedneeds_review
email_review_reasonstring Nullable Pattern^[a-z0-9_]{1,64}$Why the email needs review, such as email_missing_address or email_opted_out; otherwise null.
metadataobjectThe metadata this integration sent, unchanged.
Errors
- 400
team_requiredTeam required - 403
team_state_restrictedTeam restricted - 403
sector_restrictedSector restricted - 404
resource_missingResource not found - 404
team_not_accessibleTeam not accessible - 409
capture_not_readyTeam data is still being prepared
curl 'https://api.totemstudio.ai/v1/decision-requests/drq_m423Xy70UYKA7qToV8ptXW80qS9cm' \
-H "Authorization: Bearer $TOTEM_API_KEY" \
-H "Totem-Team: $TOTEM_TEAM_ID"{
"object": "decision_request",
"id": "drq_m423Xy70UYKA7qToV8ptXW80qS9cm",
"type_id": "quote",
"type_name": "Quote",
"preset": "approval",
"title": "Approve the lawn quote for 120 m²",
"reference": "Q-1042",
"state": "resolved",
"resolution": "approved",
"created_at": "2026-10-01T09:30:00.000Z",
"expires_at": "2026-10-08T09:30:00.000Z",
"resolved_at": "2026-10-01T10:05:00.000Z",
"assignee": null,
"decided_by": "mem_h548E7UiYhutHhucVrQCzkM0eaea0",
"comment": "Rounded the price down.",
"via": "app",
"final_fields": {
"m2": "120",
"total": "2350"
},
"final_message": {
"subject": "Your lawn quote",
"body": "Hello, here is your quote for 120 m²."
},
"effects": {
"lead_note": "done",
"email": "done",
"email_review_reason": null
},
"metadata": {
"quote_id": "Q-1042"
}
}POST /
Accepts cancellation of an open decision request this integration created, as a durable operation. Its pending alerts are withdrawn and decision_request.resolved follows with cancelled. Cancelling a request that already ended is safe and changes nothing; the receipt shows how it ended.
Path parameters
idstring Required ID prefixdrq_…The decision request's public id.
Headers
Totem-Teamstring Conditional ID prefixteam_…The team to read, as a
team_…id. Omit it when the key reads one team; it is required when the key reads several (400 team_required). When you send it, it must name a team the key reads: a malformed id gets400 invalid_request, and a team outside the key gets404 team_not_accessible, as does a request without it once the key reads no team at all.Idempotency-Keystring Required 1–255 chars Pattern^[\x21-\x7e]+$One unique visible-ASCII key per logical write; reuse exactly on retries and never retry outcome_unknown automatically.
Returns
Returns an Operation object.
objectstringAlways operation.
idstring ID prefixop_…Opaque durable operation id.
statusstringDurable operation state; outcome_unknown must be reconciled before repeating the effect.
Possible valuesqueuedrunningsucceededfailedcancelledoutcome_unknown
endpointstringThe original endpoint executed by this operation.
Possible valuestasks.createtasks.completenotifications.createdecision_requests.createdecision_requests.cancelbookings.createbookings.cancelbookings.reschedulebookingPayments.sendLinkmessages.sendmessages.requestInfomessages.prepareReplycalls.startlibrary.sendcatalog.sendquotes.recordOutcomeassistants.run
created_atstring Formatdate-timeWhen this operation was accepted, in UTC.
updated_atstring Formatdate-timeWhen its current state was recorded, in UTC.
resultTaskReceipt | NotificationReceipt | DecisionRequestReceipt | BookingReceipt | BookingPaymentReceipt | MessageReceipt | RequestedInfoReceipt | FirstReplyReceipt | CallStartReceipt | QuoteOutcomeReceipt | AssistantRunReceipt | LibraryDeliveryReceipt | CatalogSendReceipt NullableMinimal public resource receipt after success, otherwise null.
errorobject NullableSafe failure information, or null.
codestringClosed failure code without provider text, task content or credentials.
Possible valuesauthorization_failedconfiguration_missinginput_expiredinvalid_inputresource_missingexecution_failedoutcome_unknown
Errors
- 400
idempotency_key_requiredIdempotency key required - 400
team_requiredTeam required - 403
team_state_restrictedTeam restricted - 403
sector_restrictedSector restricted - 404
resource_missingResource not found - 404
team_not_accessibleTeam not accessible - 409
idempotency_key_reusedIdempotency key reused - 409
idempotency_in_progressWrite in progress - 409
outcome_unknownWrite outcome unknown - 409
capture_not_readyTeam data is still being prepared - 429
quota_exceededDaily quota exceeded
# Fictional fixtures: replace references and dates with current API values.
# Send consent or confirmation attestations only after the person confirms.
curl -X POST 'https://api.totemstudio.ai/v1/decision-requests/drq_m423Xy70UYKA7qToV8ptXW80qS9cm/cancel' \
-H "Authorization: Bearer $TOTEM_API_KEY" \
-H "Totem-Team: $TOTEM_TEAM_ID" \
-H "Idempotency-Key: ${TOTEM_IDEMPOTENCY_KEY:?Set one unique key for this logical write}" \
-H "Content-Type: application/json" \
--data '{}'{
"object": "operation",
"id": "op_m3yGe1tkVy6hn3m9LH9m7e640wg0O",
"status": "queued",
"endpoint": "decision_requests.cancel",
"created_at": "2026-10-01T09:30:00.000Z",
"updated_at": "2026-10-01T09:30:00.000Z",
"result": null,
"error": null
}A decision request this integration created, without lead contact data, responder phone numbers or answer links.
Attributes
objectstringAlways decision_request.
idstring ID prefixdrq_…Opaque decision request id bound to its team and incarnation; never parse it.
type_idstring NullableThe request type, or null without one.
type_namestringThe label responders saw.
presetstringapproval or assignment.
Possible valuesapprovalassignment
titlestringWhat had to be decided.
referencestring NullableYour reference, or null.
statestringopen while people are being asked; resolved once it ended.
Possible valuesopenresolved
resolutionstring NullableHow it ended: approved, rejected, accepted, unanswered (everyone declined or stayed silent), expired or cancelled; null while open.
Possible valuesapprovedrejectedacceptedunansweredexpiredcancelled
created_atstring Formatdate-timeWhen the request was created, in UTC.
expires_atstring Formatdate-timeWhen the request ends as expired if nobody decided, in UTC.
resolved_atstring Nullable Formatdate-timeWhen it ended, in UTC; null while open.
assigneestring Nullable ID prefixmem_…Assignment only: the member who accepted the job (or whom the type's policy picked); otherwise null.
decided_bystring Nullable ID prefixmem_…Who ended it: the deciding member, policy (the type decided alone), system (deadlines, nobody left to ask) or integration (cancelled through the API); null while open.
Possible valuespolicysystemintegration
commentstring NullableThe deciding answer's comment, or null.
viastring NullableWhere the deciding answer came from: the app, the signed response link, an admin answering for the team, or the alert call; null when no person decided.
Possible valuesapplinkadmincall
final_fieldsobject NullableApproved or accepted only: every field key with its final value, including the responder's corrections; otherwise null.
final_messageobject NullableApproved or accepted only, with a message: the email as approved; otherwise null.
subjectstringFinal email subject.
bodystringFinal email body.
effectsobjectWhat Totem did after the request ended.
lead_notestringThe outcome note on the lead.
Possible valuespendingdoneskippedneeds_review
emailstringThe approved email to the lead; done means sent, needs_review means a person must send it.
Possible valuespendingdoneskippedneeds_review
email_review_reasonstring Nullable Pattern^[a-z0-9_]{1,64}$Why the email needs review, such as email_missing_address or email_opted_out; otherwise null.
metadataobjectThe metadata this integration sent, unchanged.
{
"object": "decision_request",
"id": "drq_m423Xy70UYKA7qToV8ptXW80qS9cm",
"type_id": "quote",
"type_name": "Quote",
"preset": "approval",
"title": "Approve the lawn quote for 120 m²",
"reference": "Q-1042",
"state": "resolved",
"resolution": "approved",
"created_at": "2026-10-01T09:30:00.000Z",
"expires_at": "2026-10-08T09:30:00.000Z",
"resolved_at": "2026-10-01T10:05:00.000Z",
"assignee": null,
"decided_by": "mem_h548E7UiYhutHhucVrQCzkM0eaea0",
"comment": "Rounded the price down.",
"via": "app",
"final_fields": {
"m2": "120",
"total": "2350"
},
"final_message": {
"subject": "Your lawn quote",
"body": "Hello, here is your quote for 120 m²."
},
"effects": {
"lead_note": "done",
"email": "done",
"email_review_reason": null
},
"metadata": {
"quote_id": "Q-1042"
}
}Minimal decision request receipt, as the operation recorded it. A type that decides by policy is already resolved here.
Attributes
objectstringAlways decision_request_receipt.
idstring ID prefixdrq_…Opaque decision request id bound to its team and incarnation; never parse it.
statestringopen while people are being asked; resolved once it ended.
Possible valuesopenresolved
resolutionstring NullableHow it ended: approved, rejected, accepted, unanswered (everyone declined or stayed silent), expired or cancelled; null while open.
Possible valuesapprovedrejectedacceptedunansweredexpiredcancelled
{
"object": "decision_request_receipt",
"id": "drq_m423Xy70UYKA7qToV8ptXW80qS9cm",
"state": "open",
"resolution": null
}