openapi: 3.2.0 info: title: Spacelift GraphQL API description: 'Spacelift exposes a single GraphQL endpoint for programmatic control of all platform resources including stacks, runs, policies, contexts, worker pools, modules, and blueprints.' version: 1.0.0 contact: name: Spacelift url: https://docs.spacelift.io/integrations/api license: name: Proprietary servers: - url: https://{account}.app.spacelift.io description: Account-specific Spacelift GraphQL endpoint variables: account: default: example description: Your Spacelift account subdomain security: - bearerAuth: [] tags: - name: Graph QL description: Spacelift GraphQL endpoint paths: /graphql: post: tags: - Graph QL summary: Execute a GraphQL query or mutation description: 'Executes a GraphQL query or mutation against the Spacelift API. The request body is a standard GraphQL-over-HTTP envelope containing a `query` string and an optional `variables` object. Requests must include a JWT bearer token in the `Authorization` header except for the authentication mutations (`apiKeyUser`, `oauthUser`) which return the JWT.' operationId: executeGraphQL requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/GraphQLRequest' examples: listStacks: summary: List stacks value: query: "{\n stacks {\n id\n name\n createdAt\n description\n }\n}\n" apiKeyLogin: summary: Exchange API key for JWT value: query: "mutation GetSpaceliftToken($id: ID!, $secret: String!) {\n apiKeyUser(id: $id, secret: $secret) {\n jwt\n }\n}\n" variables: id: api-key-id secret: api-key-secret githubLogin: summary: Exchange GitHub PAT for JWT value: query: "mutation GetSpaceliftToken($token: String!) {\n oauthUser(token: $token) {\n jwt\n }\n}\n" variables: token: ghp_xxx responses: '200': description: GraphQL response (may contain `data` and/or `errors`) content: application/json: schema: $ref: '#/components/schemas/GraphQLResponse' '401': description: Missing or invalid bearer token '400': description: Malformed GraphQL request components: schemas: GraphQLResponse: type: object properties: data: type: object additionalProperties: true nullable: true errors: type: array items: type: object properties: message: type: string path: type: array items: oneOf: - type: string - type: integer locations: type: array items: type: object properties: line: type: integer column: type: integer extensions: type: object additionalProperties: true GraphQLRequest: type: object required: - query properties: query: type: string description: GraphQL query or mutation document variables: type: object additionalProperties: true description: Variables referenced by the query operationName: type: string description: Name of the operation to execute when the document defines multiple securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT description: 'JWT bearer token obtained from the `apiKeyUser` or `oauthUser` mutation, or via `spacectl profile export-token`. '