AlmondTill/G3N API

On this page

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 (non-empty, ≤2000: the learning signal is the decline's whole purpose, so headless insists and every face mirrors) 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 (a past-expiry open refuses CONFLICT/EXPIRED, expiring on the touch). Requires the unrestricted capability + the record's CURRENT revision. A declined finding never reopens — a changed condition mints a FRESH suggestion.

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.

Who may call it

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

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!yesNo further notes.

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 (the {operation, input} shape), 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

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:

{
  "id": "01900000-0000-7000-8000-37386ae00000",
  "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

{
  "data": {
    "declineSuggestion": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "SU-EXMP-0000-000F",
      "type": "Suggestion",
      "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",
      "skill": "<skill>",
      "schemaId": "01900000-0000-7000-8000-e5ee57ab0000",
      "why": "<why>",
      "dedupKey": "<dedup key>",
      "expiresAt": "2027-01-31T00:00:00.000Z",
      "takenScratchpadId": "01900000-0000-7000-8000-65ec6b4e0000",
      "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