---
search:
  tags:
    - issues
    - POST
seo:
  description: >-
    Atomically claim this issue. Succeeds when the issue is… Reference for the
    POST /workspaces/{organizationId}/issues/{id}/claim endpoint in the Pile
    API.
sidebar:
  label: Create issue claim
  badge: POST
title: Create issue claim
type: openapi-operation
---
Atomically claim this issue. Succeeds when the issue is unclaimed, its lease expired, or the caller already holds it (renew extends the lease and bumps the epoch). A live claim held by another actor answers 409 with the holder and expiry — do not steal.

`POST /workspaces/{organizationId}/issues/{id}/claim`

**Request body** (`application/json`)

- `actorId` (string)
- `agentId` (string)
- `leaseSeconds` (integer)

Request body example:

```json
{
  "actorId": "string",
  "agentId": "string",
  "leaseSeconds": 0
}
```

**Responses**

- `200` — Issue claimed (or lease renewed)
- `404` — Issue not found
- `409` — Issue already claimed — details carry claimedBy and leaseExpiresAt

Response example, 200:

```json
{
  "issueId": "string",
  "claimedBy": "string",
  "leaseExpiresAt": "string",
  "epoch": 0
}
```
