Skip to content
gist.link ↗

shareNode

Mutation Drive API — POST https://drive.api.gist.link/graphql

Grant a user (by email) or the whole org viewer/editor access.

drive:mutation:shareNode

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

type Mutation {
shareNode(nodeId: Int!, input: ShareInput!): ShareGrant!
}
Argument Type Required Description
nodeId Int! Yes —
input ShareInput! Yes —

ShareGrant! — see the Drive types reference.

Terminal window
curl https://drive.api.gist.link/graphql \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d @- <<'JSON'
{
"query": "mutation ShareNode($nodeId: Int!, $input: ShareInput!) { shareNode(nodeId: $nodeId, input: $input) { id nodeId granteeId granteeEmail orgWide role createdAt } }",
"variables": {
"nodeId": 10,
"input": {
"role": "example"
}
}
}
JSON