Skip to main content
POST
/
v1
/
threads
Create Thread
curl --request POST \
  --url https://api.example.com/v1/threads

Endpoint

POST https://tako.com/api/v1/threads

Authentication

Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY

Request Body

All parameters are optional. You can create an empty thread or initialize it with context.
ParameterTypeDescription
in_focus_card_idstringOptional. Card ID to focus the conversation on for follow-up questions
file_sourcesarrayOptional. Array of file objects with name and url for data analysis
csvstringOptional. Inline CSV data to analyze

Example Requests

Create Empty Thread

curl -X POST https://tako.com/api/v1/threads \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
Response:
{
  "thread_id": "thread_abc123"
}

Create Thread with In-Focus Card

When you want to ask follow-up questions about a specific visualization:
curl -X POST https://tako.com/api/v1/threads \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "in_focus_card_id": "card_xyz789"
  }'
Response:
{
  "thread_id": "thread_abc123",
  "in_focus_card_id": "card_xyz789"
}

Create Thread with File Sources

When you have data files for Tako to analyze:
curl -X POST https://tako.com/api/v1/threads \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file_sources": [
      {
        "name": "Q4_sales_data.csv",
        "url": "https://example.com/data/q4_sales.csv"
      }
    ]
  }'

Create Thread with Inline CSV

Pass CSV data directly instead of using file URLs:
curl -X POST https://data.tako.com/api/v1/threads \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "csv": "product,revenue,units_sold\nWidget A,50000,1200\nWidget B,45000,980\nWidget C,38000,850"
  }'

Notes

  • To authenticate, you’ll need a Tako API key.
  • Thread creation and message sending are separate operations—you cannot include a message when creating a thread.
  • After creating a thread, use the Create Thread Message endpoint to add messages.
  • In-Focus Card: Use in_focus_card_id when users want to ask follow-up questions about a specific visualization.
  • File Sources: Include file_sources when you have data files (CSV, JSON, etc.) that Tako should analyze.
  • Inline CSV: Use the csv field to pass CSV data directly without needing a URL.