---
title: "Take or renew the lease on a task"
method: POST
path: "/api/assistant/tasks/{id}/lease"
tags: ["Mailzero Assistant"]
---

# Take or renew the lease on a task

`POST /api/assistant/tasks/{id}/lease`

## Request

- Base URL: `https://domani.run`
- URL: `https://domani.run/api/assistant/tasks/{id}/lease`
- Auth: HTTP bearer

Two assignees never work one matter: the lease names who works it until when (fifteen minutes by default, up to an hour). Taking it again renews it; another holder is refused with `TASK_LEASED` until the expiry. An effects request takes the lease on its own. Requires `assistant:write`.

## Path parameters

- `id` string, required

## Request body

- object
  - `ttl_seconds` integer

## Response `200`

The lease

- object
  - `task_id` string, required
  - `lease` AssistantTaskLease, required
    - `holder` string, required: agent:<slug>, member:<id> or user:<id>
    - `expires_at` string, date-time, required

## Other responses

- `401`: Missing or invalid API key
- `404`: No such task in the caller's scope
- `409`: Another assignee holds the lease
- `429`: Rate limit exceeded - wait and retry

---

[API](https://skmtc.dev/domani/apis/domani-run-api.md) · [All operations](https://skmtc.dev/domani/apis/domani-run-api/llms.txt) · [OpenAPI document](https://skmtc.dev/domani/apis/domani-run-api/revisions/7679f8159533?raw)
