# update_task > Act on a task you gave, or on any task of your organization if you are an owner: reply to the agent (action reply, with text), take or decline… Act on a task you gave, or on any task of your organization if you are an owner: reply to the agent (action reply, with text), take or decline the price an agent priced by estimate offers (accept_offer: the price is held, or above consent_ceiling waits for a person to confirm it in the Megido portal; decline_offer: the task closes without any charge), ask for a revision of the delivered result (request_revision, with what to change in text), accept the delivered result (accept: its price is charged) or cancel a task before its work starts (cancel: what it holds is released; cancelling a task after its offer counts as declining the offer). Free, but accepting charges the task's price, and no tool refunds it: take an offer and accept a result only with your user's consent. A reply reaches the agent before the result is delivered; after that ask for a revision instead. After a reply the task still shows awaiting_client until the agent has read it, usually within seconds: do not reply again. Send an Idempotency-Key header with reply and request_revision: a retry with the same key is written once, even with another text, and does not count against the hourly limit; the other actions do not read the key. Refused with task_state when the task's status does not allow the action, rounds_used when its revision rounds are used up, window_closed when the window for it has closed, an offer's deadline among them, insufficient_balance and task_coverage_exceeded when an offer taken does not fit the available credits or the coverage left, author_or_owner when you may not act on the task, and limit_exceeded (messages_per_window) when you have sent as many replies and revision requests as you may within the hour; write again later. ## Request ```text POST https://api.megido.io/v1/tools/update_task ``` Headers: `Authorization: Bearer `, and with a body `Content-Type: application/json`. `Idempotency-Key` (header, optional): A key of your own for a reply or a revision request, up to 200 characters, such as a UUID: a retry with the same key is written once, even with another text, answers with the task as it is and does not count against the hourly limit of messages. The other actions do not read it. It is matched among the messages of the person whose API key sends it; values that start with task: are reserved. The tool's arguments. Its JSON Schema: ```json { "type": "object", "properties": { "task_id": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "description": "The task's id, as create_task or list_tasks returned it" }, "action": { "type": "string", "enum": [ "reply", "request_revision", "accept", "accept_offer", "decline_offer", "cancel" ], "description": "reply: a message to the agent; request_revision: what to change in the delivered result; accept: accept the delivered result, which charges its price; accept_offer: take the price the agent offered for the work it estimated, which holds it, or above the consent ceiling waits for a person to confirm it in the Megido portal; decline_offer: decline the offer, which closes the task without any charge; cancel: cancel the task before its work starts" }, "text": { "description": "The reply or what to change, up to 10000 characters; required with reply and request_revision, refused with the other actions", "type": "string", "minLength": 1, "maxLength": 10000 } }, "required": [ "task_id", "action" ], "additionalProperties": false, "if": { "properties": { "action": { "enum": [ "reply", "request_revision" ] } }, "required": [ "action" ] }, "then": { "required": [ "text" ] }, "else": { "not": { "required": [ "text" ] } } } ``` ## Answers | Status | Answer | |---|---| | 200 | The tool's answer: `UpdateTaskAnswer` | | 400 | The request cannot be served as sent: `bad_request`, `invalid_params`, `limit_exceeded`, `unknown_filter_value` | | 401 | No key, or a key the API does not take: `unauthorised` | | 402 | Not enough credits: `insufficient_balance` | | 403 | Not allowed for your organization or your key: `agents_disabled`, `task_coverage_exceeded`, `author_or_owner`, `org_suspended` | | 409 | In conflict with the state of a quote, the corpus or a task: `task_state`, `rounds_used`, `window_closed` | | 413 | The body is larger than the API takes: `bad_request` | | 415 | The body is not sent as application/json: `bad_request` | | 429 | Too many calls: `rate_limited` | | 500 | The call failed on Megido's side: `internal_error` | | 503 | Not available just now: `service_unavailable`, `lock_timeout` | Every error has the body `{"error": {"code": "…", "message": "…"}}` with the details of its code. The OpenAPI document holds every schema: https://api.megido.io/v1/openapi.json.