The Houston API allows you to build applications that provision and manage resources on Astronomer Software. You can use the Houston API to perform CRUD operations on entities scoped to the Astronomer platform, including Airflow Deployments, Workspaces, and users. For example, you can:Documentation Index
Fetch the complete documentation index at: https://astronomer-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
- Delete a deployment
- Look up a deployment’s resource config
- Add a user to a Workspace
- Make a user a System Administrator
Schema overview
The Houston API uses the GraphQL API query language. You can make GraphQL requests using standard REST API tools such as HTTP and curl. GraphQL APIs support two main request types: queries and mutations. You can run these requests against objects which are similar to endpoints in REST APIs. A query is a request for specific information and is similar to aGET request in a REST API. The primary difference between GraphQL queries and Rest API queries is that GraphQL queries only return the fields that you specify within your request. For example, consider the following query to retrieve information about a user:
! are required in order for the query to complete. Lastly, the mutation requests the Houston API to return id of the added user to confirm that the mutation was successful. In this way, it’s possible to make a mutation and a query in a single request.
For more basic GraphQL usage rules and examples, see the GraphQL documentation.
Prerequisites
There are no general prerequisites using the Houston API. However, theupsertDeployment mutation is behind a feature flag. To enable this feature on your Astronomer Software installation, set the following configuration in your config.yaml file:
Authenticate to the Houston API
A Houston API request requires a token so that the request can be authenticated and authorized with a specific level of access on Astronomer Software. You can retrieve a token in one of the following ways:- Create a service account and note its API Key. This is recommended for most production workflows.
- Go to
https://app.<your-base-domain>/token, log in with your user account, and copy the API token that appears. This is recommended if you want to test API requests with your own user credentials. API tokens retrieved this way expire after 24 hours or when an Admin users changes your level of access.
Authorization header to your Houston API requests. For example, the following curl command uses 'Authorization: <my-api-token>' to authenticate a request to add a new Workspace user:
Develop and test Houston API queries
The Astronomer Houston API is available in a GraphQL playground where you can view the Houston API schema and documentation, as well as model, test, and export requests. To test requests in the playground, you must have a valid authentication token.-
Access the Astronomer Houston API GraphQL playground at
https://houston.<your-base-domain>/v1. - Click HTTP Headers.
-
Add your authentication token in the following format: