Skip to content
gist.link ↗

updateDoc

Mutation Teams API — POST https://teams.api.gist.link/graphql

Edit a doc’s title/body (collaborative). Any team member. Pass the revision you loaded as input.baseRevision to get a BAD_USER_INPUT conflict instead of silently overwriting a concurrent save; each successful edit bumps revision and publishes doc.updated on the team’s Mercure topic.

teams:mutation:updateDoc

The calling IAM key must hold this permission (or a wildcard that covers it: teams:mutation:* or teams:*) and the access token must have been minted with audience=teams. See Permissions.

type Mutation {
updateDoc(id: Int!, input: UpdateDocInput!): Doc!
}
Argument Type Required Description
id Int! Yes —
input UpdateDocInput! Yes —

Doc! — see the Teams types reference.

Terminal window
curl https://teams.api.gist.link/graphql \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d @- <<'JSON'
{
"query": "mutation UpdateDoc($id: Int!, $input: UpdateDocInput!) { updateDoc(id: $id, input: $input) { id title created_at updated_at } }",
"variables": {
"id": 10,
"input": {
"title": "Example",
"body": "example",
"baseRevision": 10
}
}
}
JSON