GraphQL API
The GraphQL API provides mutations for environment lifecycle management and AI configuration, plus queries for listing accounts, apps, environments, and repositories. Use GraphQL when you need to pause, resume, or delete environments, or when you need complex queries with nested data.
When to use GraphQL vs REST: Use the GraphQL API for environment lifecycle mutations (pause, resume, delete, deploy) and for queries that benefit from selecting specific fields. Use the REST Platform API for resource CRUD operations and the AI Sandbox API for sandbox session management.
Endpoint
POST https://api.release.com/graphql
Authentication
Authenticate using headers from your ~/.release.yaml file. To set this up, install the Release CLI and run release auth login.
X-User-Email
User email from ~/.release.yaml (login field)
X-User-Token
User token from ~/.release.yaml (token field)
Headers
Content-Type
application/json
X-User-Email
Your user email
X-User-Token
Your user token
Mutations
environmentsPause
Pause an environment.
Input:
id
ID!
Yes
The ID of the environment to pause
Response:
environment.id
ID
The environment ID
environment.state
String
The current state of the environment
Example:
environmentsResume
Resume a paused environment.
Input:
id
ID!
Yes
The ID of the environment to resume
Response:
environment.id
ID
The environment ID
environment.state
String
The current state of the environment
Example:
environmentsDelete
Delete an environment.
Input:
id
ID!
Yes
The ID of the environment to delete
Response:
environment.id
ID
The environment ID
environment.state
String
The current state of the environment
Example:
environmentsSetup
Deploy or setup an environment.
Input:
id
ID!
Yes
The ID of the environment to deploy
initiationType
String
No
The initiation type (e.g., "manual")
Response:
environment.id
ID
The environment ID
environment.state
String
The current state of the environment
Example:
aiConfigurationsCreate
Create an AI configuration.
Input:
input
AiConfigurationsCreateInput!
Yes
The AI configuration parameters
Response:
configuration
Object
The created AI configuration object
Example:
aiConfigurationsDelete
Delete an AI configuration.
Input:
id
ID!
Yes
The ID of the AI configuration to delete
Response:
confirmation
Object
Confirmation of deletion
Example:
aiSandboxesCreateSession
Create an AI sandbox session via GraphQL.
Input:
input
AiSandboxesCreateSessionInput!
Yes
The sandbox session parameters
The AiSandboxesCreateSessionInput accepts resources using the AiSandboxResourceInput type:
Response:
session.id
ID
The session ID
session.title
String
The session title
session.state
String
The current state of the session
session.sandboxClaimName
String
The sandbox claim name
session.startedAt
String
Timestamp when the session started
session.environment.id
ID
The associated environment ID
session.environment.handle
String
The environment handle
session.environment.name
String
The environment name
session.resources
[Object]
List of session resources
session.resources[].id
ID
The resource ID
session.resources[].resourceType
String
The type of resource
session.resources[].state
String
The resource state
session.resources[].mountPath
String
The mount path for the resource
session.resources[].config
Object
Resource configuration
session.resources[].status
Object
Resource status
userErrors
[Object]
List of validation errors
userErrors[].field
String
The field that caused the error
userErrors[].message
String
The error message
Example:
Queries
workspaces
List accounts and workspaces.
Arguments:
No required arguments.
Response:
workspaces
[Object]
Array of workspace objects
Example:
apps
List applications.
Arguments:
accountId
ID!
Yes
The account ID to list apps for
filters
Object
No
Optional filters to narrow results
Response:
apps
[Object]
Array of application objects
Example:
environments
List environments with details.
Arguments:
appId
ID!
Yes
The application ID to list environments for
filters
Object
No
Optional filters to narrow results
Response:
environments
[Object]
Array of environment objects with full details
Example:
repositories
List available repositories.
Arguments:
accountId
ID!
Yes
The account ID to list repositories for
Response:
repositories
[Object]
Array of repository objects
Example:
repository
Get repository details with branches.
Arguments:
id
ID!
Yes
The repository ID
Response:
repository
Object
Repository object with branches and paths
Example:
Last updated
Was this helpful?