Review and send a Library entry
Use POST /v1/library/list for bounded discovery, then POST /v1/library/get to review the selected entry. Keep opaque references unchanged and send the reviewed revision with POST /v1/library/send. A changed entry must be reviewed again. Sending uses the current conversation and channel policy; a read permission alone does not permit sending.
Delivery is asynchronous. A partial or uncertain result requires reconciliation before another send. For web chat, a prepared response is retained for rendering instead of claiming provider delivery. Read that response with POST /v1/library/prepared, preserve message order and resolve its exact attachment references with POST /v1/attachments/resolve only when separately authorized. References are temporary selections bound to the integration and team; they are not permanent asset identifiers.
POST /
Reads a bounded page of current permitted library content with an independent library-content grant. References bind the current source revision; raw file locations, provider identifiers and internal access lists stay private. Hosted discovery preserves the assistant library selection rules.
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.
Request body
querystring ≤ 500 charsOptional discovery query; hosted assistant discovery retains its canonical selection rules.
typestringRestrict discovery to this entry type.
Possible valuesmessagemediasequence
languagestring ≤ 35 charsOptional language filter.
cursorstring 40–16384 chars Pattern^tcnt1\.[A-Za-z0-9_-]+$Current server-issued opaque content reference; never parse or modify it.
limitinteger Range 1–50Maximum entries on this page, between one and fifty.
Returns
Returns a LibraryEntryList object.
objectstringAlways library_entry_list.
Current permitted entries on this page.
next_cursorstring Nullable 40–16384 chars Pattern^tcnt1\.[A-Za-z0-9_-]+$Opaque next-page cursor, or null after the last page.
coveragestringWhether more discovery pages remain or this result is complete.
Possible valuespagecomplete
totalinteger Nullable Range ≥ 0Total entries when established by the bounded discovery, otherwise null.
matched_in_pageinteger Range ≥ 0Number of entries matched within this returned page.
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
# 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/library/list' \
-H "Authorization: Bearer $TOTEM_API_KEY" \
-H "Totem-Team: $TOTEM_TEAM_ID" \
-H "Content-Type: application/json" \
--data '{}'{
"object": "library_entry_list",
"data": [
{
"object": "library_entry",
"reference": "tcnt1.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"name": "Example service guide",
"description": "Fictitious public example",
"type": "message",
"revision": 1,
"part_count": 1,
"file_count": 0,
"preview": "The first visit includes an initial assessment.",
"language": "en",
"parts": [
{
"kind": "message",
"text": "The first visit includes an initial assessment.",
"file_name": null,
"media_type": null
}
]
}
],
"next_cursor": null,
"coverage": "complete",
"total": 1,
"matched_in_page": 1
}POST /
Reads authorized text and file metadata for one current library reference. Current grant, source incarnation, revision and hosted assistant access are checked before content is read. It returns no raw media download location.
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.
Request body
referencestring Required 40–16384 chars Pattern^tcnt1\.[A-Za-z0-9_-]+$Current server-issued opaque content reference; never parse or modify it.
Returns
Returns a LibraryEntry object.
objectstringAlways library_entry.
referencestring 40–16384 chars Pattern^tcnt1\.[A-Za-z0-9_-]+$Current server-issued opaque content reference; never parse or modify it.
namestring ≤ 2000 charsCurrent entry display name.
descriptionstring ≤ 20000 charsCurrent authored entry description.
typestringA text message, media entry or ordered sequence.
Possible valuesmessagemediasequence
revisioninteger Range ≥ 0Current authored revision; sending requires the revision you reviewed.
part_countinteger Range ≥ 0Number of sendable parts in this current entry.
file_countinteger Range ≥ 0Number of files in this current entry.
previewstring ≤ 1200 charsBounded authorized content preview.
languagestring Nullable ≤ 100 charsConfigured entry language, or null.
partsArray<object> May be absent ≤ 25 itemsOrdered authorized parts, included by the detail read.
kindstringText or media part of this entry.
Possible valuesmessagemedia
textstring ≤ 100000 charsAuthored message or media caption text.
file_namestring Nullable ≤ 2000 charsStored file name when available, otherwise null.
media_typestring Nullable ≤ 100 charsStored media type when available, otherwise null.
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
# 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/library/get' \
-H "Authorization: Bearer $TOTEM_API_KEY" \
-H "Totem-Team: $TOTEM_TEAM_ID" \
-H "Content-Type: application/json" \
--data '{"reference": "tcnt1.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}'{
"object": "library_entry",
"reference": "tcnt1.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"name": "Example service guide",
"description": "Fictitious public example",
"type": "message",
"revision": 1,
"part_count": 1,
"file_count": 0,
"preview": "The first visit includes an initial assessment.",
"language": "en",
"parts": [
{
"kind": "message",
"text": "The first visit includes an initial assessment.",
"file_name": null,
"media_type": null
}
]
}POST /
Resolves a current owned prepared-response reference to ordered persisted text and media descriptors. It rechecks the current source, revision and content permission; media locations remain separate opaque attachment references. Prepared content is not a provider delivery claim.
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.
Request body
referencestring Required 40–16384 chars Pattern^tcnt1\.[A-Za-z0-9_-]+$Current server-issued opaque content reference; never parse or modify it.
Returns
Returns a LibraryPreparedResponse object.
objectstringAlways library_prepared_response.
versionnumberPrepared visitor response format version, always one.
Value1
messagesArray<object> ≤ 25 itemsOrdered persisted visitor messages; preserve this order when rendering.
idstring 1–300 charsStable opaque prepared message identity for visitor rendering.
rolestringAlways assistant.
kindstringPrepared visitor message type.
Possible valuestextimagevideoaudiodocument
contentstring May be absent ≤ 100000 charsPrepared text or caption when present.
timestampstring Formatdate-timePersisted message time in UTC.
mediaobject May be absentFile metadata and an opaque attachment reference; resolve it with its separate permission.
attachment_referencestring 40–16384 chars Pattern^tcnt1\.[A-Za-z0-9_-]+$Current server-issued opaque content reference; never parse or modify it.
mime_typestring ≤ 200 charsCanonical file MIME type.
file_namestring Nullable ≤ 2000 charsCanonical file name when known, otherwise null.
file_sizeinteger Nullable Range ≥ 0Known file size in bytes, otherwise null.
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
# 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/library/prepared' \
-H "Authorization: Bearer $TOTEM_API_KEY" \
-H "Totem-Team: $TOTEM_TEAM_ID" \
-H "Content-Type: application/json" \
--data '{"reference": "tcnt1.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}'{
"object": "library_prepared_response",
"version": 1,
"messages": [
{
"id": "prepared_example",
"role": "assistant",
"kind": "text",
"content": "The first visit includes an initial assessment.",
"timestamp": "2026-10-01T09:30:00.000Z"
}
]
}POST /
Starts a durable delivery of the current reviewed library revision to an owned retained conversation. Existing per-part progress, channel policy and uncertainty guards apply. Prepared web chat content is distinct from provider delivery; partial or uncertain delivery is never silently repeated.
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
referencestring Required 40–16384 chars Pattern^tcnt1\.[A-Za-z0-9_-]+$Current server-issued opaque content reference; never parse or modify it.
expected_revisioninteger Required Range ≥ 0Current authored revision; sending requires the revision you reviewed.
conversation_idstring ID prefixconv_…Current retained conversation. Required for a tenant key; hosted execution derives its exact source when omitted.
captionstring ≤ 4000 charsOptional caption where the canonical entry and channel permit one.
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 - 412
version_conflictLead version conflict - 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/library/send' \
-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 '{"reference": "tcnt1.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "expected_revision": 1, "conversation_id": "conv_m3GhGjRHmFbww1g10oqOp7j3gWqPJ"}'{
"object": "operation",
"id": "op_m3yGe1tkVy6hn3m9LH9m7e640wg0O",
"status": "queued",
"endpoint": "library.send",
"created_at": "2026-10-01T09:30:00.000Z",
"updated_at": "2026-10-01T09:30:00.000Z",
"result": null,
"error": null
}POST /
Intentionally discloses the current canonical application-bucket file URL and bounded file metadata under an independent attachment-content grant. Only the exact retained owned library file from a prepared response may resolve; provider, foreign-bucket and caller-supplied URLs are refused. Current source and permission are checked on each resolution.
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.
Request body
referencestring Required 40–16384 chars Pattern^tcnt1\.[A-Za-z0-9_-]+$Current server-issued opaque content reference; never parse or modify it.
Returns
Returns an Attachment object.
objectstringAlways attachment.
urlstring Formaturi≤ 8192 charsIntentionally disclosed canonical URL of the exact owned EU application-bucket file.
mime_typestring ≤ 200 charsCanonical file MIME type.
file_namestring Nullable ≤ 2000 charsCanonical file name when known, otherwise null.
file_sizeinteger Nullable Range ≥ 0Known file size in bytes, otherwise null.
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
# 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/attachments/resolve' \
-H "Authorization: Bearer $TOTEM_API_KEY" \
-H "Totem-Team: $TOTEM_TEAM_ID" \
-H "Content-Type: application/json" \
--data '{"reference": "tcnt1.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}'{
"object": "attachment",
"url": "https://storage.googleapis.com/totem-402908-eu/teams/example/media/example/guide.pdf",
"mime_type": "application/pdf",
"file_name": "guide.pdf",
"file_size": 100
}Attributes
objectstringAlways library_entry.
referencestring 40–16384 chars Pattern^tcnt1\.[A-Za-z0-9_-]+$Current server-issued opaque content reference; never parse or modify it.
namestring ≤ 2000 charsCurrent entry display name.
descriptionstring ≤ 20000 charsCurrent authored entry description.
typestringA text message, media entry or ordered sequence.
Possible valuesmessagemediasequence
revisioninteger Range ≥ 0Current authored revision; sending requires the revision you reviewed.
part_countinteger Range ≥ 0Number of sendable parts in this current entry.
file_countinteger Range ≥ 0Number of files in this current entry.
previewstring ≤ 1200 charsBounded authorized content preview.
languagestring Nullable ≤ 100 charsConfigured entry language, or null.
partsArray<object> May be absent ≤ 25 itemsOrdered authorized parts, included by the detail read.
kindstringText or media part of this entry.
Possible valuesmessagemedia
textstring ≤ 100000 charsAuthored message or media caption text.
file_namestring Nullable ≤ 2000 charsStored file name when available, otherwise null.
media_typestring Nullable ≤ 100 charsStored media type when available, otherwise null.
{
"object": "library_entry",
"reference": "tcnt1.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"name": "Example service guide",
"description": "Fictitious public example",
"type": "message",
"revision": 1,
"part_count": 1,
"file_count": 0,
"preview": "The first visit includes an initial assessment.",
"language": "en",
"parts": [
{
"kind": "message",
"text": "The first visit includes an initial assessment.",
"file_name": null,
"media_type": null
}
]
}Attributes
objectstringAlways library_entry_list.
Current permitted entries on this page.
next_cursorstring Nullable 40–16384 chars Pattern^tcnt1\.[A-Za-z0-9_-]+$Opaque next-page cursor, or null after the last page.
coveragestringWhether more discovery pages remain or this result is complete.
Possible valuespagecomplete
totalinteger Nullable Range ≥ 0Total entries when established by the bounded discovery, otherwise null.
matched_in_pageinteger Range ≥ 0Number of entries matched within this returned page.
{
"object": "library_entry_list",
"data": [
{
"object": "library_entry",
"reference": "tcnt1.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"name": "Example service guide",
"description": "Fictitious public example",
"type": "message",
"revision": 1,
"part_count": 1,
"file_count": 0,
"preview": "The first visit includes an initial assessment.",
"language": "en",
"parts": [
{
"kind": "message",
"text": "The first visit includes an initial assessment.",
"file_name": null,
"media_type": null
}
]
}
],
"next_cursor": null,
"coverage": "complete",
"total": 1,
"matched_in_page": 1
}Attributes
objectstringAlways library_delivery_receipt.
statusstringCurrent durable delivery state. Reconcile partial or uncertain delivery before repeating it.
Possible valuessentpartialuncertainfailedheldin_progressprepared
sent_partsinteger Range ≥ 0Parts with retained provider acceptance; prepared web chat parts are separate.
total_partsinteger Range ≥ 0Total parts of this reviewed delivery.
preparedbooleanTrue only for a persisted web chat response prepared for the caller to render.
prepared_referencestring Nullable 40–16384 chars Pattern^tcnt1\.[A-Za-z0-9_-]+$Current source-bound prepared response reference, or null for other delivery states.
reasonstringClosed delivery disposition without private provider errors.
Possible valuesnonealready_sentresource_changedconversation_changedsession_closeddelivery_refusedprovider_outcome_unknowncontent_erasednot_prepared
{
"object": "library_delivery_receipt",
"status": "prepared",
"sent_parts": 0,
"total_parts": 1,
"prepared": true,
"prepared_reference": "tcnt1.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"reason": "none"
}Attributes
objectstringAlways library_prepared_response.
versionnumberPrepared visitor response format version, always one.
Value1
messagesArray<object> ≤ 25 itemsOrdered persisted visitor messages; preserve this order when rendering.
idstring 1–300 charsStable opaque prepared message identity for visitor rendering.
rolestringAlways assistant.
kindstringPrepared visitor message type.
Possible valuestextimagevideoaudiodocument
contentstring May be absent ≤ 100000 charsPrepared text or caption when present.
timestampstring Formatdate-timePersisted message time in UTC.
mediaobject May be absentFile metadata and an opaque attachment reference; resolve it with its separate permission.
attachment_referencestring 40–16384 chars Pattern^tcnt1\.[A-Za-z0-9_-]+$Current server-issued opaque content reference; never parse or modify it.
mime_typestring ≤ 200 charsCanonical file MIME type.
file_namestring Nullable ≤ 2000 charsCanonical file name when known, otherwise null.
file_sizeinteger Nullable Range ≥ 0Known file size in bytes, otherwise null.
{
"object": "library_prepared_response",
"version": 1,
"messages": [
{
"id": "prepared_example",
"role": "assistant",
"kind": "text",
"content": "The first visit includes an initial assessment.",
"timestamp": "2026-10-01T09:30:00.000Z"
}
]
}Attributes
objectstringAlways attachment.
urlstring Formaturi≤ 8192 charsIntentionally disclosed canonical URL of the exact owned EU application-bucket file.
mime_typestring ≤ 200 charsCanonical file MIME type.
file_namestring Nullable ≤ 2000 charsCanonical file name when known, otherwise null.
file_sizeinteger Nullable Range ≥ 0Known file size in bytes, otherwise null.
{
"object": "attachment",
"url": "https://storage.googleapis.com/totem-402908-eu/teams/example/media/example/guide.pdf",
"mime_type": "application/pdf",
"file_name": "guide.pdf",
"file_size": 100
}