Accessing the Spacelift API Reference

Last updated: November 7, 2024

Overview

Spacelift provides a GraphQL API that is self-documenting, making it easy to explore and understand using any compatible GraphQL client. This article will guide you on how to access and interact with the API.

For additional guidance, refer to Spacelift's API integration documentation, which provides setup and usage examples.

API Documentation

GraphQL Documentation
Spacelift’s API documentation can be accessed directly through a GraphQL client, as the API is self-documenting. By loading the schema, you can view the built-in documentation for all available queries, mutations, and types.

  • GraphQL Clients: Use clients like Insomnia or Postman to explore the API. These tools allow you to load the schema and view documentation directly within the client.

  • Static Documentation: You can also generate static API documentation using tools like GraphDoc, which creates a browsable HTML version of the schema.

Tips for Finding Specific Queries

  1. Inspect API Calls in the UI
    If you’re looking for a specific query, an easy way to find it is through the Spacelift UI:

    • Open Developer Tools in your browser.

    • Navigate to the Network tab and locate the API call when performing actions in the UI.

    • This approach can show you exactly how Spacelift interacts with the API.

  2. Using GraphQL Network Extensions
    Consider using extensions like GraphQL Network Inspector to inspect GraphQL queries directly. This tool makes it easy to see and replicate API calls made within the Spacelift UI.