AlmondTill/G3N API

rescheduleAppointment

mutation · in the family Selling

What it does

Move an appointment to a new time — the old booking closes as rescheduled and a linked replacement is created in one step.

Reschedule a requested/confirmed Appointment in ONE transaction: the predecessor flips rescheduled (slot released — the resbook rows delete) and the successor births requested with every other field copied verbatim + the bilateral linkage ids stamped. The successor's own confirm re-runs the capacity gate (never auto-confirmed). The new window re-runs the lead/advance create gates; a resource re-pick re-gates in-tenant + active + same-LF. Requires the unrestricted capability + the predecessor's current revision.

Before you call

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

Capability area: Selling — Ringing sales, serving customers and issuing invoices.

Roles that may call it:

What happens

The replacement is born requested — confirm it to reserve the new slot (the capacity check runs then).

Arguments

NameTypeRequiredNotes
inputRescheduleAppointmentInput RescheduleAppointmentInput!yesReschedule-input for rescheduleAppointment.

Concurrency

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

Returns

AppointmentReschedule AppointmentReschedule! — The rescheduleAppointment result: the doomed predecessor + the requested-born successor, linked bilaterally.

Example request

graphql
mutation ExampleRescheduleAppointment($input: RescheduleAppointmentInput!) {
  rescheduleAppointment(input: $input) {
    predecessor {
      id
      sysId
      type
      caption
      status
      parentId
      rootId
      createdAt
      updatedAt
      revisionNum
      revision
      organizationId
      purpose
      variantId
      orderId
      resourceIds
      startAt
      durationMinutes
      noShowAt
      successorAppointmentId
      predecessorAppointmentId
    }
  }
}

Variables:

json
{
  "input": {
    "appointmentId": "01900000-0000-7000-8000-82f95dda0000",
    "expectedRevision": "01900000-0000-7000-8000-e02b2e6c0000",
    "startAt": "2027-01-31T00:00:00.000Z",
    "durationMinutes": 1
  }
}

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

Example response

json
{
  "data": {
    "rescheduleAppointment": {
      "predecessor": {
        "id": "01900000-0000-7000-8000-82f95dda0000",
        "sysId": "AP-EXMP-0000-000F",
        "type": "Appointment",
        "caption": "Blue jeans",
        "status": "requested",
        "parentId": "01900000-0000-7000-8000-10c08c590000",
        "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",
        "organizationId": "01900000-0000-7000-8000-1971e30a0000",
        "purpose": "service",
        "variantId": "01900000-0000-7000-8000-8433b0260000",
        "orderId": "01900000-0000-7000-8000-18e782370000",
        "resourceIds": [
          "01900000-0000-7000-8000-23b0d8150000"
        ],
        "startAt": "2027-01-31T00:00:00.000Z",
        "durationMinutes": 1,
        "noShowAt": "2027-01-31T00:00:00.000Z",
        "successorAppointmentId": "01900000-0000-7000-8000-4fe044820000",
        "predecessorAppointmentId": "01900000-0000-7000-8000-8821035b0000"
      }
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer