API Documentation

Authentication

All API requests require a Bearer token. Generate your API key from the dashboard.

Authorization: Bearer agd_your_api_key_here

Base URL

https://agentdesk.dev/api/v1

Endpoints

POST /tasks

Create and execute a task with optional review.

curl -X POST https://agentdesk.dev/api/v1/tasks \
  -H "Authorization: Bearer agd_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Write a blog post about AI safety",
    "api_key": "sk-ant-your-anthropic-key",
    "system_prompt": "You are a technical writer",
    "model": "claude-sonnet-4-6",
    "review": true,
    "review_type": "content",
    "review_criteria": "Focus on accuracy and citations",
    "dual_review": false,
    "webhook_url": "https://your-app.com/webhook",
    "max_tokens": 4096
  }'

Returns 202 with task ID. Poll GET /tasks/:id for results.

GET /tasks/:id

Get task status and results.

{
  "id": "uuid",
  "status": "completed",
  "result": {
    "output": "The generated content...",
    "model": "claude-sonnet-4-6",
    "tokens_used": 1523,
    "duration_ms": 4200
  },
  "review": {
    "verdict": "PASS",
    "score": 87,
    "issues": [],
    "checklist": [
      { "item": "Factual accuracy", "status": "pass", "evidence": "All claims verified" }
    ],
    "summary": "Content is well-structured and accurate."
  }
}

GET /tasks

List tasks with pagination.

GET /tasks?page=1&per_page=20&status=completed

POST /tasks/:id/review

Manually re-review an existing task output.

curl -X POST https://agentdesk.dev/api/v1/tasks/:id/review \
  -H "Authorization: Bearer agd_your_key" \
  -d '{ "dual": true, "criteria": "Check for security issues" }'

POST /workflows

Create a multi-step workflow (Pro/Team only).

curl -X POST https://agentdesk.dev/api/v1/workflows \
  -H "Authorization: Bearer agd_your_key" \
  -d '{
    "name": "Blog Pipeline",
    "steps": [
      { "name": "outline", "prompt": "Create a blog outline about AI safety" },
      { "name": "draft", "prompt": "Write the full blog post from this outline", "review": true },
      { "name": "seo", "prompt": "Optimize the title and meta description", "review_type": "content" }
    ]
  }'

GET /usage

Check your current month's usage.

{
  "period": "2026-03",
  "tasks": { "used": 42, "limit": 1000 },
  "reviews": { "used": 38, "limit": 500 }
}

Review Types

Set review_type to apply specialized review criteria:

TypeFocus
contentAccuracy, readability, SEO, persona fit
codeCorrectness, security (OWASP), tests, quality
marketing-strategyTarget clarity, channel fit, KPIs, positioning
saas-designAPI design, scalability, security, DX
competitive-analysisFeature accuracy, pricing, differentiation
revenue-modelUnit economics, pricing-value fit, churn risk
internationalizationi18n, localization, legal compliance

Webhooks

Set webhook_url on task creation to receive results via POST when the task completes.

// Webhook payload
{
  "event": "task.completed",  // or "task.failed"
  "task_id": "uuid",
  "status": "completed",
  "result": { "output": "...", "tokens_used": 1523 },
  "review": { "verdict": "PASS", "score": 87 }
}

Rate Limits

PlanRequests/minTasks/monthReviews/month
Free102010
Starter ($29/mo)30500250
Pro ($79/mo)605,0002,500
Team ($199/mo)12050,00025,000