{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/api-reference/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["api-container","endpoint"]},"redocly_category":"API Reference","searchWeight":120,"type":"markdown"},"seo":{"title":"Shared Thread Tool Approval","description":"Complete API reference and documentation for Freddy AI-powered backend system by Aitronos","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"shared-thread-tool-approval","__idx":0},"children":["Shared Thread Tool Approval"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Approve or deny a tool call (or a compose-email card) that is waiting for confirmation on a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["live-shared"]}," thread you ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["joined"]}," — the slug-scoped twin of the owner tool-approval endpoint, for a joiner co-working on someone else's thread."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When an assistant parks a tool that needs confirmation, it emits a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tool.approval_required"]}," event on the live stream. A joiner co-working live can submit the decision through this endpoint. The decision releases the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["same parked turn"]}," the owner's approval would — both the owner route and this slug-scoped route key on the same underlying thread — so whichever participant confirms first unblocks the run."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Authorized by the joiner's ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["live"]},"-share grant on the slug. A ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["view"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fork"]}," slug returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403"]},"; an unknown or unauthorized link returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["404"]},"; a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tool_call_id"]}," with no matching pending approval returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["404"]},"."]},{"$$mdtype":"Tag","name":"ApiContainer","attributes":{},"children":[{"$$mdtype":"Tag","name":"Endpoint","attributes":{"method":"POST","path":"https://api.aitronos.com/v1/shared-threads/{slug}/tool-approval"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"authentication","__idx":1},"children":["Authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Requires ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["user"]}," authentication (Bearer token)."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"path-parameters","__idx":2},"children":["Path Parameters"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["slug"]}]}," string ",{"$$mdtype":"Tag","name":"em","attributes":{"style":{"color":"#ef4444 !important","fontWeight":"600 !important","fontStyle":"normal !important"}},"children":["required"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The share-link slug, from the share URL. The link must be a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["live"]}," link."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"body-parameters","__idx":3},"children":["Body Parameters"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tool_call_id"]}]}," string ",{"$$mdtype":"Tag","name":"em","attributes":{"style":{"color":"#ef4444 !important","fontWeight":"600 !important","fontStyle":"normal !important"}},"children":["required"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tool_call_id"]}," from the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tool.approval_required"]}," stream event."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["approved"]}]}," boolean ",{"$$mdtype":"Tag","name":"em","attributes":{"style":{"color":"#ef4444 !important","fontWeight":"600 !important","fontStyle":"normal !important"}},"children":["required"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," to approve, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," to deny."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["arguments"]}]}," object ",{"$$mdtype":"Tag","name":"em","attributes":{"style":{"color":"#9ca3af !important","fontWeight":"500 !important","fontStyle":"normal !important"}},"children":["optional"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Edited payload, present only when approving an edit-and-confirm card (e.g. a compose_email Send): ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["selected_option_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["body"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["is_html"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subject"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["from_identity_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["to"]},"/",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cc"]},"/",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bcc"]},". Omitted for a plain approval."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["retry"]}]}," boolean ",{"$$mdtype":"Tag","name":"em","attributes":{"style":{"color":"#9ca3af !important","fontWeight":"500 !important","fontStyle":"normal !important"}},"children":["optional"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set (with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["approved: true"]},") to explicitly re-send a compose card whose previous send failed. Defaults to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["batch"]}]}," object ",{"$$mdtype":"Tag","name":"em","attributes":{"style":{"color":"#9ca3af !important","fontWeight":"500 !important","fontStyle":"normal !important"}},"children":["optional"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Batch-level payload for a compose_email_batch card: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["action"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["send_all"]}," | ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["send_selected"]}," | ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["discard_all"]},"), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["selected_email_ids"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["per_email_overrides"]},". Mutually exclusive with single-email ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["arguments"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"returns","__idx":4},"children":["Returns"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["tool_call_id"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}," — the tool call that was approved/denied."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["approved"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["boolean"]}," — the decision recorded."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["status"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}," — processing status (e.g. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["decision_recorded"]},", or the compose send outcome)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["version"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["integer | null"]}," — the compose-state version AFTER this decision resolved, when known. Every send attempt advances the version server-side (a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["failed"]}," send too), so adopt it for your next compose-state ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PATCH"]}," instead of reusing the pre-send one (which would return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["409 VERSION_CONFLICT"]},"). Populated on the offline compose path (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sent"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["failed"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["denied"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["already_sent"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["expired"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]},"); ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]}," for non-compose approvals and for live decisions (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["decision_recorded"]},"), where the version arrives on the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["compose_email_status"]}," stream block instead."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"code-examples","__idx":5},"children":["Code Examples"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"curl","__idx":6},"children":["cURL"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \"https://api.aitronos.com/v1/shared-threads/abc123slug/tool-approval\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"tool_call_id\": \"tc_1\", \"approved\": true}'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"python-sdk","__idx":7},"children":["Python SDK"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"from aitronos import Aitronos\n\nclient = Aitronos(api_key=\"\", token=\"YOUR_TOKEN\")\nresult = client.threads.shared.tool_approval(\n    slug=\"abc123slug\", tool_call_id=\"tc_1\", approved=True\n)\nprint(result.status)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"python-requests","__idx":8},"children":["Python (requests)"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"import requests\n\nresponse = requests.post(\n    \"https://api.aitronos.com/v1/shared-threads/abc123slug/tool-approval\",\n    headers={\"Authorization\": \"Bearer YOUR_TOKEN\"},\n    json={\"tool_call_id\": \"tc_1\", \"approved\": True},\n)\nprint(response.json()[\"status\"])\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"javascript","__idx":9},"children":["JavaScript"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"const response = await fetch(\n  \"https://api.aitronos.com/v1/shared-threads/abc123slug/tool-approval\",\n  {\n    method: \"POST\",\n    headers: {\n      Authorization: \"Bearer YOUR_TOKEN\",\n      \"Content-Type\": \"application/json\",\n    },\n    body: JSON.stringify({ tool_call_id: \"tc_1\", approved: true }),\n  },\n);\nconst result = await response.json();\nconsole.log(result.status);\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"response-examples","__idx":10},"children":["Response Examples"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"success-200","__idx":11},"children":["Success (200)"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"tool_call_id\": \"tc_1\",\n  \"approved\": true,\n  \"status\": \"decision_recorded\",\n  \"version\": null\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"error--not-a-live-link-403","__idx":12},"children":["Error — Not a live link (403)"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INSUFFICIENT_PERMISSIONS\",\n    \"message\": \"You do not have permission to perform this action.\",\n    \"system_message\": \"This share link does not grant live co-working access\",\n    \"type\": \"authorization_error\",\n    \"status\": 403,\n    \"details\": { \"link_id\": \"tslnk_...\", \"access_level\": \"view\" },\n    \"trace_id\": \"...\",\n    \"timestamp\": \"...\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"error--no-pending-approval-404","__idx":13},"children":["Error — No pending approval (404)"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"RESOURCE_NOT_FOUND\",\n    \"message\": \"The requested resource could not be found.\",\n    \"system_message\": \"No pending tool approval for this thread\",\n    \"type\": \"client_error\",\n    \"status\": 404,\n    \"details\": { \"thread_id\": \"thread_...\", \"tool_call_id\": \"tc_1\" },\n    \"trace_id\": \"...\",\n    \"timestamp\": \"...\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"related-resources","__idx":14},"children":["Related Resources"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/shared-threads/join-shared-thread"},"children":["Join Shared Thread"]}," — Join the live-shared thread first"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/shared-threads/shared-thread-compose-state"},"children":["Shared Thread Compose State"]}," — Edit the compose card before approving its Send"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/shared-threads/shared-thread-reactions"},"children":["Shared Thread Reactions"]}," — React to messages as a joiner"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/shared-threads/live-shared-thread"},"children":["Live Shared Thread"]}," — The real-time stream that emits ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tool.approval_required"]}]}]}]}]},"headings":[{"value":"Shared Thread Tool Approval","id":"shared-thread-tool-approval","depth":1},{"value":"Authentication","id":"authentication","depth":2},{"value":"Path Parameters","id":"path-parameters","depth":2},{"value":"Body Parameters","id":"body-parameters","depth":2},{"value":"Returns","id":"returns","depth":2},{"value":"Code Examples","id":"code-examples","depth":2},{"value":"cURL","id":"curl","depth":3},{"value":"Python SDK","id":"python-sdk","depth":3},{"value":"Python (requests)","id":"python-requests","depth":3},{"value":"JavaScript","id":"javascript","depth":3},{"value":"Response Examples","id":"response-examples","depth":2},{"value":"Success (200)","id":"success-200","depth":3},{"value":"Error — Not a live link (403)","id":"error--not-a-live-link-403","depth":3},{"value":"Error — No pending approval (404)","id":"error--no-pending-approval-404","depth":3},{"value":"Related Resources","id":"related-resources","depth":2}],"frontmatter":{"title":"Shared Thread Tool Approval","seo":{"title":"Shared Thread Tool Approval"}},"lastModified":"2026-10-26T18:32:31.654Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/api-reference/shared-threads/shared-thread-tool-approval","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}