# Action methods: answer, ask, attest

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

> The Action Verbs answer, ask, attest as typed SDK methods, with inputs, result, refusals and an example.

Reference for [Action](/business/nouns/action), one group of [Action methods](/code/sdk/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=sdk).

```ts
interface ActionVerbs {
  answer(input: ActionAnswerInput, options?: SB.CallOptions): SB.Call<Action>
}
```

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**

```ts
import { $ } from 'startup-builder'

const action = await $.Action.answer({ 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=sdk).

```ts
interface ActionVerbs {
  ask(input: ActionAskInput, options?: SB.CallOptions): SB.Call<ActionAskOutput>
}
```

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**

```ts
import { $ } from 'startup-builder'

const { question, action } = await $.Action.ask({ 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=sdk).

```ts
interface ActionVerbs {
  attest(input: ActionAttestInput, options?: SB.CallOptions): SB.Call<Action>
}
```

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**

```ts
import { $ } from 'startup-builder'

const action = await $.Action.attest({ action: 'act_br07HsG8MG', credential: 'credential_Abb9zatRR1' })
```