{"openapi":"3.1.0","info":{"title":"Thoughtly for Agents API","version":"0.1.0","description":"Fund a prepaid wallet to call eligible US voice numbers. Each minute reserves $1. Voice costs $0.10 per connected minute plus twice the managed carrier charge. BYOC customers pay their carrier directly."},"x-agent-skills":"/.well-known/agent-skills/index.json","servers":[{"url":"/","description":"Use the same origin that served this document."}],"security":[{"ApiKey":[]},{"BearerAuth":[]},{"ThoughtlyAuthorization":[]}],"paths":{"/v1/phone-numbers/{id}/texting":{"post":{"operationId":"enableTexting","summary":"Enable texting on a US local number","x-required-scopes":["messages:write","numbers:write"],"description":"Start or resume a workspace registration. Submit the real campaign draft when requested, share the private billing-owner link and watch the messages feed for approval. Live carrier filing is subject to instance configuration.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaign":{"type":"object","properties":{"use_case":{"type":"string","enum":["CUSTOMER_CARE","ACCOUNT_NOTIFICATION","DELIVERY_NOTIFICATION","MARKETING","2FA","SOLE_PROPRIETOR"]},"description":{"type":"string","minLength":40,"maxLength":4096},"opt_in":{"type":"string","minLength":40,"maxLength":2048,"description":"How recipients actually consent to this specific messaging program. Include the form URL or evidence where applicable."},"samples":{"minItems":2,"maxItems":5,"type":"array","items":{"type":"string","minLength":10,"maxLength":1024}},"opt_in_message":{"type":"string","minLength":20,"maxLength":320},"opt_out_message":{"type":"string","minLength":20,"maxLength":320},"help_message":{"type":"string","minLength":20,"maxLength":320},"privacy_url":{"type":"string","maxLength":500,"format":"uri"},"terms_url":{"type":"string","maxLength":500,"format":"uri"},"embedded_link_sample":{"type":"string","maxLength":500,"format":"uri"},"embedded_phone":{"type":"boolean"},"age_gated":{"type":"boolean"},"direct_lending":{"type":"boolean"}},"required":["use_case","description","opt_in","samples","opt_in_message","opt_out_message","help_message","privacy_url","terms_url"],"additionalProperties":false},"reuse_from_number_id":{"description":"Reuse the same business and approved messaging use case from another workspace number.","type":"string","pattern":"^pn_[A-Za-z0-9_-]{1,120}$"},"correction_note":{"description":"For a rejected campaign, explain what was corrected for the carrier reviewer.","type":"string","minLength":20,"maxLength":1000},"revision":{"description":"Use the receipt revision when changing an existing draft.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"additionalProperties":false}}}},"responses":{"200":{"description":"Registration receipt and next action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextingRegistration"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"getTextingRegistration","summary":"Read texting registration","description":"Read the saved receipt. Carrier callbacks refresh it, with an hourly check for missed updates. Subscribe to the messages channel to receive the next action.","x-required-scope":"messages:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Current workspace receipt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextingRegistration"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/messages":{"post":{"operationId":"sendText","summary":"Send a text","x-required-scope":"messages:write","x-availability":"configured","description":"US one-to-one SMS from a registered, owned number. Supply text or a goal and the real opt-in source for a new contact. Each segment costs $0.01 plus twice the actual carrier charge for managed numbers. BYOC customers pay their carrier directly. A goal reserves up to six segments for the first text and can reply three more times in 24 hours. Reuse the same key after a timeout.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendText"}}}},"responses":{"202":{"description":"One durable receipt. Carrier delivery is asynchronous.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextReceipt"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listTexts","summary":"Read text messages","x-required-scope":"messages:read","parameters":[{"name":"thread_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"cursor","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50}}],"responses":{"200":{"description":"Messages in creation order. Deleted or expired text is null.","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/TextReceipt"},{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"text":{"type":["string","null"]}}}]}},"next_cursor":{"type":["string","null"]}}}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/messages/{id}":{"delete":{"operationId":"deleteText","summary":"Delete saved text content","x-required-scope":"messages:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Content erased. The receipt prevents replay.","content":{"application/json":{"schema":{"type":"object","properties":{"message_id":{"type":"string","format":"uuid"},"content_deleted":{"const":true}}}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/pricing":{"get":{"operationId":"getPricing","summary":"Check calling and messaging prices","security":[],"responses":{"200":{"description":"Fixed customer rate, deposit minimum, and recharge defaults. livemode=false is sandbox pricing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pricing"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/voices":{"get":{"operationId":"listVoices","summary":"List accepted OpenAI voices","security":[],"responses":{"200":{"description":"Select a voice before starting a call.","content":{"application/json":{"schema":{"type":"object","required":["default","data"],"properties":{"default":{"const":"marin"},"data":{"type":"array","items":{"type":"object","required":["id","provider"],"properties":{"id":{"type":"string"},"provider":{"const":"openai"}}}}}}}}}}}},"/v1/phone-numbers":{"get":{"operationId":"listPhoneNumbers","summary":"List owned number configurations","x-required-scope":"numbers:read","description":"Owned number configurations. Outbound readiness and inbound readiness are reported separately. Provisioning requires explicit local enablement.","parameters":[{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Up to 50 numbers and a cursor for the next page.","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PhoneNumber"}},"next_cursor":{"type":["string","null"]}}}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"purchasePhoneNumber","summary":"Accept a number quote","x-required-scopes":["numbers:write","billing:write"],"x-availability":"enabled","description":"Approve the quoted setup and monthly amounts before renting a number. Both include the managed carrier charge. Ready means inbound and outbound routes are verified. Monthly renewals debit the wallet once; failed funding starts cancellation. Retry the same request and key after uncertainty.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["quote_id","accept_monthly_charge"],"properties":{"quote_id":{"type":"string"},"accept_monthly_charge":{"const":true},"make_default":{"type":"boolean","default":true},"inbound":{"$ref":"#/components/schemas/InboundInstructions"}}}}}},"responses":{"200":{"description":"Existing order, reconciled when possible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NumberOrder"}}}},"201":{"description":"Order accepted; inspect status before using the number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NumberOrder"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/phone-numbers/available":{"get":{"operationId":"searchPhoneNumbers","summary":"Get expiring US local number quotes","x-required-scope":"numbers:read","x-availability":"enabled","parameters":[{"name":"country","in":"query","required":true,"schema":{"const":"US"}},{"name":"area_code","in":"query","required":true,"schema":{"type":"string","pattern":"^[2-9][0-9]{2}$"}}],"responses":{"200":{"description":"Five-minute quotes; search does not reserve a number. Usage, applicable taxes and fees are separate.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/NumberQuote"}},"purchase_enabled":{"type":"boolean"},"payment_mode":{"enum":["prepaid","simulated"]},"notice":{"type":"string"}}}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/phone-number-orders/{id}":{"get":{"operationId":"getPhoneNumberOrder","summary":"Check whether your number is ready","x-required-scope":"numbers:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Account-scoped order; never order again to resolve an uncertain outcome.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NumberOrder"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/carriers":{"post":{"operationId":"connectCarrier","summary":"Import an owned Telnyx number","x-required-scopes":["carriers:write","numbers:write"],"x-availability":"enabled","description":"Verifies an owned US local number on a dedicated Telnyx TLS/SRTP FQDN connection pointed to this instance's inbound SIP host, then creates both call routes. Does not repoint existing carrier connections or change messaging. Credentials are encrypted and never returned. Retry an uncertain creation with the same key.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["provider","api_key","phone_number"],"properties":{"provider":{"const":"telnyx"},"api_key":{"type":"string","writeOnly":true,"minLength":20,"maxLength":512},"phone_number":{"type":"string","pattern":"^\\+1[0-9]{10}$"},"make_default":{"type":"boolean","default":false},"inbound":{"$ref":"#/components/schemas/InboundInstructions"}}}}}},"responses":{"200":{"description":"Existing carrier connection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Carrier"}}}},"201":{"description":"Carrier import accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Carrier"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/carriers/{id}":{"get":{"operationId":"getCarrier","summary":"Read carrier import status","x-required-scope":"carriers:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Carrier status without credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Carrier"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/phone-numbers/{id}":{"delete":{"operationId":"cancelPhoneNumber","summary":"Cancel rental or disconnect an imported number","x-required-scope":"numbers:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"description":"Stops new calls first. Rented numbers are released after provider confirmation; imported numbers remain owned at the carrier. Retry canceling results. Active calls prevent cancellation.","responses":{"200":{"description":"Cancellation confirmed.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"const":"canceled"}}}}}},"202":{"description":"Provider cancellation is still pending.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updatePhoneNumber","summary":"Update instructions or select the default caller ID","x-required-scope":"numbers:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"description":"Provide inbound to replace the complete saved configuration, make_default:true to select an outbound-ready number, or both. This never purchases a number or changes its carrier routing, ownership, or readiness.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"anyOf":[{"required":["inbound"]},{"required":["make_default"]},{"required":["sms"]},{"required":["verify_sms"]}],"properties":{"sms":{"$ref":"#/components/schemas/SmsSettings"},"verify_sms":{"const":true},"inbound":{"$ref":"#/components/schemas/InboundInstructions"},"make_default":{"const":true}}}}}},"responses":{"200":{"description":"Updated number configuration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumber"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/signup":{"get":{"operationId":"getSignupTerms","summary":"Read signup terms","x-availability":"enabled","security":[],"responses":{"200":{"description":"Terms to show the account owner.","content":{"application/json":{"schema":{"type":"object","required":["terms_version","terms_url"],"properties":{"terms_version":{"type":"string","examples":["thoughtly-terms-v1"]},"terms_url":{"type":"string","format":"uri","const":"https://thoughtly.com/terms"}}}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"startSignup","summary":"Send a signup email code","x-availability":"enabled","security":[],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128}}],"description":"Use the owner’s specified or known email, or discover it from connected mailbox profiles. Offer multiple eligible addresses in the harness’s question picker. Show the current terms and obtain explicit agreement before sending the code. Reuse the same idempotency key on a retry.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["email","accept_terms","terms_version"],"properties":{"email":{"type":"string","format":"email"},"accept_terms":{"const":true},"terms_version":{"type":"string"}}}}}},"responses":{"201":{"description":"Code sent.","content":{"application/json":{"schema":{"type":"object","required":["signup_id","status","expires_at"],"properties":{"signup_id":{"type":"string"},"status":{"const":"code_sent"},"expires_at":{"type":"string","format":"date-time"}}}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/signup/verify":{"post":{"operationId":"verifySignup","summary":"Verify a code and create an account key","x-availability":"enabled","security":[],"description":"When the owner’s rules and harness permit, retrieve this request’s code from the selected inbox. Otherwise ask the owner for it. Submit the code privately. A retry with the same signup ID and code returns the same key for up to five minutes, bounded by the original code expiry. Existing organization members use normal sign-in.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["signup_id","code"],"properties":{"signup_id":{"type":"string","pattern":"^signup_[A-Za-z0-9_-]{43}$"},"code":{"type":"string","pattern":"^[0-9]{6}$"}}}}}},"responses":{"201":{"description":"Account and scoped key.","content":{"application/json":{"schema":{"type":"object","required":["status","account_id","api_key","usage"],"properties":{"status":{"const":"ready"},"account_id":{"type":"string"},"api_key":{"type":"string"},"permissions":{"type":"array","items":{"type":"string","description":"Permission enabled for this personal or workspace key."}},"usage":{"type":"object","properties":{"header":{"const":"X-API-Key"},"mcp_url":{"const":"/mcp","description":"Streamable HTTP MCP on the same origin with the same workspace key."}}}}}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/call":{"post":{"operationId":"placeCall","summary":"Start a call","x-availability":"enabled","security":[{"ApiKey":[]},{"BearerAuth":[]},{"ThoughtlyAuthorization":[]}],"description":"Send the flat JSON body {to,prompt} with a scoped X-API-Key or authorized bearer token. For HTTP signup without a credential, start at GET /v1/agents/signup. The workspace supplies the caller ID and voice by default. Use the same body and Idempotency-Key on retry. Call carrier-verified US landline, mobile, VoIP and toll-free numbers. Omit the duration for a call of up to 10 minutes. The wallet funds each new minute. Premium-rate and special-service numbers are unavailable. For a phone menu, describe the department or extension in the prompt. The voice agent can press the keys. Declared tools are enabled through the authenticated event feed and MCP.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallRequest"},"example":{"to":"+14155550100","prompt":"Say hello."}}}},"responses":{"202":{"description":"Call ID and current status. Read GET /v1/call/{id} for the outcome.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallStart"}}},"headers":{"Retry-After":{"description":"For a pending request, wait this many seconds before repeating it with the same key.","schema":{"type":"integer"}},"Payment-Receipt":{"description":"Signed receipt when a same-request payment succeeds.","schema":{"type":"string"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Funding required before dialing. Follow the signed payment challenge when present, or fund the wallet separately. Retry the identical request and key.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error"],"properties":{"error":{"const":"payment_required"}}}}},"headers":{"WWW-Authenticate":{"description":"Signed MPP challenge for an authorized wallet.","schema":{"type":"string"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"This key belongs to a different call, the request expired, or the call could not be reserved. Only an explicitly expired request may be restarted with a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A calling safeguard prevented the request. The response identifies the affected route or limit.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-payment-mode":"prepaid","x-required-scope":"calls:write"}},"/v1/call/{id}":{"get":{"operationId":"getCall","summary":"Check call status and cost","x-required-scope":"calls:read","description":"An unclaimed agent with the dedicated first-call scope can read only its own first call.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Call status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Call"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/call/{id}/end":{"post":{"operationId":"endCall","summary":"Hang up or cancel a call","x-required-scope":"calls:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"description":"Use the ID of a phone or browser call in your workspace. Send an empty POST. Repeating it returns the original receipt, even after the call ends. No idempotency key is needed.","responses":{"200":{"description":"Canceled before connecting, or the call had already ended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndCallReceipt"}}}},"202":{"description":"Hangup requested. Wait for call.ended or check the call for its final status and cost.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndCallReceipt"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/call/{id}/transcript":{"get":{"operationId":"getCallTranscript","summary":"Read what was said on a call","x-required-scope":"calls:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"description":"With participant consent, enable recording before the call. Follow call.transcript_turn on /v1/events during the call. This endpoint returns explicit availability and finalized user/assistant turns; no prompts or tool payloads. Transcription can be imperfect or incomplete.","responses":{"200":{"description":"Transcript availability and captured turns.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallTranscript"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/call/{id}/artifacts":{"delete":{"operationId":"deleteCallArtifacts","summary":"Delete a call’s recording and transcript","x-required-scope":"calls:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"description":"Permanent app-level deletion. Late uploads cannot restore the artifacts. Billing and call metadata remain. Artifacts otherwise expire 30 days after call creation; reads enforce expiry even before scheduled cleanup.","responses":{"204":{"description":"Recording and transcript deleted."},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/call/{id}/recording":{"get":{"operationId":"getCallRecording","summary":"Download a captured call recording","x-required-scope":"calls:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"description":"Authenticated Ogg/Opus download. Caller and agent audio occupy separate channels. Returns 404 if no recording is available. Never put API credentials in the URL.","responses":{"200":{"description":"Private audio download.","content":{"audio/ogg":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls":{"get":{"operationId":"listCalls","summary":"List account calls","x-required-scope":"calls:read","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"after","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Calls and a cursor for the next page.","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Call"}},"next_cursor":{"type":["string","null"]}}}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events":{"get":{"operationId":"listEvents","summary":"Follow account events","description":"Use JSON for cursor-based polling or request text/event-stream for a live connection. Each recorded speaker turn is a call.transcript_turn event. Match data.call_id and resume from the last event ID on reconnect. A stream closes after about 20 seconds.","x-scope-by-channel":{"calls":"calls:read","messages":"messages:read"},"parameters":[{"name":"channel","in":"query","schema":{"enum":["calls","messages"],"default":"calls"},"description":"Use the matching channel permission. Existing subscriptions default to calls."},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"Last-Event-ID","in":"header","required":false,"description":"Resume a text/event-stream response after this event. Takes precedence over cursor.","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"default":25}},{"name":"wait_seconds","in":"query","schema":{"type":"integer","minimum":0,"maximum":20,"default":0}}],"responses":{"200":{"description":"Events in stable cursor order.","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"next_cursor":{"type":["string","null"]}}}},"text/event-stream":{"schema":{"type":"string"},"example":"id: evt_example\nevent: call.transcript_turn\ndata: {\"id\":\"evt_example\",\"type\":\"call.transcript_turn\",\"created_at\":\"2026-01-16T15:00:00Z\",\"reply_by\":null,\"data\":{\"call_id\":\"call_example\",\"role\":\"user\",\"text\":\"Friday morning works.\",\"timestamp\":\"2026-01-16T15:00:00Z\",\"interrupted\":false}}\n\n"}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events/{id}/claim":{"post":{"operationId":"claimEvent","summary":"Claim a live tool or SMS turn","x-scope-by-channel":{"calls":"calls:write","messages":"messages:write"},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["claim_token"],"properties":{"claim_token":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$","description":"Private random 32-byte base64url token. Reuse only for this event."}}}}}},"responses":{"200":{"description":"Claimed or already claimed by this token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventStatus"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events/{id}/response":{"post":{"operationId":"respondToEvent","summary":"Respond to a live event","x-scope-by-channel":{"calls":"calls:write","messages":"messages:write"},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Event-Claim","in":"header","required":false,"description":"Required for a claimed tool request.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventResponse"}}}},"responses":{"200":{"description":"Response accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventStatus"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/feedback":{"post":{"operationId":"submitFeedback","summary":"Send agent feedback","x-required-scope":"feedback:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackInput"}}}},"responses":{"200":{"description":"An existing receipt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackReceipt"}}}},"201":{"description":"Feedback accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackReceipt"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/feedback/{id}":{"get":{"operationId":"getFeedback","summary":"Read a feedback receipt","x-required-scope":"feedback:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Feedback receipt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackReceipt"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/wallet":{"get":{"operationId":"getWallet","summary":"Check your available balance","x-required-scope":"billing:write","responses":{"200":{"description":"Account wallet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Wallet"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/wallet/deposits":{"post":{"operationId":"createDeposit","summary":"Fund a prepaid wallet","x-required-scope":"billing:write","x-availability":"enabled","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"description":"Choose one payment method. For MPP use Authorization: Payment for the payment credential and X-Thoughtly-Authorization for a bearer identity.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["amount_usd","method"],"properties":{"amount_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"method":{"enum":["mpp","checkout"]}}}}}},"responses":{"200":{"description":"Deposit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deposit"}}}},"201":{"description":"Deposit created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deposit"}}}},"202":{"description":"Payment needs reconciliation.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Deposit"},{"$ref":"#/components/schemas/PaymentPending"}]}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"MPP payment challenge in WWW-Authenticate.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/wallet/deposits/{id}":{"get":{"operationId":"getDeposit","summary":"Read a deposit","x-required-scope":"billing:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"wait_seconds","in":"query","description":"Wait for an open payment to settle, up to 20 seconds. Defaults to an immediate read.","schema":{"type":"integer","minimum":0,"maximum":20,"default":0}}],"responses":{"200":{"description":"Deposit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deposit"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/wallet/auto-recharge/terms":{"get":{"operationId":"getRechargeTerms","summary":"Read auto-recharge terms","security":[],"parameters":[{"name":"threshold_usd","in":"query","schema":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]}},{"name":"target_usd","in":"query","schema":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]}}],"responses":{"200":{"description":"Terms to present before consent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RechargeTerms"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/wallet/auto-recharge":{"get":{"operationId":"getRecharge","summary":"Read auto-recharge settings","x-required-scope":"billing:write","responses":{"200":{"description":"Recharge settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RechargeSettings"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"disableRecharge","summary":"Disable auto-recharge","x-required-scope":"billing:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["enabled"],"properties":{"enabled":{"const":false}}}}}},"responses":{"200":{"description":"Recharge settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RechargeSettings"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/wallet/payment-methods/setup":{"post":{"operationId":"setupPaymentMethod","summary":"Authorize a saved card for auto-recharge","x-required-scope":"billing:write","x-availability":"enabled","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["accept_auto_recharge"],"properties":{"accept_auto_recharge":{"const":true},"threshold_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"target_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]}}}}}},"responses":{"200":{"description":"Setup already completed.","content":{"application/json":{"schema":{"type":"object"}}}},"202":{"description":"Setup pending or hosted setup URL available.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks":{"get":{"operationId":"listWebhooks","summary":"List webhook endpoints","parameters":[{"name":"channel","in":"query","schema":{"enum":["calls","messages"],"default":"calls"},"description":"Use the matching channel permission. Existing subscriptions default to calls."}],"x-scope-by-channel":{"calls":"calls:read","messages":"messages:read"},"x-availability":"enabled","responses":{"200":{"description":"Active endpoints.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createWebhook","summary":"Register a webhook","x-scope-by-channel":{"calls":"calls:write","messages":"messages:write"},"x-availability":"enabled","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"channel","in":"query","schema":{"enum":["calls","messages"],"default":"calls"},"description":"Use the matching channel permission. Existing subscriptions default to calls."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"Public HTTPS on port 443; private and mixed DNS answers are rejected at delivery."}}}}}},"responses":{"200":{"description":"Existing endpoint and signing secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookWithSecret"}}}},"201":{"description":"Endpoint and signing secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookWithSecret"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}":{"delete":{"operationId":"disableWebhook","summary":"Disable a webhook","x-scope-by-channel":{"calls":"calls:write","messages":"messages:write"},"x-availability":"enabled","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"channel","in":"query","schema":{"enum":["calls","messages"],"default":"calls"},"description":"Use the matching channel permission. Existing subscriptions default to calls."}],"responses":{"204":{"description":"Disabled."},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}/rotate":{"post":{"operationId":"rotateWebhookSecret","summary":"Rotate a webhook signing secret","x-scope-by-channel":{"calls":"calls:write","messages":"messages:write"},"x-availability":"enabled","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"channel","in":"query","schema":{"enum":["calls","messages"],"default":"calls"},"description":"Use the matching channel permission. Existing subscriptions default to calls."}],"responses":{"200":{"description":"New secret and previous-secret expiry.","content":{"application/json":{"schema":{"type":"object","required":["signing_secret","previous_valid_until"],"properties":{"signing_secret":{"type":"string"},"previous_valid_until":{"type":["string","null"],"format":"date-time"}}}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing permission or restricted workspace. A paused workspace allows reads. Stop and show the returned reason to the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/workspace/invitations":{"post":{"x-availability":"configured","x-required-scope":"members:manage","operationId":"inviteWorkspaceMember","summary":"Invite a workspace admin","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"}},"required":["email"],"additionalProperties":false}}}},"responses":{"201":{"description":"Email invitation or existing pending receipt.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"status":{"enum":["pending","sending","revoked","expired","accepted"]},"join_url":{"type":"string","format":"uri","description":"Share with the invited teammate. Joining requires proof of their email."},"expires_at":{"type":"string","format":"date-time"}},"required":["id","email","status","join_url","expires_at"],"additionalProperties":false}}}},"202":{"description":"Delivery is being confirmed.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"status":{"enum":["pending","sending","revoked","expired","accepted"]},"join_url":{"type":"string","format":"uri","description":"Share with the invited teammate. Joining requires proof of their email."},"expires_at":{"type":"string","format":"date-time"}},"required":["id","email","status","join_url","expires_at"],"additionalProperties":false}}}},"400":{"description":"Invalid or expired invitation or verification code."},"401":{"description":"Sign in."},"403":{"description":"Team changes require an active workspace. Admin operations require team access. An eligible existing key receives an approval_url."},"404":{"description":"Not found in this workspace."},"409":{"description":"Conflict with current membership."},"429":{"description":"Try again later."},"503":{"description":"Team access is unavailable."}}}},"/v1/workspace/invitations/{id}":{"delete":{"x-availability":"configured","x-required-scope":"members:manage","operationId":"cancelWorkspaceInvitation","summary":"Cancel an invitation","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation canceled.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"const":"revoked"}},"required":["id","status"],"additionalProperties":false}}}},"400":{"description":"Invalid or expired invitation or verification code."},"401":{"description":"Sign in."},"403":{"description":"Team changes require an active workspace. Admin operations require team access. An eligible existing key receives an approval_url."},"404":{"description":"Not found in this workspace."},"409":{"description":"Conflict with current membership."},"429":{"description":"Try again later."},"503":{"description":"Team access is unavailable."}}}},"/v1/workspace/members":{"get":{"x-availability":"configured","x-required-scope":"members:manage","operationId":"listWorkspaceMembers","summary":"List admins and invitations","responses":{"200":{"description":"The current workspace team.","content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"role":{"const":"admin"}},"required":["id","email","role"],"additionalProperties":false}},"invitations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"status":{"enum":["pending","sending","revoked","expired","accepted"]},"join_url":{"type":"string","format":"uri","description":"Share with the invited teammate. Joining requires proof of their email."},"expires_at":{"type":"string","format":"date-time"}},"required":["id","email","status","join_url","expires_at"],"additionalProperties":false}}},"required":["workspace_id","members","invitations"],"additionalProperties":false}}}},"400":{"description":"Invalid or expired invitation or verification code."},"401":{"description":"Sign in."},"403":{"description":"Team changes require an active workspace. Admin operations require team access. An eligible existing key receives an approval_url."},"404":{"description":"Not found in this workspace."},"409":{"description":"Conflict with current membership."},"429":{"description":"Try again later."},"503":{"description":"Team access is unavailable."}}}},"/v1/workspace/members/{id}":{"get":{"x-availability":"configured","x-required-scope":"members:manage","operationId":"previewMemberRemoval","summary":"Review keys affected by removal","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Personal agent keys and workspace integration keys belonging to this admin.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"status":{"const":"confirmation_required"},"email":{"type":"string","format":"email"},"workspace_keys":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["id","status","email","workspace_keys"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"status":{"const":"removed"}},"required":["id","status"],"additionalProperties":false}]}}}},"400":{"description":"Invalid or expired invitation or verification code."},"401":{"description":"Sign in."},"403":{"description":"Team changes require an active workspace. Admin operations require team access. An eligible existing key receives an approval_url."},"404":{"description":"Not found in this workspace."},"409":{"description":"Conflict with current membership."},"429":{"description":"Try again later."},"503":{"description":"Team access is unavailable."}}},"delete":{"x-availability":"configured","x-required-scope":"members:manage","operationId":"removeWorkspaceMember","summary":"Remove an admin and revoke their credentials","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Access revoked.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"const":"removed"}},"required":["id","status"],"additionalProperties":false}}}},"400":{"description":"Invalid or expired invitation or verification code."},"401":{"description":"Sign in."},"403":{"description":"Team changes require an active workspace. Admin operations require team access. An eligible existing key receives an approval_url."},"404":{"description":"Not found in this workspace."},"409":{"description":"Conflict with current membership."},"429":{"description":"Try again later."},"503":{"description":"Team access is unavailable."}}}},"/v1/workspace/join":{"post":{"x-availability":"configured","security":[],"operationId":"startWorkspaceJoin","summary":"Send a verification code to the invited email","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invitation":{"type":"string","description":"Invitation ID or token from the invitation email."}},"required":["invitation"],"additionalProperties":false}}}},"responses":{"201":{"description":"A verification code was requested.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"const":"code_sent"},"challenge_id":{"type":"string","format":"uuid"},"workspace_id":{"type":"string"},"expires_at":{"type":"string","format":"date-time"}},"required":["status","challenge_id","workspace_id","expires_at"],"additionalProperties":false}}}},"400":{"description":"Invalid or expired invitation or verification code."},"401":{"description":"Sign in."},"403":{"description":"Team changes require an active workspace. Admin operations require team access. An eligible existing key receives an approval_url."},"404":{"description":"Not found in this workspace."},"409":{"description":"Conflict with current membership."},"429":{"description":"Try again later."},"503":{"description":"Team access is unavailable."}}}},"/v1/workspace/join/verify":{"post":{"x-availability":"configured","security":[],"operationId":"verifyWorkspaceJoin","summary":"Join and receive a personal agent key","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"challenge_id":{"type":"string","format":"uuid"},"code":{"type":"string","pattern":"^[0-9]{6}$"}},"required":["challenge_id","code"],"additionalProperties":false}}}},"responses":{"201":{"description":"Save the personal key in the agent's secret store. The permissions array lists its granted scopes. Use a workspace integration key for any required worker scope it lacks.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"const":"joined"},"workspace_id":{"type":"string"},"api_key":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}}},"required":["status","workspace_id","api_key","permissions"],"additionalProperties":false}}}},"400":{"description":"Invalid or expired invitation or verification code."},"401":{"description":"Sign in."},"403":{"description":"Team changes require an active workspace. Admin operations require team access. An eligible existing key receives an approval_url."},"404":{"description":"Not found in this workspace."},"409":{"description":"Conflict with current membership."},"429":{"description":"Try again later."},"503":{"description":"Team access is unavailable."}}}},"/v1/mcp-connections":{"post":{"operationId":"connectMcp","summary":"Connect a provider MCP server for Agent Workers","x-availability":"enabled","x-required-scope":"workers:secrets","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"anyOf":[{"required":["provider"]},{"required":["server_url"]}],"properties":{"provider":{"enum":["hubspot","salesforce"]},"server_url":{"type":"string","format":"uri","description":"Required for Salesforce and custom servers. Use the chosen org’s full HTTPS MCP URL."},"account_label":{"type":"string","maxLength":80,"default":"Default"},"scopes":{"type":"array","maxItems":32,"items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Workspace connection or a link for the owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkerMcpConnection"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"402":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/mcp-connections/{id}":{"get":{"operationId":"getMcpConnection","summary":"Discover a connection’s status and tools","x-availability":"enabled","x-required-scope":"workers:read","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"query","name":"refresh","schema":{"type":"boolean"},"description":"Reload the provider tool catalog."}],"responses":{"200":{"description":"Connection status and available tool schemas.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkerMcpConnection"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"402":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"delete":{"operationId":"disconnectMcp","summary":"Disconnect an MCP server","x-availability":"enabled","x-required-scope":"workers:secrets","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Access disabled. Repeat DELETE if upstream cleanup is pending.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"const":"disconnected"},"cleanup_pending":{"type":"boolean"}}}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"402":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/workers":{"get":{"operationId":"listWorkers","summary":"List Agent Workers","x-availability":"enabled","x-required-scope":"workers:read","parameters":[],"responses":{"200":{"description":"Workers in this workspace.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"402":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"post":{"operationId":"createWorker","summary":"Create an isolated Agent Worker","x-availability":"enabled","x-required-scope":"workers:write","parameters":[{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","minLength":16,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkerDefinition"}}}},"responses":{"200":{"description":"Idempotent replay of the draft Agent Worker.","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Draft Agent Worker and private trigger credential.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"402":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/workers/{id}":{"get":{"operationId":"getWorker","summary":"Read an Agent Worker and its definition","x-availability":"enabled","x-required-scope":"workers:read","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Agent Worker definition.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"402":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"put":{"operationId":"updateWorker","summary":"Create a new draft version","x-availability":"enabled","x-required-scope":"workers:write","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkerDefinition"}}}},"responses":{"200":{"description":"New draft version. It must be activated.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"402":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"patch":{"operationId":"setWorkerState","summary":"Activate or pause an Agent Worker","x-availability":"enabled","x-required-scope":"workers:write","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["state"],"properties":{"state":{"enum":["active","paused"]},"accept_costs":{"type":"boolean","description":"Must be true to activate."}}}}}},"responses":{"200":{"description":"State changed.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"402":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}},"x-additional-scope-for-activation":"billing:write"}},"/v1/workers/{id}/secrets/{name}":{"put":{"operationId":"saveWorkerSecret","summary":"Save a private Agent Worker variable","x-availability":"enabled","x-required-scope":"workers:secrets","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"path","name":"name","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["value"],"properties":{"value":{"type":"string","minLength":1,"maxLength":8192}}}}}},"responses":{"200":{"description":"Value stored; never returned.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"402":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"delete":{"operationId":"deleteWorkerSecret","summary":"Delete a variable and pause the worker","x-availability":"enabled","x-required-scope":"workers:secrets","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"path","name":"name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Variable removed.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"402":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/workers/{id}/trigger":{"post":{"operationId":"rotateWorkerTrigger","summary":"Rotate the incoming webhook credential","x-availability":"enabled","x-required-scope":"workers:secrets","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","minLength":16,"maxLength":128}}],"responses":{"200":{"description":"New private trigger credential.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"402":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/workers/{id}/test":{"post":{"operationId":"testWorker","summary":"Test an Agent Worker with a fixture","x-availability":"enabled","x-required-scope":"workers:write","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","minLength":16,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Fixture event. Calls are simulated and network access is disabled."}}}},"responses":{"200":{"description":"Completed simulated test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkerRun"}}}},"202":{"description":"Test pending or failed; inspect state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkerRun"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"402":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/workers/{id}/runs/{runId}":{"get":{"operationId":"getWorkerRun","summary":"Read a run receipt","x-availability":"enabled","x-required-scope":"workers:read","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"path","name":"runId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Run receipt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkerRun"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"402":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/workers/{id}/webhook":{"post":{"operationId":"triggerWorker","summary":"Send an external event","x-availability":"enabled","x-required-scope":"trigger-secret","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"header","name":"X-Thoughtly-Trigger","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":false,"schema":{"type":"string"},"description":"Stable event ID; alternatively include event_id in the JSON body."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Event JSON containing event_id unless the idempotency header is provided."}}}},"responses":{"202":{"description":"Event accepted or already seen.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"402":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Request could not be completed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}},"security":[]}},"/v1/web-calls":{"post":{"operationId":"createWebCall","summary":"Invite one participant to a browser call","x-availability":"enabled","x-required-scope":"calls:write","description":"Use demo to spend the workspace’s free browser credit by connected seconds. A session ends at its time limit or when its credit runs out. Prepaid calls automatically reserve funds and settle connected time. Outbound invitations expire in 30 seconds. Open a listening browser to ring it by browser_id. Each demo uses the included read-only sample calendar.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":8000,"description":"What to accomplish and when to end the conversation. The phone agent can say goodbye and hang up once the task is complete or the recipient asks to end the call."},"voice":{"type":"string","enum":["alloy","ash","ballad","beacon","bossa","brise","calandria","cedar","cinder","compas","coral","delta","destello","echo","flitz","gleam","halo","harema","hornero","juni","luciernaga","marin","meridian","nira","noeul","nuri","pearl","quartz","ripple","sage","shida","shimmer","sillage","stone","tempo","verse","vesper","willow"]},"first_message":{"type":"string","minLength":1,"maxLength":1000,"description":"Opening line for the person who answers. On a quiet pickup the agent listens briefly, then greets the recipient."},"recording":{"type":"boolean","default":false,"description":"Set to true with participant consent to save the call audio and transcript."},"tools":{"type":"array","maxItems":8,"items":{"$ref":"#/components/schemas/CallTool"},"x-availability":"disabled"},"max_cost_usd":{"type":"string","pattern":"^(?:0|[1-9][0-9]{0,5})(?:\\.[0-9]{1,6})?$"},"max_duration_seconds":{"type":"integer","minimum":15,"maximum":600,"description":"Optional time limit in seconds. Omit to use the server default."},"embed_origin":{"type":"string","format":"uri"},"browser_id":{"type":"string","format":"uuid"},"billing_mode":{"enum":["demo","prepaid"]},"direction":{"enum":["inbound","outbound"],"default":"inbound"}},"required":["prompt","billing_mode"],"additionalProperties":false,"oneOf":[{"properties":{"billing_mode":{"const":"demo"},"tools":{"maxItems":0},"max_cost_usd":{"pattern":"^0(?:\\.0{1,6})?$"}}},{"properties":{"billing_mode":{"const":"prepaid"},"max_cost_usd":{"not":{"pattern":"^0(?:\\.0{1,6})?$"}}}}]}}}},"responses":{"201":{"description":"Private invitation. Keep the ticket out of logs.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"transport":{"const":"webrtc"},"billing_mode":{"enum":["demo","prepaid"]},"direction":{"enum":["inbound","outbound"]},"status":{"type":"string"},"maximum_cost_usd":{"type":"string"},"expires_at":{"type":"string","format":"date-time"},"join_url":{"type":"string","format":"uri"},"join_ticket":{"type":"string"}},"required":["id","transport","billing_mode","direction","status","maximum_cost_usd","expires_at","join_url","join_ticket"],"additionalProperties":false}}}},"400":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"402":{"description":"browser_credit_exhausted ends the free trial. To continue, create a prepaid invitation after the user approves switching to paid calls. funding_required requests a deposit for a prepaid call.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"410":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/web-calls/{id}/join":{"post":{"operationId":"joinWebCall","summary":"On participant acceptance exchange the ticket once for microphone and audio access","x-availability":"enabled","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"join_ticket":{"type":"string","minLength":43,"maxLength":43},"recording_consent":{"type":"boolean"}},"required":["join_ticket"],"additionalProperties":false}}}},"responses":{"200":{"description":"Invitation authenticated.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"server_url":{"type":"string"},"participant_token":{"type":"string"},"participant_identity":{"type":"string"},"max_duration_seconds":{"type":"integer"}},"required":["id","server_url","participant_token","participant_identity","max_duration_seconds"],"additionalProperties":false}}}},"400":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"402":{"description":"browser_credit_exhausted ends the free trial. To continue, create a prepaid invitation after the user approves switching to paid calls. funding_required requests a deposit for a prepaid call.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"410":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/web-calls/{id}/inspect":{"post":{"operationId":"inspectWebCall","summary":"Read settings, consent requirements, available browser credit and session outcome without starting media","x-availability":"enabled","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"join_ticket":{"type":"string","minLength":43,"maxLength":43},"recording_consent":{"type":"boolean"}},"required":["join_ticket"],"additionalProperties":false}}}},"responses":{"200":{"description":"Invitation authenticated.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"billing_mode":{"type":"string"},"voice":{"type":"string"},"prompt":{"type":"string"},"direction":{"type":"string"},"recording":{"type":"boolean"},"browser_credit_available_usd":{"type":"string","description":"Unreserved free browser credit for demo invitations, in USD."},"actual_cost_usd":{"type":["string","null"]},"duration_seconds":{"type":["integer","null"]},"end_reason":{"type":["string","null"]}}}}}},"400":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"402":{"description":"browser_credit_exhausted ends the free trial. To continue, create a prepaid invitation after the user approves switching to paid calls. funding_required requests a deposit for a prepaid call.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"410":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/web-calls/{id}/decline":{"post":{"operationId":"declineWebCall","summary":"Decline an invitation before connecting","x-availability":"enabled","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"join_ticket":{"type":"string","minLength":43,"maxLength":43},"recording_consent":{"type":"boolean"}},"required":["join_ticket"],"additionalProperties":false}}}},"responses":{"200":{"description":"Invitation authenticated.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"const":"declined"}},"required":["status"],"additionalProperties":false}}}},"400":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"402":{"description":"browser_credit_exhausted ends the free trial. To continue, create a prepaid invitation after the user approves switching to paid calls. funding_required requests a deposit for a prepaid call.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"410":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/web-call-browsers":{"post":{"operationId":"openWebBrowser","summary":"Create a receiver. Open its private URL to opt in to calls.","x-availability":"enabled","x-required-scope":"calls:write","responses":{"201":{"description":"Receiver link","content":{"application/json":{"schema":{"type":"object","properties":{"browser_id":{"type":"string"},"listen_url":{"type":"string"}},"required":["browser_id","listen_url"],"additionalProperties":false}}}},"400":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"402":{"description":"browser_credit_exhausted ends the free trial. To continue, create a prepaid invitation after the user approves switching to paid calls. funding_required requests a deposit for a prepaid call.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"410":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/web-call-browsers/{id}/listen":{"post":{"operationId":"listenWebBrowser","summary":"Heartbeat an opted-in receiver and fetch its next invitation","x-availability":"enabled","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"header","name":"Authorization","required":true,"description":"Bearer followed by the receiver capability from the link fragment.","schema":{"type":"string"}}],"security":[],"responses":{"200":{"description":"Pending invitation or null.","content":{"application/json":{"schema":{"type":"object","properties":{"invitation":{"oneOf":[{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"join_url":{"type":"string"},"expires_at":{"type":"string"}},"required":["id","join_url","expires_at"],"additionalProperties":false}]}},"required":["invitation"],"additionalProperties":false}}}},"400":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"402":{"description":"browser_credit_exhausted ends the free trial. To continue, create a prepaid invitation after the user approves switching to paid calls. funding_required requests a deposit for a prepaid call.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"410":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Inspect the machine-readable error before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}}},"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-API-Key"},"BearerAuth":{"type":"http","scheme":"bearer"},"ThoughtlyAuthorization":{"type":"apiKey","in":"header","name":"X-Thoughtly-Authorization","description":"Use Bearer <access_token> here when Authorization carries an MPP payment credential."}},"schemas":{"SendText":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"to":{"type":"string","pattern":"^\\+1\\d{10}$"},"from":{"type":"string","pattern":"^\\+1\\d{10}$"},"text":{"type":"string","minLength":1,"maxLength":1600},"prompt":{"type":"string","minLength":1,"maxLength":4000},"consent":{"type":"string","minLength":1,"maxLength":500}},"required":["to"],"additionalProperties":false,"oneOf":[{"required":["text"]},{"required":["prompt"]}]},"TextReceipt":{"type":"object","required":["message_id","thread_id","direction","status","segments","billing_status","charged_usd","created_at"],"properties":{"message_id":{"type":"string","format":"uuid"},"thread_id":{"type":"string","format":"uuid"},"direction":{"enum":["inbound","outbound"]},"status":{"enum":["queued","received","accepted","sent","delivered","delivery_failed","delivery_unconfirmed","canceled"]},"segments":{"type":"integer"},"billing_status":{"enum":["held","charged","released","unfunded","reconcile"]},"charged_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"created_at":{"type":"string","format":"date-time"}}},"SmsPolicy":{"type":"object","additionalProperties":false,"required":["mode"],"properties":{"mode":{"enum":["notify","local","hosted"]},"prompt":{"type":"string","maxLength":4000},"tools":{"type":"array","maxItems":5,"items":{"type":"object","required":["name","description","parameters"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"parameters":{"type":"object"}}}},"worker_id":{"type":"string"},"fallback":{"type":"object","required":["after_seconds","prompt"],"properties":{"after_seconds":{"type":"integer","minimum":5,"maximum":86400},"prompt":{"type":"string"}}}}},"SmsSettings":{"oneOf":[{"$ref":"#/components/schemas/SmsPolicy"},{"type":"object","additionalProperties":false,"required":["contact","policy"],"properties":{"contact":{"type":"string"},"policy":{"anyOf":[{"$ref":"#/components/schemas/SmsPolicy"},{"type":"null"}]}}}]},"Pricing":{"type":"object","required":["livemode","minimum_deposit_usd","default_deposit_usd"],"properties":{"livemode":{"type":"boolean"},"calls":{"type":"object","properties":{"version":{"type":"string"},"currency":{"const":"USD"},"per_minute_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"managed_carrier_multiplier":{"const":2,"description":"Managed telephony is billed at twice the carrier charge. BYOC is billed directly by your carrier."},"outbound_minute_hold_usd":{"type":"string","description":"Temporary prepaid hold for each authorized outbound minute.","examples":["25.00"]},"billing_increment_seconds":{"const":1},"includes":{"type":"array","items":{"type":"string"}},"note":{"type":"string"}}},"sms":{"type":"object","required":["currency","unit","base_per_segment_usd","managed_carrier_multiplier","inbound_usd","outbound_usd","max_segments","note"],"properties":{"currency":{"const":"USD"},"unit":{"const":"segment"},"base_per_segment_usd":{"type":"string","description":"Thoughtly fee for each inbound or outbound segment on managed and BYOC numbers.","examples":["25.00"]},"managed_carrier_multiplier":{"const":2,"description":"Applied to the actual managed carrier total, including pass-through fees. BYOC carriers bill the customer directly."},"inbound_usd":{"type":"string","description":"Estimated total per inbound managed segment, including the base fee.","examples":["25.00"]},"outbound_usd":{"type":"string","description":"Estimated hold per outbound managed segment, including the base fee.","examples":["25.00"]},"max_segments":{"const":6},"note":{"type":"string"}}},"web_calls":{"type":"object","properties":{"per_minute_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"billing_increment_seconds":{"const":1},"trial_credit_usd":{"type":"string","description":"One-time credit per verified workspace for browser calls.","examples":["25.00"]}}},"minimum_deposit_usd":{"const":"25.00"},"default_deposit_usd":{"const":"25.00"},"auto_recharge":{"type":"object"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"Tool":{"oneOf":[{"type":"object","required":["builtin"],"additionalProperties":false,"properties":{"builtin":{"const":"send_text"}}},{"type":"object","additionalProperties":false,"required":["name","description","parameters"],"properties":{"name":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_-]{0,63}$"},"description":{"type":"string","minLength":1,"maxLength":1000},"parameters":{"type":"object"}}}]},"InboundInstructions":{"type":"object","additionalProperties":false,"required":["prompt"],"properties":{"recording":{"type":"boolean","default":false,"description":"Capture audio and transcript with participant consent; applies to future calls."},"prompt":{"type":"string","minLength":1,"maxLength":8000},"voice":{"type":"string","minLength":1,"maxLength":128},"first_message":{"type":"string","minLength":1,"maxLength":1000},"max_duration_seconds":{"type":"integer","minimum":15,"maximum":600,"default":600},"request_instructions":{"type":"boolean","default":false,"description":"Ask an online agent for prompt/voice overrides; saved instructions apply after the five-second reply deadline."},"tools":{"type":"array","maxItems":8,"items":{"$ref":"#/components/schemas/CallTool"}}}},"NumberQuote":{"type":"object","required":["quote_id","number","currency","setup_usd","monthly_usd","initial_charge_usd","expires_at"],"properties":{"quote_id":{"type":"string"},"number":{"type":"string"},"currency":{"const":"USD"},"setup_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"monthly_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"initial_charge_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"expires_at":{"type":"string","format":"date-time"}}},"NumberOrder":{"type":"object","required":["id","status","payment_mode","billing_status","initial_charge_usd","number"],"properties":{"id":{"type":"string"},"status":{"enum":["submitting","provisioning","ready","failed","reconciliation_required"]},"payment_mode":{"enum":["prepaid","simulated"]},"billing_status":{"enum":["held","settled","released"]},"initial_charge_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"number":{"$ref":"#/components/schemas/PhoneNumber"},"replayed":{"type":"boolean"}}},"Carrier":{"type":"object","required":["id","provider","status","number"],"properties":{"id":{"type":"string"},"provider":{"const":"telnyx"},"status":{"enum":["provisioning","ready","reconciliation_required","disconnected"]},"number":{"type":"string"},"replayed":{"type":"boolean"}}},"PhoneNumber":{"type":"object","required":["id","number","status","inbound_ready","outbound_ready","is_default","inbound"],"properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"enum":["provisioning","outbound_ready","ready","suspended","canceling","canceled"]},"rental":{"type":"object","properties":{"monthly_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"renews_at":{"type":["string","null"],"format":"date-time"}}},"outbound_ready":{"type":"boolean"},"is_default":{"type":"boolean"},"sms_ready":{"type":"boolean"},"sms":{"$ref":"#/components/schemas/SmsSettings"},"inbound_ready":{"type":"boolean","description":"Only an operator-verified carrier route can make a number ready."},"inbound":{"$ref":"#/components/schemas/InboundInstructions"}}},"CallRequest":{"type":"object","additionalProperties":false,"required":["to","prompt"],"properties":{"to":{"type":"string","pattern":"^\\+[1-9][0-9]{1,14}$"},"prompt":{"type":"string","minLength":1,"maxLength":8000,"description":"What to accomplish and when to end the conversation. The phone agent can say goodbye and hang up once the task is complete or the recipient asks to end the call."},"from":{"type":"string","pattern":"^\\+[1-9][0-9]{1,14}$"},"voice":{"type":"string","minLength":1,"maxLength":128},"first_message":{"type":"string","minLength":1,"maxLength":1000,"description":"Opening line for the person who answers. On a quiet pickup the agent listens briefly, then greets the recipient."},"language":{"type":"string","minLength":2,"maxLength":35,"x-availability":"disabled"},"screening_message":{"type":"string","minLength":1,"maxLength":1000,"description":"Optional wording for a phone screener. By default the agent identifies itself using the call instructions."},"voicemail":{"description":"Omit to let the agent decide whether to leave a message and what to say.","oneOf":[{"type":"object","additionalProperties":false,"required":["action"],"properties":{"action":{"const":"hangup"}}},{"type":"object","additionalProperties":false,"required":["action","message"],"properties":{"action":{"const":"leave_message"},"message":{"type":"string","minLength":1,"maxLength":1000}}}]},"max_duration_seconds":{"type":"integer","minimum":15,"maximum":600,"description":"Optional earlier cutoff in seconds. Prepaid outbound calls end after 10 minutes or when the wallet cannot fund the next minute."},"interruptions":{"const":true,"default":true,"description":"Interruptions are enabled in the current voice worker."},"recording":{"type":"boolean","default":false,"description":"Set to true with participant consent to save the call audio and transcript."},"webhook_url":{"type":"string","format":"uri","x-availability":"disabled","description":"Use account webhook subscriptions or the authenticated event feed instead."},"metadata":{"type":"object","maxProperties":20,"propertyNames":{"pattern":"^[A-Za-z0-9_.-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":256}},"tools":{"type":"array","maxItems":8,"items":{"$ref":"#/components/schemas/CallTool"},"x-availability":"enabled"}}},"Call":{"type":"object","required":["id","status","direction","to","maximum_cost_usd","actual_cost_usd","currency","created_at","outcome","billing_status","payment_mode","answered_at","ended_at","duration_seconds"],"properties":{"id":{"type":"string"},"status":{"enum":["queued","dispatching","ringing","in_progress","reconciliation_required","completed","failed","canceled","ending"]},"end_reason":{"type":["string","null"],"description":"user_requested when someone asked to stop the call."},"direction":{"enum":["outbound","inbound"]},"from":{"type":"string","description":"Originating number when explicitly recorded; caller ID is not verified identity."},"outcome":{"type":["string","null"],"enum":["conversation","screened_no_pickup","voicemail_message_played","voicemail_detected","unavailable","failed","interrupted",null],"description":"Worker-observed outcome. Playback completion does not guarantee mailbox receipt; null means unknown."},"to":{"type":"string"},"metadata":{"type":"object"},"maximum_cost_usd":{"type":["string","null"],"description":"A fixed price ceiling if the full duration is funded. Null for rolling calls that can fund more minutes.","examples":["25.00"]},"charges":{"type":"object","properties":{"voice_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"telephony_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]}},"description":"Settled voice and telephony charges in USD."},"actual_cost_usd":{"type":["string","null"],"description":"Final customer charge only; null while unknown or when a simulated hold was released. Carrier-only cost is not the total price."},"billing_status":{"enum":["pending","settled","released"]},"payment_mode":{"enum":["prepaid","simulated"]},"answered_at":{"type":["string","null"],"format":"date-time"},"ended_at":{"type":["string","null"],"format":"date-time"},"duration_seconds":{"type":["integer","null"],"minimum":0,"description":"Carrier-confirmed connected duration."},"artifacts":{"type":"object","required":["transcript","recording"],"properties":{"expires_at":{"type":"string","format":"date-time"},"transcript":{"$ref":"#/components/schemas/CallArtifact"},"recording":{"$ref":"#/components/schemas/CallArtifact"}}},"currency":{"const":"USD"},"created_at":{"type":"string","format":"date-time"}}},"EndCallReceipt":{"type":"object","additionalProperties":false,"required":["call_id","outcome"],"properties":{"call_id":{"type":"string"},"outcome":{"enum":["canceled","hangup_requested","already_ended"],"description":"canceled means the call was stopped before connecting, with zero call charges. hangup_requested means disconnection was requested. already_ended means the call finished before this request."}}},"CallStart":{"type":"object","additionalProperties":false,"required":["id","status"],"properties":{"id":{"type":"string","description":"Call ID. An identical retry returns the same ID."},"status":{"enum":["pending","queued","dispatching","ringing","in_progress","reconciliation_required","completed","failed","canceled"],"description":"Current call state. If pending, wait for Retry-After and repeat the original request."}}},"CallArtifact":{"type":"object","required":["status","path"],"properties":{"status":{"enum":["not_enabled","pending","available","unavailable","expired","deleted"]},"path":{"type":["string","null"],"description":"Relative authenticated download path; never a public media link."}}},"CallTranscript":{"type":"object","required":["call_id","status","captured_at","turns"],"properties":{"call_id":{"type":"string"},"status":{"enum":["not_enabled","pending","available","unavailable","expired","deleted"]},"captured_at":{"type":["string","null"],"format":"date-time"},"turns":{"type":["array","null"],"items":{"type":"object","required":["role","text","timestamp","interrupted"],"properties":{"role":{"enum":["user","assistant"]},"text":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"interrupted":{"type":"boolean"}}}}}},"TextingRegistration":{"type":"object","required":["number_id","registration_id","status","next_action"],"properties":{"number_id":{"type":"string"},"registration_id":{"type":["string","null"],"format":"uuid"},"status":{"enum":["needs_campaign","needs_owner","in_review","action_required","ready"]},"next_action":{"type":"string"},"revision":{"type":"integer"},"owner_url":{"type":"string","format":"uri"},"events":{"type":"object","properties":{"channel":{"const":"messages"},"ready":{"const":"message.registration_ready"}}}}},"Event":{"type":"object","required":["id","type","created_at","reply_by","data"],"properties":{"id":{"type":"string"},"type":{"enum":["call.incoming","call.tool_requested","call.transcript_turn","call.ended","call.rejected","message.received","message.updated","message.reply_requested","message.tool_requested","message.registration_ready","message.registration_action_required"]},"created_at":{"type":"string","format":"date-time"},"reply_by":{"type":["string","null"],"format":"date-time","description":"Null for read-only notifications including call.transcript_turn, call.ended and call.rejected."},"data":{"type":"object"}},"oneOf":[{"properties":{"type":{"enum":["message.registration_ready","message.registration_action_required"]},"data":{"type":"object","required":["registration_id","number_id","next_action"]}}},{"properties":{"type":{"enum":["message.received","message.updated","message.reply_requested","message.tool_requested"]},"data":{"type":"object","required":["message_id"]}}},{"properties":{"type":{"const":"call.incoming"},"data":{"$ref":"#/components/schemas/IncomingCallEventData"}}},{"properties":{"type":{"const":"call.tool_requested"},"data":{"$ref":"#/components/schemas/ToolRequestedEventData"}}},{"properties":{"type":{"const":"call.transcript_turn"},"data":{"$ref":"#/components/schemas/TranscriptTurnEventData"}}},{"properties":{"type":{"const":"call.ended"},"data":{"$ref":"#/components/schemas/CallEndedEventData"}}},{"properties":{"type":{"const":"call.rejected"},"data":{"$ref":"#/components/schemas/CallRejectedEventData"}}}]},"IncomingCallEventData":{"type":"object","additionalProperties":false,"required":["call_id","from","to"],"properties":{"call_id":{"type":"string"},"from":{"type":"string","description":"Caller number in E.164 format; caller ID is not proof of identity."},"to":{"type":"string","description":"The account-owned number that received the call, in E.164 format."}}},"ToolRequestedEventData":{"type":"object","additionalProperties":false,"required":["call_id","tool_call_id","name","arguments"],"properties":{"call_id":{"type":"string"},"tool_call_id":{"type":"string"},"name":{"type":"string","description":"A tool declared for this call."},"arguments":{"type":"object","description":"JSON arguments validated against the declared tool's parameter schema."}}},"TranscriptTurnEventData":{"type":"object","additionalProperties":false,"required":["call_id","role","text","timestamp","interrupted"],"properties":{"call_id":{"type":"string"},"role":{"enum":["user","assistant"],"description":"The other participant or the voice agent."},"text":{"type":"string","maxLength":8000},"timestamp":{"type":"string","format":"date-time"},"interrupted":{"type":"boolean"}}},"CallEndedEventData":{"type":"object","additionalProperties":false,"required":["call_id","status","ended_at","duration_seconds"],"properties":{"call_id":{"type":"string"},"status":{"enum":["completed","failed","canceled"]},"end_reason":{"type":"string"},"transport":{"const":"webrtc"},"billing_mode":{"enum":["prepaid","demo"]},"ended_at":{"type":"string","format":"date-time"},"duration_seconds":{"type":"integer","minimum":0}}},"CallRejectedEventData":{"type":"object","additionalProperties":false,"required":["call_id","from","to","reason"],"properties":{"call_id":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"reason":{"const":"insufficient_funds"}}},"EventStatus":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}}},"EventResponse":{"oneOf":[{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":1600}},"required":["text"],"additionalProperties":false},{"type":"object","properties":{"handled":{"type":"boolean","const":true}},"required":["handled"],"additionalProperties":false}]},{"type":"object","additionalProperties":false,"required":["prompt"],"properties":{"prompt":{"type":"string","maxLength":8000},"voice":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["result"],"properties":{"result":{}}},{"type":"object","additionalProperties":false,"required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}]},"FeedbackInput":{"type":"object","additionalProperties":false,"required":["message"],"properties":{"message":{"type":"string","minLength":1,"maxLength":4000},"call_id":{"type":"string"},"idempotency_key":{"type":"string"}}},"FeedbackReceipt":{"type":"object","required":["id","status","idempotency_key","created_at"],"properties":{"id":{"type":"string"},"status":{"enum":["pending","submitted"]},"idempotency_key":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}},"Wallet":{"type":"object","required":["currency","balance_usd","reserved_usd","available_usd"],"properties":{"currency":{"const":"USD"},"balance_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"reserved_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"available_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"browser_credit_available_usd":{"type":"string","description":"Free credit available only for browser demos. Separate from prepaid funds.","examples":["25.00"]},"debt_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"billing_hold":{"type":"boolean"}}},"Deposit":{"type":"object","required":["id","status","amount_usd","currency","livemode","method","payment","receipt"],"properties":{"id":{"type":"string"},"status":{"type":"string"},"amount_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"currency":{"const":"USD"},"livemode":{"type":"boolean","description":"False for a Stripe test payment, including before checkout."},"method":{"enum":["checkout","mpp"]},"payment":{"type":["object","null"],"description":"A hosted checkout includes the owner’s url, a same-origin status_url for the agent to wait on, and instructions. Null once no payment action is available."},"receipt":{"type":["object","null"],"description":"A provider receipt is returned only after the deposit has been credited.","required":["provider","reference","livemode"],"properties":{"provider":{"const":"stripe"},"reference":{"type":"string"},"livemode":{"type":"boolean"}}}}},"PaymentPending":{"type":"object","required":["id","status"],"properties":{"id":{"type":"string"},"status":{"const":"reconciliation_required"}}},"RechargeTerms":{"type":"object","required":["threshold_usd","target_usd","minimum_charge_usd","terms"],"properties":{"threshold_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"target_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"minimum_charge_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"terms":{"type":"string"}}},"RechargeSettings":{"type":"object","required":["enabled","threshold_usd","target_usd","minimum_charge_usd","payment_method_saved","payment_pending"],"properties":{"enabled":{"type":"boolean"},"threshold_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"target_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"minimum_charge_usd":{"type":"string","description":"A decimal USD amount; do not use a floating-point number.","examples":["25.00"]},"payment_method_saved":{"type":"boolean"},"payment_pending":{"type":"boolean"}}},"Webhook":{"type":"object","required":["id","url","active","created_at"],"properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}}},"WebhookWithSecret":{"allOf":[{"$ref":"#/components/schemas/Webhook"},{"type":"object","required":["signing_secret"],"properties":{"signing_secret":{"type":"string"}}}]},"WorkerMcpConnection":{"type":"object","required":["id","provider","account_label","server_url","status"],"properties":{"id":{"type":"string"},"provider":{"enum":["hubspot","salesforce","custom"]},"account_label":{"type":"string"},"server_url":{"type":"string"},"status":{"enum":["action_required","ready","disconnected"]},"action_url":{"type":"string"},"tools":{"type":"array","items":{"type":"object","required":["name","inputSchema"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"inputSchema":{"type":"object"}}}}}},"HostedWorkerTool":{"type":"object","additionalProperties":false,"required":["worker_id"],"properties":{"worker_id":{"type":"string","pattern":"^wrk_[a-f0-9]{32}$"}}},"CallTool":{"oneOf":[{"$ref":"#/components/schemas/Tool"},{"$ref":"#/components/schemas/HostedWorkerTool"}]},"WorkerDefinition":{"type":"object","additionalProperties":false,"required":["name","code","daily_limit_usd","max_call_cost_usd"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100},"code":{"type":"string","minLength":1,"maxLength":24000,"description":"JavaScript ESM: export default async (event, ctx) => result. Runs in an isolated sandbox."},"hosts":{"type":"array","maxItems":12,"uniqueItems":true,"default":[],"items":{"type":"string"},"description":"Public HTTPS hostnames the Agent Worker can contact."},"secrets":{"type":"array","maxItems":12,"uniqueItems":true,"default":[],"items":{"type":"string","pattern":"^[A-Z][A-Z0-9_]{0,63}$"}},"daily_limit_usd":{"type":"string","examples":["2.00"],"description":"Maximum daily Agent Worker execution spend, in USD. Phone calls are billed separately and do not count toward this limit."},"max_call_cost_usd":{"type":"string","examples":["0.25"],"description":"Maximum charge for each call started by this worker. Multiple events can start multiple calls; this is not a daily call budget. Workspace and destination risk limits also apply."},"max_text_cost_usd":{"type":"string","default":"0","pattern":"^(?:0|[1-9]\\d{0,5})(?:\\.\\d{1,6})?$","examples":["0.05"],"description":"Maximum total SMS spend per run. A positive amount enables ctx.messages.send for webhooks and call-ended events and requires messages:write. Messages are billed per segment."},"on_call_ended":{"type":"boolean","default":false},"mcp":{"type":"object","maxProperties":6,"description":"Named remote MCP connections. Activation also requires workers:secrets.","additionalProperties":{"type":"object","additionalProperties":false,"required":["connection_id","tools"],"properties":{"connection_id":{"type":"string","pattern":"^mcpc_[a-f0-9]{32}$"},"tools":{"type":"array","minItems":1,"maxItems":12,"uniqueItems":true,"items":{"type":"string"}}}}},"tool":{"type":"object","additionalProperties":false,"required":["name","description","parameters"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"parameters":{"type":"object","description":"Bounded JSON Schema for the tool's arguments."},"mode":{"enum":["blocking","background"],"default":"blocking","description":"Blocking returns a result during the call. Background lets conversation continue and delivers the result when ready."}}}}},"WorkerRun":{"type":"object","properties":{"id":{"type":"string"},"worker_id":{"type":"string"},"version_id":{"type":"string"},"source":{"type":"string"},"state":{"enum":["queued","running","completed","failed","canceled","uncertain"]},"billed_seconds":{"type":["integer","null"]},"cost_usd":{"type":["string","null"]},"result":{},"created_at":{"type":"string"},"finished_at":{"type":["string","null"]}},"description":"An uncertain run may have performed external side effects and is never automatically retried."}}}}