# Asks

The six kinds of ask, with actions, items, fields, groups, waiting for the answer and marking it picked up.

An ask is a question from an agent to you. The examples use the [command line](https://docs.specvista.com/assent/cli.md); the HTTP API (`POST /api/v1/agent/ask`) and the MCP connector take the same fields.

## Kinds

| Kind | What you do | Buttons unless the agent sets its own |
|---|---|---|
| `approve` | Approve or decline. This is the default kind. | Approve, Decline |
| `todo` | A step only you can do. Mark it done. | Done |
| `pay` | Open the payment page, pay yourself, then say so. | Paid |
| `login` | Open the sign-in page, sign in, then say so. | Done |
| `code` | Type a one-time code. The code comes back as `answer.value`. | One button that takes the code |
| `reply` | Edit the agent's draft, then Send or Skip. | Send, Skip |

`pay` and `login` asks carry only a link (`--url`). Never put passwords, card or bank details in an ask.

### Reply

A reply ask carries a draft: `--draft text`, or `--draft-file path`, or `--draft-file -` for stdin, at most 4000 characters. One final line break is dropped. You can edit the draft in Assent; the send action's `answer.value` is the final text to send. The draft is sent as written, without redaction. If the agent sets its own actions, exactly one must be primary, the send action.

```bash
assent ask --kind reply --title "Reply to Ada" --draft-file ./reply.txt --dedupe reply:ada:42
```

## What every ask needs

- A **title** phrased as an action ("Approve sending 3 applications") or a question. A title that reads like a status update is refused unless you add `--question`.
- A **why** for `approve`, `todo` and `pay` asks: one sentence on why you should act now.

```bash
assent ask --title "Deploy now?" --why "All checks passed on the release branch" --wait --timeout 600
```

## Actions

`--action id:label[:primary|secondary|danger]` adds a button, up to 6. The id comes back in `answer.actionId`.

```bash
assent ask --title "Submit 2 applications" --why "Both close on Friday" \
  --item "01:Acme, Staff Engineer" --item "02:Globex, Lead Engineer" \
  --action "submit:Submit selected:primary" --action "skip:Skip all" --dedupe jobs:2026-09-29
```

## Items

Items turn an ask into a list you pick from, up to 200. Each item starts ticked unless you add `:unselected`. The ticked ids come back in `answer.selectedItemIds`.

- `--item id:title[:unselected]` adds an item.
- `--item-json path|-` reads a JSON array of items instead, for per-item fields, subtitles and field tones.
- `--recommend item-id` marks recommended items. When any item is recommended, only the recommended ones start ticked.
- `--reason item-id:text` adds a line on why.
- `--badge item-id:label[:tone]` adds a badge, at most 4 per item. Tones are `neutral`, `ok`, `warn`, `danger` and `note`.
- `--link item-id:label:url` adds an `http` or `https` link, at most 4 per item.
- `--attach item-id:path` uploads a file and attaches it to the item, at most 4 per item. Attachments work once you turn them on for the agent.

## Fields

`--field key:label[:type]:value` shows a labelled value, up to 12. Types are `text`, `money` (`GBP 42.00`), `date`, `datetime`, `number` and `score` (`8/10`).

## Groups

`--group key:title` puts separate asks from the same agent with the same key into one decision card. The key cannot contain a colon.

- `--conflict-on field-key` (up to 4) flags members that share that field's day or value, for example two bookings on one evening.
- `--total-of field-key` totals the open members of a `money` field, per currency.
- `--decline-action action-id` is what **Keep one** answers the other members with.

## Times, reminders and repeats

- `--due when` sets a due time and `--remind when` a reminder. See [Notifications](https://docs.specvista.com/assent/notifications.md) for when pushes arrive.
- `--dedupe key` returns the live ask with that key instead of creating another one.
- An `approve` or `todo` ask whose title closely matches an open one from the same agent is merged into it, unless you pass `--dedupe`, `--group` or `--allow-duplicate`.
- `--idempotency-key uuid` makes a retry return the ask the first request created.
- `--question`, `--answer-type yes_no|choice|text|number|done`, `--effort minutes` (1 to 1440) and `--series key` add context. `choice` needs at least two actions or items.
- `--project project-uuid [--track name]` files the ask into a project you linked the agent to.
- `--rule-action name` and `--target t` name what an approval is about, so you can answer Always or Never. See [Rules](https://docs.specvista.com/assent/rules.md).

## Getting the answer

An answer looks like this:

```json
{ "actionId": "submit", "selectedItemIds": ["02"], "value": "only for code and reply asks" }
```

There are three ways to get it.

- **Wait.** `--wait` blocks until you answer, checking every `--interval` seconds (default 15) for up to `--timeout` seconds (default 3600). It exits 0 with the answered ask, or when the ask is resolved as done while it waits. It exits 6 if the wait timed out, and 3 if the ask expired, was withdrawn or was otherwise closed without an answer. An ask that a standing rule answers comes back at once.
- **Poll later.** `assent answers` lists answered asks that are not picked up yet, oldest first. `assent task get <task-uuid>` reads one ask.
- **Run now.** With the [helper](https://docs.specvista.com/assent/connect-a-computer.md) on a paired computer, answering restarts the agent with the answer in its environment.

## Picked up

Once the agent has acted on an answer, it marks it picked up so it is never delivered again:

```bash
assent picked-up "$TASK"
```

`--wait` does this for you unless you pass `--no-pickup`. If the helper already claimed the answer to resume the agent, `--wait` exits 3 and the output says `"resumedBy": "helper"`.

## Closing an ask yourself

`assent task resolve <task-uuid>` closes an ask the agent created once the work is done, and `--withdraw` withdraws it when it is no longer needed. Its reminders stop and its notification clears. Asks other than to-dos expire if nobody answers them in time; the ask's `answerExpiresAt` says when.

## Reporting each item

For an ask with items, the agent can report each item as it finishes, and check whether an item is still wanted before it starts:

```bash
assent task item-result "$TASK" 02 done --url https://example.com/application/02
assent task item-status "$TASK" 02
```
