# Action commands: answer, ask, attest

URL: /code/cli/action/verbs · Id: `page:code/cli/action/verbs`

> The Action Verbs answer, ask, attest as CLI commands, with inputs, result, refusals and an example.

Reference for [Action](/business/nouns/action), one group of [Action commands](/code/cli/action).

### Action.answer
Answer gives the reply to an Action’s open Question, through any Interface, and the Action resumes. [Verb page](/business/nouns/action/answer?interface=cli).

```text
npx startup-builder do Action.answer --json '<input>' [--try | --send | --do]
```

Emits [`Action.answered`](/business/events/Action.answered).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | [Action](/business/nouns/action) | Yes | The Action waiting on the Question. |
| `question` | [Question](/business/nouns/question) | Yes | The Question answered. |
| `payload` | `json` | Yes | The answer, matching the Question’s choices or schema. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | [Action](/business/nouns/action) | Yes | The resumed Action. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```bash
npx startup-builder do Action.answer --json '{"action":"act_br07HsG8MG","question":"question_zuqUHd8LwY","payload":{}}'
```

### Action.ask
Ask puts a Question to a Party, a Role, or a Worker and holds the Action `pending` with reason `awaitingInput`. [Verb page](/business/nouns/action/ask?interface=cli).

```text
npx startup-builder do Action.ask --json '<input>' [--try | --send | --do]
```

Emits [`Action.asked`](/business/events/Action.asked).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | [Action](/business/nouns/action) | Yes | The Action that needs an answer to go on. |
| `to` | [Thing](/business/nouns/thing) | Yes | Who is asked: a Party, a Role, or a Worker. |
| `text` | `text` | Yes | The question, in one message. |
| `choices` | `string[]` | No | The answers offered. |
| `schema` | `json` | No | The typed answer’s shape. |
| `answerBy` | `datetime` | No | When the Action’s timeout rule applies. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `question` | [Question](/business/nouns/question) | Yes | The Question, posted in the record’s Thread. |
| `action` | [Action](/business/nouns/action) | Yes | The Action, now pending with reason `awaitingInput`. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```bash
npx startup-builder do Action.ask --json '{"action":"act_br07HsG8MG","to":"thing_8ds0r9vvRl","text":"Example text"}'
```

### Action.attest
Attest records a credentialed Human’s signed performance of a Reserved Act that an Action needs to finish. [Verb page](/business/nouns/action/attest?interface=cli).

```text
npx startup-builder do Action.attest --json '<input>' [--try | --send | --do]
```

Emits [`Action.attested`](/business/events/Action.attested).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | [Action](/business/nouns/action) | Yes | The Action that waits on the Reserved Act. |
| `credential` | [Credential](/business/nouns/credential) | Yes | The Credential that authorizes it. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | [Action](/business/nouns/action) | Yes | The Action, free to finish. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The input does not match the schema of the operation. | [`invalid-input`](/code/api/errors/invalid-input) | Read the schema of the operation, then send every required field with the right type. | None. |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```bash
npx startup-builder do Action.attest --json '{"action":"act_br07HsG8MG","credential":"credential_Abb9zatRR1"}'
```