Claims and work
Get an issue's work context
Everything about an issue an agent needs before working on it, in one call: the issue, its definition_of_done (the items under its "Definition of done" heading) and the required_checks every pull request into the default branch must pass; active claims; sessions on it or its pull requests; its pulls, each with its status, required checks as they stand on its head, whether it merges cleanly, the other pull requests it overlaps and its place in the merge queue; blocked_by (each issue it waits on, with claims and pull requests) and blocks (the issues waiting on it); decisions recorded about it; last_integration_failure; and recent, its latest coordination events, newest first.
/repos/{owner}/{name}/issues/{number}/workpulls are the issue’s pull requests, oldest first; required_checks, mergeable, overlaps and queue (its state and position in the merge queue, 1 at the front) are filled in for those still open or draft. recent holds up to 20 coordination events about the issue or its pull requests, newest first. See Picking up an issue.
- Authentication: Optional. Public data can be read without a token; send one to see what is private.
- MCP tool:
issuewithactionwork, and the same inputs - Scope: An access token needs
issues:read.
Path parameters
Section titled “Path parameters”| Name | Type | Required | Description |
|---|---|---|---|
owner |
string | Yes | The workspace that owns the repository. |
name |
string | Yes | The repository’s name. |
number |
integer | Yes | The issue’s number. |
Example request
Section titled “Example request”curl https://api.g1t.sh/repos/flagon-io/hello/issues/12/work \ -H "Authorization: Bearer $G1T_TOKEN"Example response
Section titled “Example response”A successful request answers 200 with:
{ "issue": { "id": "iss_01m43shrzpfe49x74ga7sj1c6v", "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", "number": 12, "title": "Greeting should name the caller", "body": "Take a name from the first argument; fall back to world.\n\n## Definition of done\n\n- `cargo test` passes.\n- The README shows the new usage.", "labels": [ "feature", "good first issue" ], "state": "open", "reason": null, "resolved_by": null, "author": { "id": "usr_01kkntcg1eeb98j62xjm7eh09p", "username": "syntaqx", "display_username": "syntaqx", "kind": "user", "verified": false, "workspaces": [] }, "requested_by": null, "created_at": "2026-10-01T18:04:11.482Z", "updated_at": "2026-10-01T18:09:47.305Z", "closed_at": null, "pull_count": 0, "comment_count": 0, "assignees": [ "syntaqx" ], "blocked_by": [ 9 ], "agent": null, "milestone": { "number": 3, "title": "Launch" } }, "definition_of_done": [ "`cargo test` passes.", "The README shows the new usage." ], "required_checks": [ "CI" ], "claims": [ { "id": "clm_01m4b3d5f7h9k1m3p5r7t9w1y3", "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", "issue": 12, "session_id": "ses_01m4b2c3d4e5f6g7h8j9k0m1n2", "actor": { "id": "usr_01kkntcg1eeb98j62xjm7eh09p", "username": "syntaqx" }, "harness": "claude_code", "note": "Taking the argument parsing first.", "state": "active", "created_at": "2026-10-12T14:03:02.771Z", "expires_at": "2026-10-12T15:01:40.518Z", "ended_at": null, "end_reason": null, "handoff_to": null } ], "sessions": [ { "id": "ses_01m4b2c3d4e5f6g7h8j9k0m1n2", "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", "issue": 12, "pull": 14, "branch": "greet-caller", "actor": { "id": "usr_01kkntcg1eeb98j62xjm7eh09p", "username": "syntaqx" }, "harness": "claude_code", "harness_session_id": "5b0c1f9e-3d2a-4e8b-9f61-0c7d2a9e4b13", "title": "Make the greeting name the caller", "state": "active", "head_commit": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13", "started_at": "2026-10-12T14:02:11.204Z", "last_seen_at": "2026-10-12T14:31:40.518Z", "ended_at": null, "end_reason": null } ], "pulls": [ { "number": 14, "title": "Greeting should name the caller", "status": "draft", "branch": "greet-caller", "head_commit": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13", "author": { "id": "usr_01kkntcg1eeb98j62xjm7eh09p", "username": "syntaqx" }, "check_status": null, "required_checks": [ { "name": "CI", "state": "success", "description": "CI passed", "target_url": "https://g1t.sh/syntaqx/hello/actions/runs/run_01m43sw8e2g6j0m4q8t2x6a0c4" } ], "mergeable": "clean", "overlaps": [ { "number": 11, "title": "Parse arguments with clap", "issue": 9, "paths": [ "src/main.rs" ] } ], "queue": null } ], "blocked_by": [ { "number": 9, "title": "Read arguments with a parser", "state": "open", "claims": [ { "id": "clm_01m4b2a4c6e8g0j2l4n6q8s0u2", "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", "issue": 9, "session_id": null, "actor": { "id": "usr_01kkp2v7d4fh8m3q6t9w2z5c8e", "username": "ana" }, "harness": null, "note": null, "state": "active", "created_at": "2026-10-12T13:50:12.000Z", "expires_at": "2026-10-12T14:20:12.000Z", "ended_at": null, "end_reason": null, "handoff_to": null } ], "pulls": [ { "number": 11, "title": "Parse arguments with clap", "status": "open" } ] } ], "blocks": [ { "number": 15, "title": "Greet in the caller's language", "state": "open" } ], "decisions": [ { "id": "dec_01m4b3e7g9j1l3n5q7s9u1w3y5", "issue": 12, "pull": 14, "session_id": "ses_01m4b2c3d4e5f6g7h8j9k0m1n2", "actor": "syntaqx", "kind": "proposal", "confidence": "claimed", "summary": "Read the name with the argument parser #9 brings, rather than by hand.", "evidence": { "commit": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13" }, "created_at": "2026-10-12T14:20:00.000Z" } ], "last_integration_failure": null, "recent": [ { "id": "evt_01m4b3d5f7h9k1m3p5r7t9w1y4", "type": "work.claimed", "source": "work", "time": "2026-10-12T14:03:02.771Z", "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", "actor": "usr_01kkntcg1eeb98j62xjm7eh09p", "data": { "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", "number": 12, "issue": 12, "claim": { "id": "clm_01m4b3d5f7h9k1m3p5r7t9w1y3", "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", "issue": 12, "session_id": "ses_01m4b2c3d4e5f6g7h8j9k0m1n2", "actor": { "id": "usr_01kkntcg1eeb98j62xjm7eh09p", "username": "syntaqx" }, "harness": "claude_code", "note": "Taking the argument parsing first.", "state": "active", "created_at": "2026-10-12T14:03:02.771Z", "expires_at": "2026-10-12T15:01:40.518Z", "ended_at": null, "end_reason": null, "handoff_to": null }, "others": [ { "id": "clm_01m4b2a4c6e8g0j2l4n6q8s0u2", "repo_id": "rep_01m3m5q6p0e2qaw6mmjahk0qrr", "issue": 12, "session_id": null, "actor": { "id": "usr_01kkp2v7d4fh8m3q6t9w2z5c8e", "username": "ana" }, "harness": null, "note": "Looking at the tests.", "state": "active", "created_at": "2026-10-12T13:50:12.000Z", "expires_at": "2026-10-12T14:20:12.000Z", "ended_at": null, "end_reason": null, "handoff_to": null } ] } } ]}Errors
Section titled “Errors”A failed request answers with one of these statuses and a body like {"error": {"code": "not_found", "message": "Repository not found."}}. See errors.
| Status | Code | When |
|---|---|---|
| 401 | unauthenticated |
A token is required, or the one sent is not valid. |
| 403 | forbidden |
The token is valid but not allowed to do this, such as a member-only change, or a token without the scope it needs. |
| 404 | not_found |
It does not exist, or you cannot see it. |
| 422 | invalid |
The input is not valid. message says which field and why. |