AlmondTill/G3N API

Build a team

Create a working group of staff so shared work and team messages reach the right people, edit it as people move, and deactivate it when it disbands.

Manage · a play in 3 steps.

The steps

  1. Create the team. — createTeam
  2. Edit it as people move. — updateTeam
  3. Deactivate it when it disbands — history stays. — deactivateTeam

The calls

Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.

createTeam

createTeam — mutation · Create a new team — a working group of staff at your organization.

Example request

mutation ExampleCreateTeam($input: NewTeamInput!) {
  createTeam(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    memberUserIds
    leadUserId
  }
}

Variables:

{
  "input": {
    "caption": "Blue jeans"
  }
}

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

Example response

{
  "data": {
    "createTeam": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "TM-EXMP-0000-000F",
      "type": "Team",
      "caption": "Blue jeans",
      "status": "active",
      "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",
      "memberUserIds": [
        "01900000-0000-7000-8000-77bba28a0000"
      ],
      "leadUserId": "01900000-0000-7000-8000-3e7bb9b10000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

updateTeam

updateTeam — mutation · Edit a team — a working group of staff — change its details.

Example request

mutation ExampleUpdateTeam($id: ID!, $revision: ID!, $input: EditTeamInput!) {
  updateTeam(id: $id, revision: $revision, input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    memberUserIds
    leadUserId
  }
}

Variables:

{
  "id": "01900000-0000-7000-8000-37386ae00000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "input": {
    "caption": "Blue jeans"
  }
}

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

Example response

{
  "data": {
    "updateTeam": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "TM-EXMP-0000-000F",
      "type": "Team",
      "caption": "Blue jeans",
      "status": "active",
      "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",
      "memberUserIds": [
        "01900000-0000-7000-8000-77bba28a0000"
      ],
      "leadUserId": "01900000-0000-7000-8000-3e7bb9b10000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

deactivateTeam

deactivateTeam — mutation · Deactivate a team — a working group of staff — it stops being usable but keeps its history and can be reactivated.

Example request

mutation ExampleDeactivateTeam($id: ID!, $revision: ID!, $reason: String) {
  deactivateTeam(id: $id, revision: $revision, reason: $reason) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    memberUserIds
    leadUserId
  }
}

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": {
    "deactivateTeam": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "TM-EXMP-0000-000F",
      "type": "Team",
      "caption": "Blue jeans",
      "status": "active",
      "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",
      "memberUserIds": [
        "01900000-0000-7000-8000-77bba28a0000"
      ],
      "leadUserId": "01900000-0000-7000-8000-3e7bb9b10000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}