Update an output
Corrects the bookkeeping on an output already in Tracira: the metadata attached to it, the shared IDs that file it under a conversation or a customer, and the label on each stored file.
- Use it when context arrives after the output did: a CRM ticket number, a category your classifier decided later, the role a file turned out to play.
- The record itself is immutable. Input, output, verdict and human decision cannot be edited here - they are what the manager judged.
- Metadata merges by default: only the keys you send change, and a key sent empty is removed. Pass
metadataMode: "replace"to store exactly what you send. - Editing metadata returns
409while the output is still being evaluated, because the evaluation rewrites that column when it lands. Labels and context IDs can be set at any time. - Changing metadata does not re-run the rules: a verdict belongs to the output that was judged.
https://www.tracira.com/api/logs/{id}AuthorizationBearer <token>Workspace API token, from the Integrations page.
id*stringapplication/json- body
Every field is optional, but the request must change something. Input, output, verdict and decision are never editable: they are the record that was judged.
metadata?Key-value pairs to store on the output. In the default merge mode only the keys you send change.
A key whose value is a blank string is skipped, exactly as at ingest, where an empty value is dropped rather than stored. That way a row mapped from a sometimes-blank source (a customer's middle name) can never destroy what is already stored. 0 and false are values and are kept.
Deleting is explicit. Set the key to null (RFC 7386 merge-patch semantics), or name it in metadataRemove. Sending metadata: null changes nothing.
metadataJson?|A whole JSON object folded into metadata, for values that are themselves structured: an invoice with its line items, a scoring breakdown, an address. metadata has always accepted structured values, but the integration platforms build it from a key-value list whose values are strings, so JSON typed into a row arrives as the text of an object. This field carries it intact. Accepts the object or its JSON text. When a key appears in both, the metadata row wins.
metadataRemove?array<>Names of metadata keys to delete. The form-friendly spelling of null: a key-value builder in an integration platform can only emit strings, and may drop an empty one before it is ever sent, so deleting needs a spelling that cannot be confused with "this field was empty". Unknown names are ignored.
items <= 100metadataMode?stringmerge (default) applies the keys you send on top of what is stored. replace stores exactly what you send and drops everything else.
Sending no metadata alongside the mode is meaningful, not an error: with replace it means the stored metadata is exactly what you sent, i.e. none, so it is cleared (the same as metadata: {}); with merge there is nothing to merge, so nothing changes. That keeps the outcome identical whether your integration platform serializes an empty key-value list as {} or omits it.
"merge""merge""replace"attachments?array<>Files on this output to relabel.
items <= 40sessionId?stringBackfill the session/conversation ID. All the ingest aliases work here too (conversationId, threadId, chatId, snake_case included), top-level or inside metadata.
subjectId?stringBackfill the subject ID - the customer, ticket, account or record the output is about. Aliases: customerId, recordId, ticketId, accountId.
actorId?stringBackfill the actor ID - who triggered the execution. Aliases: endUserId, userId, agentId.
actorName?stringBackfill the actor's readable name. Aliases: userName, endUserName, agentName.
Output updated.
application/json- response
ok*booleanid*stringmetadata?|The metadata now stored on the output, after the patch.
sessionId?string|nullsubjectId?string|nullactorId?string|nullactorName?|The actor's readable name, when one was sent.
attachments?array<>Every file on the output, with labels as they now stand.
curl -X PATCH 'https://www.tracira.com/api/logs/b7d1c9e4-3f2a-4d5b-9c81-0a6e7f2b4d13' \ -H 'Content-Type: application/json' \ -d '{ "metadata": { "ticket_id": "1042", "crm_stage": "escalated" }}'{ "ok": true, "id": "string", "metadata": {}, "sessionId": "string", "subjectId": "string", "actorId": "string", "actorName": "string", "attachments": [ { "role": "input", "type": "image", "filename": "invoice-april.pdf", "contentType": "application/pdf", "key": "1f4a8c60-92d7-4b3e-8a51-c27e6d90f3b2/log-42/0-ab12cd34-invoice-april.pdf", "url": "https://www.tracira.com/api/media/1f4a8c60-92d7-4b3e-8a51-c27e6d90f3b2/log-42/0-ab12cd34-invoice-april.pdf", "label": "Before photo" } ]}