Create a new conversation thread with optional metadata, assistant configuration, and visibility settings. All fields are optional, allowing you to create an empty thread and configure it later.
messages array optional
Array of initial messages to add to the thread. Each message must have a role and content.
Show message structure
role string required
The role of the message. One of user, assistant, or system.
content string required
The text content of the message.
Example: [{"role": "user", "content": "Hello, I need help with billing"}]
metadata object optional
Custom key-value pairs for attaching structured information to the thread. Maximum 16 key-value pairs. Keys must be ≤64 characters, values ≤512 characters.
Example: {"category": "support", "priority": "high", "tags": ["billing", "urgent"]}
assistantId string optional
ID of the assistant to bind to this thread. When provided, the assistant's configuration will be applied to all responses in this thread.
visibleInUi boolean optional · Defaults to true
Whether this thread should be visible in the user interface. Requires Bearer token authentication (not API key).
title string optional
Display name for the thread. Maximum 200 characters. If not provided, can be generated later using the Generate AI Name endpoint.
organizationId string required
Organization ID for scoping. All API requests must be scoped to an organization for billing, access control, and resource management. Find your organization ID in Freddy Hub → Settings → Organization.
- Bash
- Python
- JavaScript
curl https://api.freddy.aitronos.com/v1/threads \
-H "Authorization: Bearer $FREDDY_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'{
"id": "thread_abc123",
"object": "thread",
"createdAt": 1741476542,
"updatedAt": 1741476600,
"metadata": {
"category": "support",
"priority": "high",
"tags": ["billing", "urgent"]
},
"assistantId": "asst_support_agent",
"organizationId": "ORG_123",
"userId": "uid_user123",
"title": "Customer Support Query",
"visibleInUi": true,
"messageCount": 0,
"status": "inactive"
}