Create Session
Sessions
Create Session
Start a new autonomous agent session
POST
Create Session
Start a new agent session on a phone. The session creates a sandboxed environment where an AI agent autonomously executes your instruction.Documentation Index
Fetch the complete documentation index at: https://docs.tapkit.ai/llms.txt
Use this file to discover all available pages before exploring further.
Request
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
phone_id | string | Yes | The phone to run the session on |
instruction | string | Yes | What the agent should do |
Response
Status: 201 CreatedResponse Fields
| Field | Type | Description |
|---|---|---|
id | string | Session identifier |
phone_id | string | Phone the session is running on |
instruction | string | The original instruction |
status | string | creating, running, paused, completed, failed, or killed |
cost_usd | number | null | Cost in USD (populated after completion) |
duration_ms | integer | null | Duration in milliseconds (populated after completion) |
num_turns | integer | null | Number of agent turns (populated after completion) |
error | string | null | Error message if the session failed |
created_at | string | ISO 8601 creation timestamp |
started_at | string | null | ISO 8601 timestamp when the session started running |
completed_at | string | null | ISO 8601 timestamp when the session finished |
Examples
Python
Poll Until Complete
Related Endpoints
- List Sessions - List all sessions
- Get Session - Get session details
- Get Events - Poll for session events
- Stop Session - Kill a running session