Skip to content
gist.link ↗

writeProjectFile

Mutation Deploy API — POST https://deploy.api.gist.link/graphql

Write one file in the project’s sandbox working copy (the manual editor’s save). ROLE_ADMIN or ROLE_DEPLOY_MANAGER.

deploy:mutation:writeProjectFile

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

type Mutation {
writeProjectFile(projectId: Int!, path: String!, content: String!): WorkspaceFileContent!
}
Argument Type Required Description
projectId Int! Yes —
path String! Yes —
content String! Yes —

WorkspaceFileContent! — see the Deploy types reference.

Terminal window
curl https://deploy.api.gist.link/graphql \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d @- <<'JSON'
{
"query": "mutation WriteProjectFile($projectId: Int!, $path: String!, $content: String!) { writeProjectFile(projectId: $projectId, path: $path, content: $content) { path content } }",
"variables": {
"projectId": 10,
"path": "example",
"content": "example"
}
}
JSON