AlmondTill/G3N API

declineSuggestion

mutation · in the family Suggestion

What it does

Decline a suggestion — say why, and the desk keeps your reason so it learns.

Decline an open Suggestion: the reason is required and is stored on the record with the flip — Aldric's learning signal. Enforces the offer law (you can only decline what your own capability could run — AUTHZ/FORBIDDEN naming the steps otherwise) and the lazy expiry. Requires the unrestricted capability + the record's current revision. A declined finding never reopens — a changed condition mints a fresh suggestion.

Before you call

A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.

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

Roles that may call it:

What happens

The offer closes for everyone and your reason is stored on it. A declined finding is not offered again unless the facts change; to stop a whole detector, park its schema instead.

Arguments

NameTypeRequiredNotes
idID ID!yesThe id of the record.
revisionID ID!yesThe revision id you read on the record; the change is refused if an edit landed in the meantime.
reasonString String!yes

Concurrency

Send the record’s current revision from your last read as revision. A stale revision is refused as CONFLICT/REVISION_STALE — read the record again and retry with the new value.

Returns

Suggestion Suggestion! — A Suggestion: a declared skill's detector minted this offer from bounded live reads: the WHY in merchant words, the evidence refs (exactly what it looked at), a drafted plan in wire vocabulary, and an expiry. System-minted end to end (authorless — no create/edit surface exists; refreshSuggestions is the only entrance). the offer rule: a caller sees only suggestions whose drafted plan their own capability could realize — the list filters, the get answers null, and take/decline enforce the same predicate (preview ≡ enforcement). Taking mints a Scratchpad through the live spine (origin suggestion; the plan lands via the setScratchpadPlan validate/mark path verbatim — stale steps arrive marked, never repaired); declining stores the learning reason on the record. Every suggestion drills down to the SuggestionSchema that produced it. The ops event domain (at.ops.suggestion.*).

Example request

graphql
mutation ExampleDeclineSuggestion($id: ID!, $revision: ID!, $reason: String!) {
  declineSuggestion(id: $id, revision: $revision, reason: $reason) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    skill
    schemaId
    why
    dedupKey
    expiresAt
    takenScratchpadId
    declineReason
  }
}

Variables:

json
{
  "id": "01900000-0000-7000-8000-eb53a62d0000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "reason": "Correcting a miscount."
}

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

Example response

json
{
  "data": {
    "declineSuggestion": {
      "id": "01900000-0000-7000-8000-eb53a62d0000",
      "sysId": "SU-EXMP-0000-000F",
      "type": "Suggestion",
      "caption": "Blue jeans",
      "status": "declined",
      "parentId": "01900000-0000-7000-8000-eacdfcfd0000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "skill": "<skill>",
      "schemaId": "01900000-0000-7000-8000-98907d560000",
      "why": "<why>",
      "dedupKey": "<dedup key>",
      "expiresAt": "2028-01-31T00:00:00.000Z",
      "takenScratchpadId": "01900000-0000-7000-8000-8c0dbe830000",
      "declineReason": "<decline reason>"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Used in