1. Get your API key
Open the dashboard, select your workspace and environment, then go to Settings → API keys → Create API key. Copy the key when it appears and keep it on your server.https://api.thred.dev.
Choose cURL, JavaScript, or Python below. JavaScript runs on your server with Node.js: save a snippet as example.mjs and run node example.mjs. For Python, install Requests with python -m pip install requests. All snippets read the API key set above.
Before calling, check Settings → Calling and Settings → Phone numbers to confirm calling is enabled and an enabled default caller number is configured. Development calls also dial real phone numbers.
2. Start a collection
Replaceto with the phone number you want to call, including its country code. Put known context values in input and define the answers you want as a JSON Schema in output. Here, input.date tells Thred which day to ask about. input is optional and defaults to an empty object. The output is always an object, so no top-level type is needed.
202 Accepted with the collection’s ID. IDs use the call_ prefix:
3. Get the answer
Replace the example ID with the ID returned by your collection:status is completed, incomplete, failed, or canceled. While the status is processing or awaiting_review, the result is still being prepared.
A completed response includes your answers in data:
Result excerpt
incomplete, use the answers in partial_data and check missing_fields. A failed or canceled collection may have no result.
That’s the basic flow. Change instructions, input, and output to build your own use case, or see Create a collection for all available fields.
