curl --fail-with-body https://api.thred.dev/v1/collect \ --request POST \ --header "Authorization: Bearer $THRED_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "to": "+14155550123", "instructions": "Ask whether the business is open on the date in input and what time it closes.", "input": { "date": "today" }, "output": { "properties": { "is_open": { "type": "boolean" }, "closes_at": { "type": "string" } }, "required": ["is_open", "closes_at"], "additionalProperties": false } }'
const response = await fetch("https://api.thred.dev/v1/collect", { method: "POST", headers: { Authorization: `Bearer ${process.env.THRED_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ to: "+14155550123", instructions: "Ask whether the business is open on the date in input and what time it closes.", input: { date: "today" }, output: { properties: { is_open: { type: "boolean" }, closes_at: { type: "string" } }, required: ["is_open", "closes_at"], "additionalProperties": false } }),});if (!response.ok) throw new Error(await response.text());const collection = await response.json();console.log(collection.id);
import osimport requestsresponse = requests.post( "https://api.thred.dev/v1/collect", headers={ "Authorization": f"Bearer {os.environ['THRED_API_KEY']}", }, json={ "to": "+14155550123", "instructions": "Ask whether the business is open on the date in input and what time it closes.", "input": { "date": "today" }, "output": { "properties": { "is_open": { "type": "boolean" }, "closes_at": { "type": "string" } }, "required": ["is_open", "closes_at"], "additionalProperties": False } }, timeout=30,)response.raise_for_status()collection = response.json()print(collection["id"])
Collect answers from a known phone number. Send instructions, optional context values in input, and a JSON Schema in output. Use the returned ID to retrieve the result, or provide a webhook_id. Development and Production can both place real calls.
POST
/
v1
/
collect
curl --fail-with-body https://api.thred.dev/v1/collect \ --request POST \ --header "Authorization: Bearer $THRED_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "to": "+14155550123", "instructions": "Ask whether the business is open on the date in input and what time it closes.", "input": { "date": "today" }, "output": { "properties": { "is_open": { "type": "boolean" }, "closes_at": { "type": "string" } }, "required": ["is_open", "closes_at"], "additionalProperties": false } }'
const response = await fetch("https://api.thred.dev/v1/collect", { method: "POST", headers: { Authorization: `Bearer ${process.env.THRED_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ to: "+14155550123", instructions: "Ask whether the business is open on the date in input and what time it closes.", input: { date: "today" }, output: { properties: { is_open: { type: "boolean" }, closes_at: { type: "string" } }, required: ["is_open", "closes_at"], "additionalProperties": false } }),});if (!response.ok) throw new Error(await response.text());const collection = await response.json();console.log(collection.id);
import osimport requestsresponse = requests.post( "https://api.thred.dev/v1/collect", headers={ "Authorization": f"Bearer {os.environ['THRED_API_KEY']}", }, json={ "to": "+14155550123", "instructions": "Ask whether the business is open on the date in input and what time it closes.", "input": { "date": "today" }, "output": { "properties": { "is_open": { "type": "boolean" }, "closes_at": { "type": "string" } }, "required": ["is_open", "closes_at"], "additionalProperties": False } }, timeout=30,)response.raise_for_status()collection = response.json()print(collection["id"])
Use the quickstart to set your API key. JavaScript uses Node.js; Python uses Requests.input holds context values for the call. output is the JSON Schema defining the answers you want back in data. input is optional and defaults to an empty object. The output is always an object: define properties, list required fields, and set additionalProperties to false. No top-level type is needed.
curl --fail-with-body https://api.thred.dev/v1/collect \ --request POST \ --header "Authorization: Bearer $THRED_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "to": "+14155550123", "instructions": "Ask whether the business is open on the date in input and what time it closes.", "input": { "date": "today" }, "output": { "properties": { "is_open": { "type": "boolean" }, "closes_at": { "type": "string" } }, "required": ["is_open", "closes_at"], "additionalProperties": false } }'
const response = await fetch("https://api.thred.dev/v1/collect", { method: "POST", headers: { Authorization: `Bearer ${process.env.THRED_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ to: "+14155550123", instructions: "Ask whether the business is open on the date in input and what time it closes.", input: { date: "today" }, output: { properties: { is_open: { type: "boolean" }, closes_at: { type: "string" } }, required: ["is_open", "closes_at"], "additionalProperties": false } }),});if (!response.ok) throw new Error(await response.text());const collection = await response.json();console.log(collection.id);
import osimport requestsresponse = requests.post( "https://api.thred.dev/v1/collect", headers={ "Authorization": f"Bearer {os.environ['THRED_API_KEY']}", }, json={ "to": "+14155550123", "instructions": "Ask whether the business is open on the date in input and what time it closes.", "input": { "date": "today" }, "output": { "properties": { "is_open": { "type": "boolean" }, "closes_at": { "type": "string" } }, "required": ["is_open", "closes_at"], "additionalProperties": False } }, timeout=30,)response.raise_for_status()collection = response.json()print(collection["id"])
Send Authorization: Bearer <THRED_API_KEY>. Development keys begin thr_dev_; Production keys begin thr_prod_. Each key is scoped to a workspace and environment. Keep secrets on your server.
Optional key for retrying a request without creating another collection. Omit it to create a new collection on each POST. Reuse the same key only with the same request; a different request returns 409. Use 1–200 printable, non-space ASCII characters.
Required string length: 1 - 200
Pattern: ^[!-~]{1,200}$
Body
application/json
The destination, task, input context, and output JSON Schema.
Send UTF-8 JSON, up to 64 KiB. Unknown fields are rejected.
The JSON Schema defining the answers returned in data. The output root is always an object, so no top-level type is needed. Define properties and required fields, and set additionalProperties to false.
Known context values for the call, such as a date, product name, or reference number. Must be a JSON object; optional and defaults to an empty object. Up to 16,000 bytes of JSON. Maximum depth: 32; maximum values: 8,192.
The API key selects the workspace environment. Development and Production are isolated, but either can place real calls when enabled.
Available options:
development,
production
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Thred API","description":"The data API for the phone. Collect structured answers from a known phone number.","colors":{"primary":"#3AA4C1","light":"#3AA4C1","dark":"#3AA4C1"},"logo":{"light":"https://mintcdn.com/pop101/o-sRhnCnjLqfHGe3/images/logo_full_dark.png?fit=max\u0026auto=format\u0026n=o-sRhnCnjLqfHGe3\u0026q=85\u0026s=acd9058a2fc6c122b1b200877b0d36dd","dark":"https://mintcdn.com/pop101/o-sRhnCnjLqfHGe3/images/logo_full_light.png?fit=max\u0026auto=format\u0026n=o-sRhnCnjLqfHGe3\u0026q=85\u0026s=0be4abc5d471e6db0953d7c9e3b887e9"},"favicon":"https://mintcdn.com/pop101/xEyEjyZgrjRp9yCI/images/icon.ico?fit=max\u0026auto=format\u0026n=xEyEjyZgrjRp9yCI\u0026q=85\u0026s=47086c9a22642a088551ba9129637e16","api":{"openapi":"api-reference/openapi.json","playground":{"display":"simple"},"examples":{"defaults":"required","languages":["curl","javascript","python"]}},"background":{"color":{"light":"#FFFFFF","dark":"#1D1D1D"}},"navbar":{"links":[{"href":"https://thred.ai","label":"Website"}],"primary":{"type":"button","label":"Dashboard","href":"https://dashboard.thred.ai"}},"fonts":{"family":"Instrument Sans"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"pop101","hasAudioNarration":false,"actualSubdomain":"pop101","customDomains":["www.thred.dev"],"gitSource":{"type":"github","owner":"thred-ai","repo":"thred-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":"","_id":"6ae4efc5a50e0154d4d48983"},"chroma":{"liveDeploymentHistoryId":"6ae55ed1e88570d4b4a37508","collectionId":"9be77499-6eb5-4df6-b65e-673214645ee6","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae55ed1e88570d4b4a37508"},"entitlements":{},"buildId":"6ae55fc913db368f60c3eff7","clientVersion":"0.0.4043","searchFilterCounts":[{"language":"default","tag":"Collect API","count":5},{"language":"default","tag":"Account and utilities","count":3},{"language":"default","tag":"Get started","count":3}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":":root{--thred-surface:#ffffff;--thred-muted-surface:#f2f2f2;--thred-text:#2b333b;--thred-secondary-text:#717989;--thred-border:#dcdcdc;--thred-panel-border:#f0f0f0;--thred-hover:#f3f3f3;--thred-accent:#3aa4c1;--thred-link:#0957d0;--sidebar-width:14rem;--content-width:48rem}.dark{--thred-surface:#1d1d1d;--thred-muted-surface:#303030;--thred-text:lch(77.594 1 139.088);--thred-secondary-text:lch(67.594 1 139.088);--thred-border:#414141;--thred-panel-border:#2d2d2d;--thred-hover:#2a2a2a;--thred-link:#8ab4f8}body{font-size:14px;letter-spacing:calc(.6px - .05em);-webkit-font-smoothing:antialiased}button,input,select,textarea{font-family:inherit}#mobile-nav,#mobile-nav-content,#navbar,#navbar-transition{background:var(--thred-surface);border-color:var(--thred-panel-border)}img.nav-logo{height:28px!important;width:auto!important}#page-title,body{color:var(--thred-text)}#page-title{font-size:24px;font-weight:600;line-height:32px;letter-spacing:-.025em}#header .eyebrow,#header>div{color:var(--thred-secondary-text)}#header .eyebrow{font-size:12px;font-weight:500}#header>div{font-size:14px;line-height:24px}:is(#content, #api-playground-2-operation-page){margin-top:28px}#api-playground-2-operation-page,#content-container .prose{color:var(--thred-text);font-size:14px;line-height:24px;--tw-prose-body:var(--thred-text);--tw-prose-headings:var(--thred-text);--tw-prose-bold:var(--thred-text);--tw-prose-links:var(--thred-link);--tw-prose-counters:var(--thred-secondary-text);--tw-prose-bullets:var(--thred-secondary-text);--tw-prose-code:var(--thred-text);--tw-prose-th-borders:var(--thred-border);--tw-prose-td-borders:var(--thred-panel-border)}:is(#content, #api-playground-2-operation-page) :is(h2, h3, h4){color:var(--thred-text);font-weight:600;letter-spacing:calc(.6px - .05em)}:is(#content, #api-playground-2-operation-page) h2{font-size:18px;line-height:28px;margin-top:32px;margin-bottom:12px}:is(#content, #api-playground-2-operation-page) h3,:is(#content, #api-playground-2-operation-page) h4{font-size:14px;line-height:24px}:is(#content, #api-playground-2-operation-page) :is(p, ul, ol){margin-top:12px;margin-bottom:12px}:is(#content, #api-playground-2-operation-page) strong{color:var(--thred-text);font-weight:600}:is(#content, #api-playground-2-operation-page) a:not(.card):not([aria-label]){color:var(--thred-link);text-decoration-thickness:1px;text-underline-offset:3px}#mobile-nav-content a,#sidebar a{color:var(--thred-text);font-size:14px;font-weight:400;border-radius:6px}#mobile-nav-content a:hover,#sidebar a:hover{background:var(--thred-hover)}#mobile-nav-content .sidebar-group a[class~=\"bg-primary/10\"],#sidebar .sidebar-group a[class~=\"bg-primary/10\"]{color:var(--thred-text);background:var(--thred-muted-surface);font-weight:500;text-shadow:none}#sidebar-title{color:var(--thred-secondary-text);font-size:12px;font-weight:500}#footer,#table-of-contents,#table-of-contents a,.navbar-link{color:var(--thred-secondary-text);font-size:13px}#table-of-contents a:hover{color:var(--thred-text)}#search-bar-entry,#topbar-cta-button a{border-radius:6px;font-size:13px;box-shadow:none}#search-bar-entry{height:32px;border:1px solid var(--thred-border);background:var(--thred-surface);color:var(--thred-secondary-text);filter:none}#topbar-cta-button a{min-height:28px;padding:4px 10px;border:1px solid var(--thred-accent);background:color-mix(in srgb,var(--thred-accent) 80%,transparent);color:#2b333b;font-weight:400}#topbar-cta-button a:hover{background:color-mix(in srgb,var(--thred-accent) 60%,transparent)}#topbar-cta-button a>span{background:0 0;border-radius:inherit}#topbar-cta-button a :is(span, svg){color:inherit}.card{border:1px solid var(--thred-border);border-radius:6px;background:var(--thred-surface);box-shadow:none}.card:hover{border-color:var(--thred-border)!important;background:var(--thred-hover)}[data-component-part=card-content-container]{padding:16px}[data-component-part=card-icon]{width:20px;height:20px;color:var(--thred-accent);fill:var(--thred-accent)}:is(#content, #api-playground-2-operation-page) [data-component-part=card-title]{color:var(--thred-text);font-size:14px;line-height:24px;margin-top:12px;margin-bottom:4px}[data-component-part=card-content]{color:var(--thred-secondary-text);font-size:14px;line-height:24px}:is(#content, #api-playground-2-operation-page) table{width:100%;font-size:14px;line-height:24px}:is(#content, #api-playground-2-operation-page) td,:is(#content, #api-playground-2-operation-page) th{padding:8px 12px;border-bottom:1px solid var(--thred-panel-border)}:is(#content, #api-playground-2-operation-page) th{background:var(--thred-muted-surface);color:var(--thred-secondary-text);font-size:12px;font-weight:500}:is(#content, #api-playground-2-operation-page) .callout{border:1px solid var(--thred-border);border-radius:6px;background:var(--thred-muted-surface);color:var(--thred-text);font-size:14px;line-height:24px}:is(#content, #api-playground-2-operation-page) [data-component-part=callout-content]{color:var(--thred-text);line-height:24px}:is(#content, #api-playground-2-operation-page) [data-component-part=callout-icon] svg{color:var(--thred-secondary-text)}.code-block,.code-group{border:1px solid var(--thred-border);border-radius:8px;box-shadow:none}#content-container .code-block-background{background:var(--thred-surface)!important;border-radius:inherit}code,kbd,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;letter-spacing:0}pre,pre code{font-size:13px;line-height:24px}:is(#content, #api-playground-2-operation-page) :not(pre)>code{background:var(--thred-muted-surface);color:var(--thred-text);border-color:var(--thred-border);border-radius:4px;font-size:12px}#pagination a,.expandable,.option-dropdown{border-color:var(--thred-border);border-radius:6px}@media (min-width:1024px){#sidebar{width:var(--sidebar-width)}#sidebar-content{padding-right:12px}#content-area{padding-left:calc(var(--sidebar-width) + 6rem)}}a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(--thred-link);outline-offset:3px}"}],"page":{"pagePath":"api-reference/create-collection","slug":"/api-reference/create-collection","pageMetadata":{"title":"Create a collection","openapi":"api-reference/openapi.json POST /v1/collect","description":"Collect answers from a known phone number. Send instructions, optional context values in input, and a JSON Schema in output. Use the returned ID to retrieve the result, or provide a webhook_id. Development and Production can both place real calls.","href":"/api-reference/create-collection"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Collect answers from a known phone number. Send instructions, optional context values in input, and a JSON Schema in output. Use the returned ID to retrieve the result, or provide a webhook_id. Development and Production can both place real calls.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,..._provideComponents(),...props.components};return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Use the `,_jsx(_components.a,{href:`/quickstart`,children:`quickstart`}),` to set your API key. JavaScript uses Node.js; Python uses Requests.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`input`}),` holds context values for the call. `,_jsx(_components.code,{children:`output`}),` is the JSON Schema defining the answers you want back in `,_jsx(_components.code,{children:`data`}),`. `,_jsx(_components.code,{children:`input`}),` is optional and defaults to an empty object. The output is always an object: define `,_jsx(_components.code,{children:`properties`}),`, list `,_jsx(_components.code,{children:`required`}),` fields, and set `,_jsx(_components.code,{children:`additionalProperties`}),` to `,_jsx(_components.code,{children:`false`}),`. No top-level `,_jsx(_components.code,{children:`type`}),` is needed.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create a collection","openapi":"api-reference/openapi.json POST /v1/collect","description":"Collect answers from a known phone number. Send instructions, optional context values in input, and a JSON Schema in output. Use the returned ID to retrieve the result, or provide a webhook_id. Development and Production can both place real calls.","href":"/api-reference/create-collection"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,RequestExample}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Use the `,_jsx(_components.a,{href:`/quickstart`,children:`quickstart`}),` to set your API key. JavaScript uses Node.js; Python uses Requests.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`input`}),` holds context values for the call. `,_jsx(_components.code,{children:`output`}),` is the JSON Schema defining the answers you want back in `,_jsx(_components.code,{children:`data`}),`. `,_jsx(_components.code,{children:`input`}),` is optional and defaults to an empty object. The output is always an object: define `,_jsx(_components.code,{children:`properties`}),`, list `,_jsx(_components.code,{children:`required`}),` fields, and set `,_jsx(_components.code,{children:`additionalProperties`}),` to `,_jsx(_components.code,{children:`false`}),`. No top-level `,_jsx(_components.code,{children:`type`}),` is needed.`]}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`17`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`17`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --fail-with-body`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.thred.dev/v1/collect`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$THRED_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --data`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"to\": \"+14155550123\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"instructions\": \"Ask whether the business is open on the date in input and what time it closes.\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"input\": { \"date\": \"today\" },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"output\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"properties\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"is_open\": { \"type\": \"boolean\" },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"closes_at\": { \"type\": \"string\" }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"required\": [\"is_open\", \"closes_at\"],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"additionalProperties\": false`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`24`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`24`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.thred.dev/v1/collect\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"POST\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Authorization:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `Bearer \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`process`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`THRED_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` to:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"+14155550123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` instructions:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Ask whether the business is open on the date in input and what time it closes.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` input:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`date:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"today\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` output:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` properties:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` is_open:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`type:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"boolean\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` closes_at:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`type:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"string\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` required:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"is_open\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"closes_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"additionalProperties\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` false`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ok`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`text`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`());`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` collection`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`collection`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`26`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`26`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.thred.dev/v1/collect\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'THRED_API_KEY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"to\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"+14155550123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"instructions\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Ask whether the business is open on the date in input and what time it closes.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"input\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"date\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"today\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"output\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"properties\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"is_open\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"boolean\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"closes_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"required\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"is_open\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"closes_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"additionalProperties\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`False`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` timeout`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`30`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response.raise_for_status()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`collection `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(collection[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`]})})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create a collection","openapi":"api-reference/openapi.json POST /v1/collect","description":"Collect answers from a known phone number. Send instructions, optional context values in input, and a JSON Schema in output. Use the returned ID to retrieve the result, or provide a webhook_id. Development and Production can both place real calls.","href":"/api-reference/create-collection"}}}},"mdxExtracts":{"tableOfContents":[],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"17\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --fail-with-body\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> https://api.thred.dev/v1/collect\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --request\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --header\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Authorization: Bearer \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">$THRED_API_KEY\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --header\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type: application/json\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --data\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"to\": \"+14155550123\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"instructions\": \"Ask whether the business is open on the date in input and what time it closes.\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"input\": { \"date\": \"today\" },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"output\": {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"properties\": {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"is_open\": { \"type\": \"boolean\" },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"closes_at\": { \"type\": \"string\" }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"required\": [\"is_open\", \"closes_at\"],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"additionalProperties\": false\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"JavaScript","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"javascript\">\u003ccode language=\"javascript\" numberOfLines=\"24\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> response\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> fetch\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://api.thred.dev/v1/collect\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> method:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"POST\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> headers:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> Authorization:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> `Bearer \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">${\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">process\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">env\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\">THRED_API_KEY\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">`\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"application/json\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> body:\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> JSON\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">stringify\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">({\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> to:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"+14155550123\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> instructions:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Ask whether the business is open on the date in input and what time it closes.\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> input:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> { \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">date:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"today\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> output:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> properties:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> is_open:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> { \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">type:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"boolean\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> closes_at:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> { \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">type:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"string\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> required:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> [\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"is_open\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"closes_at\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"additionalProperties\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">:\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> false\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }),\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">});\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">if\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> (\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">!\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">response\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">ok\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">) \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">throw\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\"> new\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> Error\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">await\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> response\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">text\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">());\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> collection\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> response\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">json\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">();\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">console\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">log\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">collection\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">id\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Python","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"python\">\u003ccode language=\"python\" numberOfLines=\"26\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">import\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> os\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">import\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">response \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests.post(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"https://api.thred.dev/v1/collect\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> headers\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Authorization\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">f\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Bearer \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">{\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">os.environ[\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'THRED_API_KEY'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">]\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> json\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"to\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"+14155550123\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"instructions\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Ask whether the business is open on the date in input and what time it closes.\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"input\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: { \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"date\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"today\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"output\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"properties\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"is_open\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: { \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"boolean\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"closes_at\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: { \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"string\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"required\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"is_open\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"closes_at\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"additionalProperties\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">False\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> timeout\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">30\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">response.raise_for_status()\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">collection \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> response.json()\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">print\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(collection[\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">])\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"createCollection","tags":["Collect"],"summary":"Create a collection","description":"Collect answers from a known phone number. Send instructions, optional context values in input, and a JSON Schema in output. Use the returned ID to retrieve the result, or provide a webhook_id. Development and Production can both place real calls.","parameters":["1d7ec70a-5657-45f4-ad31-4f316f9f4304"],"requestBody":"a7429d21-016d-4e7d-9c98-3947e46e7a97","responses":{"202":"c27c4f4c-6515-450c-be88-1f91d4897a04","400":"9bee3f8c-c72b-4bbc-b2b8-aeb2e61c8581","401":"aa484d29-9ba0-4709-8426-c0216afd176d","409":"f0b7f6dd-5c38-4ffd-a928-ffc2bd4580f3","413":"d4dd6b61-9dba-4f3c-b353-15c2fe0f5bf3","429":"f8a39be9-08f7-4988-a1b0-5e960525a3f2","500":"a9706099-5abb-47e0-9539-024a894b48f6","503":"23242eaf-ceb5-45b4-ac9b-29f1af1a94ea"},"method":"post","type":"path","servers":["018fa0c6-8491-4098-bf8a-ea0196732702"],"security":["169d90c7-fab1-4290-a28c-41b56a1ae8f2"],"path":"/v1/collect","baseUrlOptions":["https://api.thred.dev"],"title":"Create a collection","codeSamples":[],"requestExampleLanguages":["bash","javascript","python"],"requiredOnlyExamples":true,"requestExamples":[{"dropdown":false,"language":"shellscript","code":{"type":"pre","key":null,"ref":null,"props":{"className":"shiki shiki-themes github-light-default dark-plus","style":{"backgroundColor":"#ffffff","--shiki-dark-bg":"#0B0C0E","color":"#1f2328","--shiki-dark":"#D4D4D4"},"language":"shellscript","children":{"type":"code","key":null,"ref":null,"props":{"language":"shellscript","numberOfLines":"17","children":[{"type":"span","key":"0","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#953800","--shiki-dark":"#DCDCAA"},"children":"curl"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":" --fail-with-body"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" https://api.thred.dev/v1/collect"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D7BA7D"},"children":" \\"}}]}},"\n",{"type":"span","key":"2","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":" --request"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" POST"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D7BA7D"},"children":" \\"}}]}},"\n",{"type":"span","key":"4","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":" --header"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"Authorization: Bearer "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":"$THRED_API_KEY"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\""}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D7BA7D"},"children":" \\"}}]}},"\n",{"type":"span","key":"6","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":" --header"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"Content-Type: application/json\""}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D7BA7D"},"children":" \\"}}]}},"\n",{"type":"span","key":"8","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":" --data"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" '{"}}]}},"\n",{"type":"span","key":"10","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"to\": \"+14155550123\","}}}},"\n",{"type":"span","key":"12","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"instructions\": \"Ask whether the business is open on the date in input and what time it closes.\","}}}},"\n",{"type":"span","key":"14","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"input\": { \"date\": \"today\" },"}}}},"\n",{"type":"span","key":"16","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"output\": {"}}}},"\n",{"type":"span","key":"18","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"properties\": {"}}}},"\n",{"type":"span","key":"20","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"is_open\": { \"type\": \"boolean\" },"}}}},"\n",{"type":"span","key":"22","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"closes_at\": { \"type\": \"string\" }"}}}},"\n",{"type":"span","key":"24","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" },"}}}},"\n",{"type":"span","key":"26","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"required\": [\"is_open\", \"closes_at\"],"}}}},"\n",{"type":"span","key":"28","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"additionalProperties\": false"}}}},"\n",{"type":"span","key":"30","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" }"}}}},"\n",{"type":"span","key":"32","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" }'"}}}},"\n"]}}}},"filename":"cURL"},{"dropdown":false,"language":"javascript","code":{"type":"pre","key":null,"ref":null,"props":{"className":"shiki shiki-themes github-light-default dark-plus","style":{"backgroundColor":"#ffffff","--shiki-dark-bg":"#0B0C0E","color":"#1f2328","--shiki-dark":"#D4D4D4"},"language":"javascript","children":{"type":"code","key":null,"ref":null,"props":{"language":"javascript","numberOfLines":"24","children":[{"type":"span","key":"0","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#569CD6"},"children":"const"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#4FC1FF"},"children":" response"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D4D4D4"},"children":" ="}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#C586C0"},"children":" await"}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#8250DF","--shiki-dark":"#DCDCAA"},"children":" fetch"}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"("}},{"type":"span","key":"6","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"https://api.thred.dev/v1/collect\""}},{"type":"span","key":"7","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":", {"}}]}},"\n",{"type":"span","key":"2","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":" method:"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"POST\""}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"4","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":" headers:"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" {"}}]}},"\n",{"type":"span","key":"6","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":" Authorization:"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" `Bearer "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#569CD6"},"children":"${"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":"process"}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#D4D4D4"},"children":"."}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":"env"}},{"type":"span","key":"6","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#D4D4D4"},"children":"."}},{"type":"span","key":"7","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#4FC1FF"},"children":"THRED_API_KEY"}},{"type":"span","key":"8","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#569CD6"},"children":"}"}},{"type":"span","key":"9","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"`"}},{"type":"span","key":"10","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"8","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"Content-Type\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":":"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"application/json\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"10","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" },"}}}},"\n",{"type":"span","key":"12","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":" body:"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#4FC1FF"},"children":" JSON"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"."}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#8250DF","--shiki-dark":"#DCDCAA"},"children":"stringify"}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"({"}}]}},"\n",{"type":"span","key":"14","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":" to:"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"+14155550123\""}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"16","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":" instructions:"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"Ask whether the business is open on the date in input and what time it closes.\""}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"18","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":" input:"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" { "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":"date:"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"today\""}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" },"}}]}},"\n",{"type":"span","key":"20","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":" output:"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" {"}}]}},"\n",{"type":"span","key":"22","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":" properties:"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" {"}}]}},"\n",{"type":"span","key":"24","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":" is_open:"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" { "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":"type:"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"boolean\""}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" },"}}]}},"\n",{"type":"span","key":"26","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":" closes_at:"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" { "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":"type:"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"string\""}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" }"}}]}},"\n",{"type":"span","key":"28","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" },"}}}},"\n",{"type":"span","key":"30","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":" required:"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" ["}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"is_open\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":", "}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"closes_at\""}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"],"}}]}},"\n",{"type":"span","key":"32","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"additionalProperties\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":":"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":" false"}}]}},"\n",{"type":"span","key":"34","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" }"}}}},"\n",{"type":"span","key":"36","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" }),"}}}},"\n",{"type":"span","key":"38","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"});"}}}},"\n",{"type":"span","key":"40","ref":null,"props":{"className":"line","children":null}},"\n",{"type":"span","key":"42","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#C586C0"},"children":"if"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" ("}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D4D4D4"},"children":"!"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":"response"}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"."}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":"ok"}},{"type":"span","key":"6","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":") "}},{"type":"span","key":"7","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#C586C0"},"children":"throw"}},{"type":"span","key":"8","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#569CD6"},"children":" new"}},{"type":"span","key":"9","ref":null,"props":{"style":{"color":"#8250DF","--shiki-dark":"#DCDCAA"},"children":" Error"}},{"type":"span","key":"10","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"("}},{"type":"span","key":"11","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#C586C0"},"children":"await"}},{"type":"span","key":"12","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":" response"}},{"type":"span","key":"13","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"."}},{"type":"span","key":"14","ref":null,"props":{"style":{"color":"#8250DF","--shiki-dark":"#DCDCAA"},"children":"text"}},{"type":"span","key":"15","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"());"}}]}},"\n",{"type":"span","key":"44","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#569CD6"},"children":"const"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#4FC1FF"},"children":" collection"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D4D4D4"},"children":" ="}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#C586C0"},"children":" await"}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":" response"}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"."}},{"type":"span","key":"6","ref":null,"props":{"style":{"color":"#8250DF","--shiki-dark":"#DCDCAA"},"children":"json"}},{"type":"span","key":"7","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"();"}}]}},"\n",{"type":"span","key":"46","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":"console"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"."}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#8250DF","--shiki-dark":"#DCDCAA"},"children":"log"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"("}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":"collection"}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"."}},{"type":"span","key":"6","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":"id"}},{"type":"span","key":"7","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":");"}}]}},"\n"]}}}},"filename":"JavaScript"},{"dropdown":false,"language":"python","code":{"type":"pre","key":null,"ref":null,"props":{"className":"shiki shiki-themes github-light-default dark-plus","style":{"backgroundColor":"#ffffff","--shiki-dark-bg":"#0B0C0E","color":"#1f2328","--shiki-dark":"#D4D4D4"},"language":"python","children":{"type":"code","key":null,"ref":null,"props":{"language":"python","numberOfLines":"26","children":[{"type":"span","key":"0","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#C586C0"},"children":"import"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" os"}}]}},"\n",{"type":"span","key":"2","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#C586C0"},"children":"import"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" requests"}}]}},"\n",{"type":"span","key":"4","ref":null,"props":{"className":"line","children":null}},"\n",{"type":"span","key":"6","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"response "}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D4D4D4"},"children":"="}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" requests.post("}}]}},"\n",{"type":"span","key":"8","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"https://api.thred.dev/v1/collect\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"10","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#953800","--shiki-dark":"#9CDCFE"},"children":" headers"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D4D4D4"},"children":"="}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"{"}}]}},"\n",{"type":"span","key":"12","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"Authorization\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#569CD6"},"children":"f"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"Bearer "}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#569CD6"},"children":"{"}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"os.environ["}},{"type":"span","key":"6","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"'THRED_API_KEY'"}},{"type":"span","key":"7","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"]"}},{"type":"span","key":"8","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#569CD6"},"children":"}"}},{"type":"span","key":"9","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\""}},{"type":"span","key":"10","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"14","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" },"}}}},"\n",{"type":"span","key":"16","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#953800","--shiki-dark":"#9CDCFE"},"children":" json"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D4D4D4"},"children":"="}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"{"}}]}},"\n",{"type":"span","key":"18","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"to\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"+14155550123\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"20","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"instructions\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"Ask whether the business is open on the date in input and what time it closes.\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"22","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"input\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": { "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"date\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"today\""}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" },"}}]}},"\n",{"type":"span","key":"24","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"output\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": {"}}]}},"\n",{"type":"span","key":"26","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"properties\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": {"}}]}},"\n",{"type":"span","key":"28","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"is_open\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": { "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"type\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"boolean\""}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" },"}}]}},"\n",{"type":"span","key":"30","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"closes_at\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": { "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"type\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"string\""}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" }"}}]}},"\n",{"type":"span","key":"32","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" },"}}}},"\n",{"type":"span","key":"34","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"required\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": ["}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"is_open\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":", "}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"closes_at\""}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"],"}}]}},"\n",{"type":"span","key":"36","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"additionalProperties\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":"False"}}]}},"\n",{"type":"span","key":"38","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" }"}}}},"\n",{"type":"span","key":"40","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" },"}}}},"\n",{"type":"span","key":"42","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#953800","--shiki-dark":"#9CDCFE"},"children":" timeout"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D4D4D4"},"children":"="}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#B5CEA8"},"children":"30"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"44","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":")"}}}},"\n",{"type":"span","key":"46","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"response.raise_for_status()"}}}},"\n",{"type":"span","key":"48","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"collection "}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D4D4D4"},"children":"="}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" response.json()"}}]}},"\n",{"type":"span","key":"50","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#DCDCAA"},"children":"print"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"(collection["}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"id\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"])"}}]}},"\n"]}}}},"filename":"Python"}],"requestExampleType":"mdx","responseExampleType":"generated"},"dependencies":{"parameters":{"1d7ec70a-5657-45f4-ad31-4f316f9f4304":{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional key for retrying a request without creating another collection. Omit it to create a new collection on each POST. Reuse the same key only with the same request; a different request returns 409. Use 1–200 printable, non-space ASCII characters.","schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[!-~]{1,200}$","isRequired":false,"description":"Optional key for retrying a request without creating another collection. Omit it to create a new collection on each POST. Reuse the same key only with the same request; a different request returns 409. Use 1–200 printable, non-space ASCII characters.","uniqueKey":"","typeLabel":"string"},"example":"business-hours-001"}},"requestBody":{"required":true,"description":"The destination, task, input context, and output JSON Schema.","content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$","example":"+14155550123","description":"Destination phone number in E.164 format.","isRequired":true,"uniqueKey":"to","typeLabel":"string"},"instructions":{"type":"string","minLength":1,"maxLength":8000,"description":"What you want to find out. Thred manages conversation, navigation, and assistance. Must contain non-whitespace text.","isRequired":true,"uniqueKey":"instructions","typeLabel":"string"},"output":{"type":"object","properties":{"properties":{"type":"object","description":"Object fields. Names must contain 1–120 characters and cannot be __proto__, prototype, or constructor.","additionalProperties":{"type":"object","properties":{"type":{"oneOf":[{"type":"string","description":"One supported type, or an array containing one supported non-null type and null. An object schema must include properties and additionalProperties: false; an array schema must include items.","enum":["object","array","string","number","integer","boolean","null"],"isRequired":true,"uniqueKey":"output.properties.additionalProperties.type.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"array","items":{"type":"string","enum":["object","array","string","number","integer","boolean","null"],"uniqueKey":"output.properties.additionalProperties.type.oneOf.1.items.[INDEX]","typeLabel":"enum\u003cstring>"},"description":"One supported type, or an array containing one supported non-null type and null. An object schema must include properties and additionalProperties: false; an array schema must include items.","maxItems":2,"minItems":1,"uniqueItems":true,"isRequired":true,"uniqueKey":"output.properties.additionalProperties.type.oneOf.1","typeLabel":"enum\u003cstring>[]"}],"isRequired":true,"uniqueKey":"output.properties.additionalProperties.type","typeLabel":"enum\u003cstring> | enum\u003cstring>[]"},"description":{"type":"string","maxLength":2000,"description":"Explain what the answer should contain.","uniqueKey":"output.properties.additionalProperties.description","typeLabel":"string"},"title":{"type":"string","maxLength":2000,"uniqueKey":"output.properties.additionalProperties.title","typeLabel":"string"},"properties":{"type":"object","description":"Object fields. Names must contain 1–120 characters and cannot be __proto__, prototype, or constructor.","additionalProperties":{"type":"object","additionalProperties":true,"description":"A nested schema with the same supported fields. Every node needs type; objects need properties and additionalProperties: false; arrays need items.","uniqueKey":"output.properties.additionalProperties.properties.additionalProperties","typeLabel":"object"},"uniqueKey":"output.properties.additionalProperties.properties","typeLabel":"object"},"required":{"type":"array","description":"Unique names declared in properties. Required answers that cannot be obtained prevent a completed result.","uniqueItems":true,"items":{"type":"string","uniqueKey":"output.properties.additionalProperties.required.items.[INDEX]","typeLabel":"string"},"uniqueKey":"output.properties.additionalProperties.required","typeLabel":"string[]"},"additionalProperties":{"type":"boolean","enum":[false],"description":"Required and always false for every object schema.","uniqueKey":"output.properties.additionalProperties.\\additionalProperties","typeLabel":"enum\u003cboolean>"},"items":{"type":"object","additionalProperties":true,"description":"The schema for each array item, using the same supported fields.","uniqueKey":"output.properties.additionalProperties.\\items","typeLabel":"object"},"enum":{"type":"array","minItems":1,"maxItems":100,"items":{"oneOf":[{"type":"string","uniqueKey":"output.properties.additionalProperties.enum.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"output.properties.additionalProperties.enum.items.[INDEX].oneOf.1","typeLabel":"null"},{"type":"number","uniqueKey":"output.properties.additionalProperties.enum.items.[INDEX].oneOf.2","typeLabel":"number"},{"type":"boolean","uniqueKey":"output.properties.additionalProperties.enum.items.[INDEX].oneOf.3","typeLabel":"boolean"}],"uniqueKey":"output.properties.additionalProperties.enum.items.[INDEX]","typeLabel":"string | null | number | boolean"},"description":"Primitive string, number, boolean, or null values. Each value must satisfy the declared type and bounds.","uniqueKey":"output.properties.additionalProperties.enum","typeLabel":"(string | null | number | boolean)[]"},"minItems":{"type":"integer","minimum":0,"maximum":10000,"uniqueKey":"output.properties.additionalProperties.minItems","typeLabel":"integer"},"maxItems":{"type":"integer","minimum":0,"maximum":10000,"uniqueKey":"output.properties.additionalProperties.maxItems","typeLabel":"integer"},"minLength":{"type":"integer","minimum":0,"maximum":10000,"uniqueKey":"output.properties.additionalProperties.minLength","typeLabel":"integer"},"maxLength":{"type":"integer","minimum":0,"maximum":10000,"uniqueKey":"output.properties.additionalProperties.maxLength","typeLabel":"integer"},"minimum":{"type":"number","uniqueKey":"output.properties.additionalProperties.minimum","typeLabel":"number"},"maximum":{"type":"number","uniqueKey":"output.properties.additionalProperties.maximum","typeLabel":"number"}},"required":["type"],"description":"Supported JSON Schema fields. Maximum 128 nodes and 8 nesting levels below the root. Keywords must match their type; minimum bounds cannot exceed maximum bounds.","additionalProperties":false,"uniqueKey":"output.properties.additionalProperties","typeLabel":"object"},"isRequired":true,"uniqueKey":"output.properties","typeLabel":"object"},"additionalProperties":{"type":"boolean","enum":[false],"description":"Required and always false for every object schema.","isRequired":true,"uniqueKey":"output.\\additionalProperties","typeLabel":"enum\u003cboolean>"},"type":{"type":"string","enum":["object"],"description":"Optional. The output root is always an object; omit this field when creating a collection.","default":"object","uniqueKey":"output.type","typeLabel":"enum\u003cstring>"},"description":{"type":"string","maxLength":2000,"description":"Explain what the answer should contain.","uniqueKey":"output.description","typeLabel":"string"},"title":{"type":"string","maxLength":2000,"uniqueKey":"output.title","typeLabel":"string"},"required":{"type":"array","description":"Unique names declared in properties. Required answers that cannot be obtained prevent a completed result.","uniqueItems":true,"items":{"type":"string","uniqueKey":"output.required.items.[INDEX]","typeLabel":"string"},"uniqueKey":"output.required","typeLabel":"string[]"}},"required":["properties","additionalProperties"],"description":"The JSON Schema defining the answers returned in data. The output root is always an object, so no top-level type is needed. Define properties and required fields, and set additionalProperties to false.","additionalProperties":false,"example":{"properties":{"is_open":{"type":"boolean"},"closes_at":{"type":"string"}},"required":["is_open","closes_at"],"additionalProperties":false},"isRequired":true,"uniqueKey":"output","typeLabel":"object"},"input":{"type":"object","additionalProperties":true,"default":{},"description":"Known context values for the call, such as a date, product name, or reference number. Must be a JSON object; optional and defaults to an empty object. Up to 16,000 bytes of JSON. Maximum depth: 32; maximum values: 8,192.","example":{"date":"today"},"uniqueKey":"input","typeLabel":"object"},"max_duration_seconds":{"type":"integer","default":300,"minimum":30,"maximum":1800,"description":"Maximum job duration. Your workspace and environment may have a lower limit.","uniqueKey":"max_duration_seconds","typeLabel":"integer"},"caller_number_id":{"type":"string","minLength":1,"maxLength":160,"description":"Enabled caller number ID belonging to the same workspace and environment. Omit to use the environment default.","uniqueKey":"caller_number_id","typeLabel":"string"},"webhook_id":{"type":"string","minLength":1,"maxLength":160,"description":"Enabled webhook endpoint ID from your dashboard, in the same workspace and environment. Omit to poll for results.","uniqueKey":"webhook_id","typeLabel":"string"},"navigation":{"type":"object","properties":{"contact_name":{"type":"string","minLength":1,"maxLength":160,"description":"Person to ask for.","uniqueKey":"navigation.contact_name","typeLabel":"string"},"department":{"type":"string","minLength":1,"maxLength":160,"description":"Department to reach.","uniqueKey":"navigation.department","typeLabel":"string"},"extension":{"type":"string","minLength":1,"maxLength":16,"pattern":"^[0-9]+$","description":"Extension hint, used when an appropriate extension-entry prompt is heard.","uniqueKey":"navigation.extension","typeLabel":"string"},"language":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[a-zA-Z]{2,3}(?:-[a-zA-Z0-9]{2,8}){0,3}$","example":"en","description":"Language tag, such as en or fr-CA.","uniqueKey":"navigation.language","typeLabel":"string"}},"description":"Optional routing hints. IVR navigation is automatic. Custom routes, actions, and navigation policy overrides are not accepted.","additionalProperties":false,"uniqueKey":"navigation","typeLabel":"object"},"screener_sequence":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":500,"description":"Approved spoken copy; must contain non-whitespace text.","isRequired":true,"uniqueKey":"screener_sequence.items.[INDEX].message","typeLabel":"string"},"type":{"type":"string","enum":["intro","detail"],"description":"The first message must be intro; all later messages must be detail.","isRequired":true,"uniqueKey":"screener_sequence.items.[INDEX].type","typeLabel":"enum\u003cstring>"}},"required":["message","type"],"additionalProperties":false,"uniqueKey":"screener_sequence.items.[INDEX]","typeLabel":"object"},"description":"An intro followed by optional detail messages for screeners. If omitted, Thred prepares a sequence from the task and input before dialing.","uniqueKey":"screener_sequence","typeLabel":"object[]"},"metadata":{"type":"object","additionalProperties":true,"default":{},"description":"Your tracking fields, up to 4,000 bytes of JSON. Maximum depth: 32; maximum values: 8,192.","uniqueKey":"metadata","typeLabel":"object"},"record":{"type":"boolean","default":false,"description":"Recording is currently disabled. Leave false or omit; true returns 503.","uniqueKey":"record","typeLabel":"boolean"}},"required":["to","instructions","output"],"description":"Send UTF-8 JSON, up to 64 KiB. Unknown fields are rejected.","additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"example":{"to":"+14155550123","instructions":"Ask whether the business is open on the date in input and what time it closes.","input":{"date":"today"},"output":{"properties":{"is_open":{"type":"boolean"},"closes_at":{"type":"string"}},"required":["is_open","closes_at"],"additionalProperties":false}},"examples":{"Example":{"title":"Example","value":{"to":"+14155550123","instructions":"Ask whether the business is open on the date in input and what time it closes.","input":{"date":"today"},"output":{"properties":{"is_open":{"type":"boolean"},"closes_at":{"type":"string"}},"required":["is_open","closes_at"],"additionalProperties":false}}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"c27c4f4c-6515-450c-be88-1f91d4897a04":{"description":"New collection accepted, or an existing idempotent request returned.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"call_123e4567-e89b-42d3-a456-426614174000","description":"The collection ID, using the call_ prefix. Use it to retrieve or cancel the collection.","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"status":{"type":"string","enum":["queued","dialing","in_progress","processing","awaiting_review","completed","incomplete","failed","canceled"],"description":"Final: completed, incomplete, failed, canceled. Continue polling for all other statuses.","isRequired":true,"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"reused":{"type":"boolean","description":"True when the same idempotency key and normalized request already existed. No new collection is created.","example":false,"isRequired":true,"uniqueKey":"reused","typeLabel":"boolean"},"environment":{"type":"string","enum":["development","production"],"description":"The API key selects the workspace environment. Development and Production are isolated, but either can place real calls when enabled.","isRequired":true,"uniqueKey":"environment","typeLabel":"enum\u003cstring>"}},"required":["id","status","reused","environment"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"call_123e4567-e89b-42d3-a456-426614174000","status":"queued","reused":false,"environment":"development"}}},"exampleType":"generated"}},"exampleType":"generated"},"9bee3f8c-c72b-4bbc-b2b8-aeb2e61c8581":{"description":"Invalid request, schema, destination, duration, caller number, webhook, or date range. Inspect error.code and error.message.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable error explanation.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"aa484d29-9ba0-4709-8426-c0216afd176d":{"description":"Missing, malformed, invalid, revoked, or environment-mismatched bearer API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable error explanation.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"f0b7f6dd-5c38-4ffd-a928-ffc2bd4580f3":{"description":"This idempotency key already belongs to a different normalized request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable error explanation.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"d4dd6b61-9dba-4f3c-b353-15c2fe0f5bf3":{"description":"The UTF-8 request body exceeds 64 KiB.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable error explanation.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"f8a39be9-08f7-4988-a1b0-5e960525a3f2":{"description":"The workspace or environment concurrent-call, per-minute, or maximum-duration limit was exceeded. Codes: capacity_exceeded, rate_limited, or limit_exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable error explanation.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"a9706099-5abb-47e0-9539-024a894b48f6":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable error explanation.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"23242eaf-ceb5-45b4-ac9b-29f1af1a94ea":{"description":"Calling or the backend is unavailable. Codes include calling_unavailable, environment_unavailable, not_configured, and backend_unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable error explanation.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"169d90c7-fab1-4290-a28c-41b56a1ae8f2":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"Thred API key","description":"Send Authorization: Bearer \u003cTHRED_API_KEY>. Development keys begin thr_dev_; Production keys begin thr_prod_. Each key is scoped to a workspace and environment. Keep secrets on your server.","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"018fa0c6-8491-4098-bf8a-ea0196732702":{"url":"https://api.thred.dev","description":"Thred API"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"Thred API key","description":"Send Authorization: Bearer \u003cTHRED_API_KEY>. Development keys begin thr_dev_; Production keys begin thr_prod_. Each key is scoped to a workspace and environment. Keep secrets on your server.","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Send Authorization: Bearer \u003cTHRED_API_KEY>. Development keys begin thr_dev_; Production keys begin thr_prod_. Each key is scoped to a workspace and environment. Keep secrets on your server.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"pop101","siteName":"Thred API","title":"Create a collection - Thred API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-31T03:26:05.590Z","originalFileLocation":"api-reference/create-collection.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Collect answers from a known phone number. Send instructions, optional context values in input, and a JSON Schema in output. Use the returned ID to retrieve the result, or provide a webhook_id. Development and Production can both place real calls.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Thred API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/pop101/j0nmZA184tfqmqT0/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/pop101/j0nmZA184tfqmqT0/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/pop101/j0nmZA184tfqmqT0/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/pop101/j0nmZA184tfqmqT0/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/pop101/j0nmZA184tfqmqT0/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/pop101/j0nmZA184tfqmqT0/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/pop101/j0nmZA184tfqmqT0/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/pop101/j0nmZA184tfqmqT0/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/pop101/j0nmZA184tfqmqT0/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create a collection - Thred API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Collect answers from a known phone number. Send instructions, optional context values in input, and a JSON Schema in output. Use the returned ID to retrieve the result, or provide a webhook_id. Development and Production can both place real calls.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Thred API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://www.thred.dev/api-reference/create-collection\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://pop101.mintlify.app/_mintlify/api/og/v2?division=Collect+API\u0026amp;title=Create+a+collection\u0026amp;description=Collect+answers+from+a+known+phone+number.+Send+instructions%2C+optional+context+values+in+input%2C+and+a+JSON+Schema+in+output.+Use+the+returned+ID+to+retrieve+the\u0026amp;theme=d17339659d3ab7261c0da2d6\u0026amp;signature=1529e2c5ca1fbab7fb9d5f4adf21f10fb609aaf4a4f4ab0f666c64a4c91c8f21\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create a collection - Thred API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Collect answers from a known phone number. Send instructions, optional context values in input, and a JSON Schema in output. Use the returned ID to retrieve the result, or provide a webhook_id. Development and Production can both place real calls.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://pop101.mintlify.app/_mintlify/api/og/v2?division=Collect+API\u0026amp;title=Create+a+collection\u0026amp;description=Collect+answers+from+a+known+phone+number.+Send+instructions%2C+optional+context+values+in+input%2C+and+a+JSON+Schema+in+output.+Use+the+returned+ID+to+retrieve+the\u0026amp;theme=d17339659d3ab7261c0da2d6\u0026amp;signature=1529e2c5ca1fbab7fb9d5f4adf21f10fb609aaf4a4f4ab0f666c64a4c91c8f21\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/pop101/j0nmZA184tfqmqT0/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Thred API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3AA4C1\">\u003clink data-mint-head rel=\"canonical\" href=\"https://www.thred.dev/api-reference/create-collection\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/create-collection.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://www.thred.dev/#organization\",\"name\":\"Thred API\",\"url\":\"https://www.thred.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/pop101/o-sRhnCnjLqfHGe3/images/logo_full_dark.png?fit=max\u0026auto=format\u0026n=o-sRhnCnjLqfHGe3\u0026q=85\u0026s=acd9058a2fc6c122b1b200877b0d36dd\"}},{\"@type\":\"WebSite\",\"@id\":\"https://www.thred.dev#website\",\"name\":\"Thred API\",\"url\":\"https://www.thred.dev\",\"publisher\":{\"@id\":\"https://www.thred.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://www.thred.dev/api-reference/create-collection#webpage\",\"url\":\"https://www.thred.dev/api-reference/create-collection\",\"name\":\"Create a collection\",\"description\":\"Collect answers from a known phone number. Send instructions, optional context values in input, and a JSON Schema in output. Use the returned ID to retrieve the result, or provide a webhook_id. Development and Production can both place real calls.\",\"dateModified\":\"2026-10-31T03:26:05.590Z\",\"isPartOf\":{\"@id\":\"https://www.thred.dev#website\"},\"breadcrumb\":{\"@id\":\"https://www.thred.dev/api-reference/create-collection#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://www.thred.dev/api-reference/create-collection#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thred API\",\"item\":\"https://www.thred.dev\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a collection\",\"item\":\"https://www.thred.dev/api-reference/create-collection\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://www.thred.dev/api-reference/create-collection#apireference\",\"headline\":\"Create a collection\",\"name\":\"Create a collection\",\"description\":\"Collect answers from a known phone number. Send instructions, optional context values in input, and a JSON Schema in output. Use the returned ID to retrieve the result, or provide a webhook_id. Development and Production can both place real calls.\",\"url\":\"https://www.thred.dev/api-reference/create-collection\",\"mainEntityOfPage\":{\"@id\":\"https://www.thred.dev/api-reference/create-collection#webpage\"},\"dateModified\":\"2026-10-31T03:26:05.590Z\",\"publisher\":{\"@id\":\"https://www.thred.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://www.thred.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Thred API\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Thred API","nav":{"global":null,"groups":[{"group":"Get started","pages":[{"title":"Thred API","icon":"phone","href":"/introduction"},{"title":"Quickstart","icon":"bolt","href":"/quickstart"},{"title":"What you can build","description":"Turn questions that require a phone call into structured answers.","href":"/guides/what-you-can-build"}]},{"group":"Collect API","pages":[{"title":"Create a collection","openapi":"api-reference/openapi.json POST /v1/collect","href":"/api-reference/create-collection"},{"title":"Get a collection","openapi":"api-reference/openapi.json GET /v1/collect/{id}","description":"Get the latest collection status and results. Keep polling until status is completed, incomplete, failed, or canceled. Read completed answers from data and incomplete answers from partial_data.","href":"/api-reference/get-collection"},{"title":"List collections","openapi":"api-reference/openapi.json GET /v1/collect","href":"/api-reference/list-collections"},{"title":"Cancel a collection","openapi":"api-reference/openapi.json POST /v1/collect/{id}/cancel","href":"/api-reference/cancel-collection"},{"title":"Get a recording","openapi":"api-reference/openapi.json GET /v1/collect/{id}/recording","href":"/api-reference/get-recording"}]},{"group":"Account and utilities","pages":[{"title":"Check your API key","openapi":"api-reference/openapi.json GET /v1/auth/me","href":"/api-reference/authentication"},{"title":"Get usage","openapi":"api-reference/openapi.json GET /v1/usage","href":"/api-reference/get-usage"},{"title":"Check API health","openapi":"api-reference/openapi.json GET /v1/health","href":"/api-reference/health"}]}]},"basePath":"","title":"Create a collection - Thred API","buildId":"dpl_G9nrg4qeJSZtah1Ziwbc2n6WkLch","deploymentId":"dpl_G9nrg4qeJSZtah1Ziwbc2n6WkLch","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-B7XKH4J3.js","utils-lOYzL7z-.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DF6jUUIM.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Dpsj5f7C.js","snippetPresets-CYeiDe8v.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CUFz1YZ_.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-D8H_iLS4.js","shallow-DdluZBHX.js","getApiPlaygroundDisplay-B9922vev.js","CodeSnippet-CMoRNGYs.js","CodeSnippets-DwyrPHuw.js","Page-DSVu9Ucl.js","getPastedJson-G-zIvlHh.js","icon-B03fnEy0.js","MethodPill-CW7teklc.js","DuplicateIcon-CtO8eekd.js","createIcon-DZTKdM_A.js","DynamicMarkdown-D5M2At0B.js","SectionHeading-C_2NaA2U.js","axios-vUo_bRtp.js","Markdown-D7QRHV3m.js","clsx-D1Z-ELXV.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-lvhuD9Du.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-CKfC4ywL.js"]}