GET /api/tasks/next
Get the next available task from the Ready column that matches your agent's capabilities.
Authentication
Requires a valid API token in the Authorization header:
Authorization: Bearer <your_api_token>
Request
Method: GET
Endpoint: /api/tasks/next
Query Parameters
All three parameters are optional, and none changes which task is returned.
| Parameter | Values | Default | Effect |
|---|---|---|---|
skills_version |
Your installed Stride skills version, e.g. 1.0 |
absent | Every 200 response that returns a task carries current_skills_version; the 403 and 404 bodies do not. When the version you send is strictly older than it, the response also carries a skills_update_required object. An equal, newer or unreadable version adds nothing |
response_view |
slim |
absent (full) | slim returns an eleven-key summary of the task instead of the full object, the same summary GET /api/tasks uses. Any other value returns the full task. The skills-version keys are present under both views |
wait |
A whole number of seconds from 1 to 50 |
absent (answer at once) | When no task is claimable, hold the request open for up to that many seconds and answer as soon as one becomes claimable. See Long polling. Any other value is a 422 |
Response
Success (200 OK)
Returns the first task that meets every condition in Task Selection Logic below.
{
"data": {
"id": 123,
"identifier": "W21",
"title": "Implement authentication",
"description": "Add JWT authentication to the API",
"status": "open",
"priority": "high",
"complexity": "medium",
"needs_review": true,
"type": "work",
"column_id": 5,
"created_by_id": 1,
"created_by_agent": null,
"assigned_to_id": null,
"completed_by_agent": null,
"time_spent_minutes": null,
"review_status": null,
"review_report": null,
"parent_id": null,
"dependencies": [],
"inserted_at": "2025-12-28T10:00:00Z",
"updated_at": "2025-12-28T10:00:00Z",
"completed_at": null
},
"current_skills_version": "1.0"
}
Forbidden (403)
Your token is a board token, and the user who created it no longer has access to the token's board. Every read checks this again on every request, so a board token stops reading once its user is removed from the board, or stops being an org-admin of (or leaves) the Organization their access came from. Any access is enough to read, read-only included. See Token Scope.
{
"error": "Not authorized — board membership required",
"documentation": "https://raw.githubusercontent.com/cheezy/kanban/refs/heads/main/docs/api/README.md",
"getting_started": "https://raw.githubusercontent.com/cheezy/kanban/refs/heads/main/docs/GETTING-STARTED-WITH-AI.md"
}
Not Found (404)
No tasks available that match your capabilities:
{
"error": "No tasks available in Ready column matching your capabilities"
}
Unprocessable Entity (422)
wait is not a whole number of seconds from 1 to 50. It is rejected rather
than clamped, so a client bug shows up instead of waiting a different time:
{
"error": "wait must be a whole number of seconds from 1 to 50",
"documentation": "https://raw.githubusercontent.com/cheezy/kanban/refs/heads/main/docs/api/get_tasks_next.md#long-polling",
"common_causes": ["..."]
}
Too Many Requests (429)
Your token already holds as many waiting requests as it may (10 by default),
and no task is claimable right now. The response carries a retry-after
header. A request without wait is never refused for this reason.
{
"error": "Too many requests"
}
Example Usage
curl -X GET \
-H "Authorization: Bearer stride_dev_abc123..." \
https://www.stridelikeaboss.com/api/tasks/next
Long polling
Add wait=N to wait up to N seconds (1 to 50) for a claimable task instead
of polling:
curl -H "Authorization: Bearer $STRIDE_API_TOKEN" \
"$STRIDE_API_URL/api/tasks/next?wait=30"
- If a task is already claimable, it is returned at once.
- Otherwise the request stays open. Each change on your token's board wakes it
and the server re-runs the same selection query, so it answers with a task
as soon as one becomes claimable for your token, with the same 200 body as
without
wait. - If nothing becomes claimable in time, it answers with the usual 404 body. A claim that expires during the wait is picked up at that point, not sooner.
- Only changes on your token's own board can wake the request; a task on a board your token cannot see never does.
- One token may hold up to 10 waiting requests at once; beyond that a request that finds nothing gets a 429 instead of waiting.
- The server holds no database connection while it waits. A deploy closes any waiting request, so treat a dropped connection like an empty answer and ask again.
- Every response the endpoint itself answers (200, 404, 422 and 429) carries
the header
x-stride-wait: 1, so a client can tell the server supportswait. Responses refused before the endpoint runs (401, 403, 406) do not. An older server omits the header and ignoreswait, answering at once. - This endpoint does not claim the task, so two agents waiting on the same board can both be offered the same task; only one claim will succeed.
- The MCP tool
stride_next_taskdoes not wait.
Task Selection Logic
A task is a candidate only when all of these hold:
- Column: It is in the column named Ready on your token's board
- Type: It is a
workordefecttask. Goals are never offered - Human Task: Its
human_taskflag isfalse - Status: It is
open, or it isin_progressand its claim has expired - Archived: It is not archived
- Capabilities: Your token holds every entry in its
required_capabilities. A task with no required capabilities matches every token, and a token with no capabilities is not filtered at all - Dependencies: Every task in its
dependenciesarray is completed - Assignment: It is unassigned, or assigned to the user who owns your token
Candidates are then ordered:
- Priority, highest first:
critical,high,medium,low - Position in the Ready column, top first, for tasks of equal priority
The first candidate in that order whose key_files do not overlap a task in
progress in Doing or Review is returned. The same rules, with examples, are in
How the next task is chosen.
Available Capabilities
Agent capabilities are configured in your API token. Common capabilities include:
code_generation- Writing new code, implementing featurestesting- Writing and running testsdocumentation- Writing documentationcode_review- Reviewing code and changesdevops- CI/CD, Docker and deployment pipelines
A task's required_capabilities accepts only the 16 values listed in
Standard Capabilities.
Notes
- This endpoint does NOT claim the task - it only shows what's available
- Use
POST /api/tasks/claimto actually claim a task - Without
response_view=slim, the response includes ALL task fields (same as GET /api/tasks/:id) - A Ready task whose
key_files(files being modified) overlap a task in progress in Doing or Review is skipped. A claim that names a task withidentifierdoes not run this check - Claims expire after 60 minutes if the task is not completed. An expired claim stays in Doing until it is unclaimed or moved back to Ready
See Also
- POST /api/tasks/claim - Claim a task to start working on it