Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/21st-dev/1code/llms.txt

Use this file to discover all available pages before exploring further.

Create Task

Create a new agent task to run in a cloud sandbox.
curl -X POST https://1code.dev/api/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "repository": "https://github.com/your-org/your-repo",
    "prompt": "Fix the failing CI tests in the auth module",
    "branch": "main",
    "model": "claude-sonnet-4"
  }'

Request Body

repository
string
required
GitHub repository URL (HTTPS or SSH format)
prompt
string
required
Task description for the agent
branch
string
default:"main"
Base branch to work from
model
string
default:"claude-sonnet-4"
AI model to use. Options: claude-sonnet-4, claude-opus-4, codex
webhook_url
string
URL to receive webhook notifications when the task completes
auto_merge
boolean
default:false
Automatically merge the PR if all checks pass

Response

id
string
Unique task identifier
status
string
Current task status: queued, running, completed, failed
repository
string
Repository URL
prompt
string
Task prompt
branch
string
Base branch
model
string
AI model used
created_at
string
ISO 8601 timestamp
sandbox_url
string
Live browser preview URL (available when sandbox is ready)

Get Task

Retrieve the status and details of a specific task.
curl https://1code.dev/api/v1/tasks/task_abc123 \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

id
string
Task identifier
status
string
Current status: queued, running, completed, failed
pr_url
string
GitHub pull request URL (available when PR is created)
pr_number
number
GitHub pull request number
sandbox_url
string
Live browser preview URL
commits
array
Array of commit objects with sha, message, and timestamp
error
string
Error message if task failed
completed_at
string
ISO 8601 timestamp when task completed

Send Follow-up Message

Send additional instructions to a running task.
curl -X POST https://1code.dev/api/v1/tasks/task_abc123/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Also add unit tests for the fixed code"
  }'

Request Body

message
string
required
Follow-up instruction for the agent

Response

message_id
string
Unique message identifier
task_id
string
Parent task identifier
status
string
Message processing status

List Tasks

Retrieve all tasks for your account.
curl https://1code.dev/api/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY"

Query Parameters

status
string
Filter by status: queued, running, completed, failed
repository
string
Filter by repository URL
limit
number
default:50
Number of tasks to return (max 100)
offset
number
default:0
Pagination offset

Response

tasks
array
Array of task objects
total
number
Total number of tasks matching the filters
limit
number
Number of tasks returned
offset
number
Pagination offset

Cancel Task

Cancel a running task.
curl -X POST https://1code.dev/api/v1/tasks/task_abc123/cancel \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

id
string
Task identifier
status
string
Updated status: cancelled
cancelled_at
string
ISO 8601 timestamp

Error Codes

CodeDescription
400Invalid request parameters
401Missing or invalid API key
404Task not found
429Rate limit exceeded
500Internal server error

Build docs developers (and LLMs) love