# askConsultation

mutation · in the family [Work and notes](/reference/work-and-notes/)

## What it does

Ask Aldric one question in a consultation — the reply may include a drafted plan of records to create.

Ask Aldric ONE question in a Consultation: appends your question, composes the STORED summary + the last 12 turns verbatim + your attached materials' STORED extractions (EXTRACT-THEN-COMPOSE — mint/confirm them with wizardType 'consultation' first; only YOUR OWN confirmed materials compose), asks the platform-keyed model, and appends the reply. When the un-summarized tail outgrows the window, the older turns FOLD into the stored summary FIRST (its own metered call — the memory is visible on the record, never hidden model state). A drafted plan in the reply is validated against the LIVE registry + wire schema as it lands — invalid steps arrive MARKED, never repaired; nothing real is created by asking (takeConsultationPlan mints the walk). Refuses INTEGRATION/UNAVAILABLE keyless · RATE_LIMIT/THROTTLED past the 30/hour allowance · CONFLICT/REF_STATE on a non-open consultation · the honest transcript-full refusal naming the follow-on cure. Every made call meters (at.ai.call.v1 — surfaces office.consultation + office.consultation_summary). Requires authentication (user sessions) + the record's current revision.

## What happens

Your question and the reply both land on the transcript. Aldric reads the stored summary, the recent turns, and any materials you attach (their stored extractions — files are never re-read). When the conversation grows long, the older turns fold into the stored summary first — visible on the record, never hidden. A drafted plan is checked immediately; steps that do not check out arrive marked, never silently fixed. Each ask is a metered AI call with an hourly allowance per person.

## Careful

Nothing real is created by asking — a drafted plan only becomes records after you take, review, approve, and realize it yourself.

## Who may call it

Capability area: **Work and notes** — Tasks, notes, messages, dashboards and the everyday tools every staff member keeps.

- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- Cashier
- An API key whose scope allows `api:askConsultation`

## Arguments

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `input` | [AskConsultationInput](/types/AskConsultationInput/) `AskConsultationInput!` | yes | No further notes. |

## Returns

[AskConsultationResult](/types/AskConsultationResult/) `AskConsultationResult!` — The askConsultation result — the updated record + the two turns the ask appended (the question as spoken, the reply as drafted-and-marked).

## Example request

```graphql
mutation ExampleAskConsultation($input: AskConsultationInput!) {
  askConsultation(input: $input) {
    consultation {
      id
      sysId
      type
      caption
      status
      parentId
      rootId
      createdAt
      updatedAt
      revisionNum
      revision
      turnCount
      summary
      summarizedThroughSeq
      followOnOfId
      idleArchiveAt
      turnsTierAt
      turnsTier
    }
  }
}
```

Variables:

```json
{
  "input": {
    "id": "01900000-0000-7000-8000-37386ae00000",
    "revision": "01900000-0000-7000-8000-b7960e180000",
    "message": "Restock before the weekend.",
    "materialIds": [
      "01900000-0000-7000-8000-a36392ca0000"
    ]
  }
}
```

Send it with the envelope naming the version: `"extensions": {"at": {"version": {"name":"genesis","number":0}}}`.

## Example response

```json
{
  "data": {
    "askConsultation": {
      "consultation": {
        "id": "01900000-0000-7000-8000-37386ae00000",
        "sysId": "CI-EXMP-0000-000F",
        "type": "Consultation",
        "caption": "Blue jeans",
        "status": "open",
        "parentId": "01900000-0000-7000-8000-065235280000",
        "rootId": "01900000-0000-7000-8000-a093dd800000",
        "createdAt": "2027-01-31T00:00:00.000Z",
        "updatedAt": "2027-01-31T00:00:00.000Z",
        "revisionNum": 1,
        "revision": "01900000-0000-7000-8000-b7960e180000",
        "turnCount": 1,
        "summary": "<summary>",
        "summarizedThroughSeq": 1,
        "followOnOfId": "01900000-0000-7000-8000-7d2662410000",
        "idleArchiveAt": "2027-01-31T00:00:00.000Z",
        "turnsTierAt": "2027-01-31T00:00:00.000Z",
        "turnsTier": "<turns tier>"
      }
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

## Errors this call can answer

- `VALIDATION/INVALID` — Something in the request is not valid. ([VALIDATION](/errors/VALIDATION/))
- `AUTHN/REQUIRED` — Sign in to do this. ([AUTHN](/errors/AUTHN/))
- `AUTHZ/FORBIDDEN` — Your role does not allow this action. ([AUTHZ](/errors/AUTHZ/))
- `RATE_LIMIT/THROTTLED` — Too many requests in a short time. ([RATE_LIMIT](/errors/RATE_LIMIT/))
- `NOT_FOUND/*` — That record could not be found. ([NOT_FOUND](/errors/NOT_FOUND/))
- `CONFLICT/*` — The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. ([CONFLICT](/errors/CONFLICT/))
- `VALIDATION/VERSION_REQUIRED` — The request did not say which app version it came from. ([VALIDATION](/errors/VALIDATION/))

## Used in

- [Plan with Aldric — from a conversation to real records](/use-cases/plan-with-aldric/)
