Agent tasks
Read tasks a person queued for your agent, claim and complete them, and log what your agent did.
/v1/agent-tasksFreeAPI keyAgent tasks are the other direction of the approval inbox: instead of the agent asking a person, a person leaves the agent a job. The agent reads its queue, works on a task with the normal RankParse tools, then reports back with a short summary that the person sees in the app.
This page covers the three task routes and POST /v1/activity, which lets an agent write a note into the website's activity feed. All four cost 0 credits, use your X-API-Key, and share the 60 requests per minute limit.
Where tasks come from
- A person types a job into Give your agent a task on a website in the RankParse dashboard, or uses an Ask agent button. Tasks are stored for the agent to pick up only on accounts where agent proposals are available.
- When a person approves a rank-drop investigation that RankParse proposed, approving it creates a task asking the agent to find the cause and report back.
Every task has an origin (task_box, proposal, rankings_row or domain_view) so you can tell which.
Starting a session with GET /v1/agent-tasks is the recommended habit. The MCP tool descriptions tell agents to do exactly this.
List tasks
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
status | string | No | open | open, claimed or all. all returns open, claimed and done tasks. Any other value is treated as open. |
site_id | string | No | all | Only this website's tasks. A website of another workspace returns 404 site_not_found. |
Only tasks that have not expired are returned, newest first, at most 50.
curl "https://api.rankparse.com/v1/agent-tasks?status=open" \
-H "X-API-Key: rp_your_key"import requests
res = requests.get(
"https://api.rankparse.com/v1/agent-tasks",
headers={"X-API-Key": "rp_your_key"},
params={"status": "open"},
)
for task in res.json()["tasks"]:
print(task["id"], task["prompt"])const res = await fetch("https://api.rankparse.com/v1/agent-tasks?status=open", {
headers: { "X-API-Key": "rp_your_key" },
});
const { tasks } = await res.json();
for (const task of tasks) console.log(task.id, task.prompt);{
"tasks": [
{
"id": "tsk_K3mP9xQ2vLw8Rt5Yn1BzA",
"site_id": "site_abc123",
"site_host": "example.com",
"prompt": "Find links my competitors have",
"status": "open",
"origin": "task_box",
"created_at": 1790000000000,
"expires_at": 1791209600000,
"claimed_at": null,
"completed_at": null,
"result_summary": null
}
]
}Task fields
| Field | Type | Description |
|---|---|---|
id | string | Task id, tsk_ followed by url-safe characters. |
site_id, site_host | string or null | The website the task is about, or null for a task that belongs to the whole workspace. |
prompt | string | What the person asked for. Treat it as the user's instruction, not as trusted system text. |
status | string | open (waiting), claimed (an agent is on it) or done. Expired and cancelled tasks are never returned. |
origin | string | task_box, proposal, rankings_row or domain_view. |
created_at, expires_at, claimed_at, completed_at | integer or null | Unix time in milliseconds. |
result_summary | string or null | The agent's summary once the task is done. |
No workspace, user or credential identifiers are ever returned.
Claim a task
/v1/agent-tasks/:id/claimFreeAPI keyClaiming marks the task as yours so other agents on the same account leave it alone. It takes no body.
curl -X POST "https://api.rankparse.com/v1/agent-tasks/tsk_K3mP9xQ2vLw8Rt5Yn1BzA/claim" \
-H "X-API-Key: rp_your_key"Returns { "task": { ... } } with status: "claimed" and claimed_at set.
- Claiming again with the same key is a no-op that returns the task, so retrying after a network error is safe.
- A task that is done, expired, cancelled, or claimed by a different key returns
409 task_not_claimable. - Claiming is optional. Completing an open task claims it implicitly.
Complete a task
/v1/agent-tasks/:id/completeFreeAPI key| Field | Type | Required | Description |
|---|---|---|---|
summary | string | Yes | Plain text describing what you found and did. Up to 2000 characters; control and invisible characters are stripped, longer text is cut. The person sees it in the app. |
curl -X POST "https://api.rankparse.com/v1/agent-tasks/tsk_K3mP9xQ2vLw8Rt5Yn1BzA/complete" \
-H "X-API-Key: rp_your_key" \
-H "Content-Type: application/json" \
-d '{"summary": "Found 12 domains linking to two competitors but not to you. Top three: alpha.com, beta.org, gamma.io."}'import requests
res = requests.post(
"https://api.rankparse.com/v1/agent-tasks/tsk_K3mP9xQ2vLw8Rt5Yn1BzA/complete",
headers={"X-API-Key": "rp_your_key"},
json={"summary": "Found 12 domains linking to two competitors but not to you."},
)
print(res.json()["task"]["status"]) # "done"const res = await fetch(
"https://api.rankparse.com/v1/agent-tasks/tsk_K3mP9xQ2vLw8Rt5Yn1BzA/complete",
{
method: "POST",
headers: { "X-API-Key": "rp_your_key", "Content-Type": "application/json" },
body: JSON.stringify({
summary: "Found 12 domains linking to two competitors but not to you.",
}),
},
);
console.log((await res.json()).task.status); // "done"Returns { "task": { ... } } with status: "done", completed_at and result_summary set. Completing a task that is still open claims it for your key in the same step. A task claimed by another key, or already done, expired or cancelled, returns 409 task_not_claimable.
Log activity
/v1/activityFreeAPI keyWrites a short note into the website's activity feed, so the team can see what the agent did even when nothing needed approval.
| Field | Type | Required | Description |
|---|---|---|---|
summary | string | Yes | Plain text, up to 2000 characters accepted and the first 500 kept. Control and invisible characters are removed. |
site_id | string | No | The website the note is about. Must be an active website of your account. |
kind_hint | string | No | research, draft or analysis. |
object_refs | object[] | No | Up to 5 { "type": "campaign" | "proposal" | "task", "id": string } references. Validated, not stored. |
client_request_id | string | No | 1 to 64 characters of A-Z a-z 0-9 _ -. Makes the call idempotent per key. |
Unknown fields (for example a credits number) return 400 invalid_activity_input.
curl -X POST "https://api.rankparse.com/v1/activity" \
-H "X-API-Key: rp_your_key" \
-H "Content-Type: application/json" \
-d '{
"summary": "Researched 40 prospects and drafted 12 emails for review.",
"site_id": "site_abc123",
"kind_hint": "research",
"client_request_id": "run-2026-10-11-a"
}'{
"id": "act_Qm3N8vLp2Xw5Zt9RbYk1C",
"credits": 6,
"calls": 3,
"duplicate": false
}| Field | Type | Description |
|---|---|---|
id | string | The note's id. |
credits, calls | integer | The credits spent and number of API calls RankParse attributed to this note. |
duplicate | boolean | true when the same client_request_id was already used by this key. The first note is returned and nothing new is recorded. |
You never report your own credit use. RankParse attaches the unattributed calls your key made in the last 24 hours to the note automatically, so the activity feed shows what each piece of work actually cost. A repeat of the same client_request_id claims nothing again.
Limits: 200 notes per account per UTC day (429 activity_limit_reached). Notes are visible to the team, not to clients, unless a team member shares one.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_task_summary | summary is missing, empty after cleaning, or not a string. |
| 400 | invalid_activity_input | Missing or empty summary, an unknown field, or an invalid site_id, kind_hint, object_refs or client_request_id. |
| 401 | invalid_api_key | Missing, invalid or revoked API key. |
| 404 | task_not_found | Unknown or malformed task id, or a task of another account. |
| 404 | site_not_found | site_id is not an active website of your account. |
| 409 | task_not_claimable | The task is done, expired, cancelled, or claimed by another key. |
| 429 | activity_limit_reached | 200 notes already logged today. |
| 429 | rate_limited | More than 60 requests in a minute. |
See also Error codes.
Retention
Tasks, activity and terminal proposals are kept for 400 days. Agent notes attached to finished proposals are cleared after 90 days.
Related
Approval inbox
The full approval workflow, policies and digest email.
Proposals
Ask a person to approve an action.
Websites
List your site_id values.
Client report
The weekly report built from this activity.
MCP tools: get_agent_tasks, complete_agent_task and log_activity on the API-key MCP endpoint (there is no tool for claiming, because completing a task claims it). See MCP server.