Graphite Authentication API

Graphite CLI authentication with a Graphite auth token.

OpenAPI Specification

graphite-dev-authentication-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Graphite Platform Authentication API
  description: 'Graphite does not publish a standalone public REST API. Graphite is built on top of GitHub: it installs as a GitHub App (graphite-app) that consumes GitHub webhooks and calls GitHub''s APIs with short-lived tokens, and it is driven by the gt CLI which authenticates with a Graphite auth token. This OpenAPI models the real, observable surface area as logical operations: the GitHub App install entry point and the documented gt CLI stacked-PR workflow operations. Endpoint paths for CLI operations are illustrative of the platform actions the CLI performs and are not a documented public HTTP contract.'
  termsOfService: https://graphite.dev/terms
  contact:
    name: Graphite Support
    url: https://graphite.com/docs/feature-requests-bugs
  version: '1.0'
servers:
- url: https://app.graphite.dev
  description: Graphite hosted platform (driven by the gt CLI and web app)
- url: https://github.com
  description: GitHub App install and marketplace entry points (GitHub-mediated)
security:
- graphiteAuthToken: []
tags:
- name: Authentication
  description: Graphite CLI authentication with a Graphite auth token.
paths:
  /auth:
    post:
      operationId: authenticateCli
      tags:
      - Authentication
      summary: Authenticate the gt CLI
      description: Logical representation of `gt auth`, which registers a Graphite auth token so the CLI can create and update pull requests on the user's behalf. The token is obtained from the Graphite web app.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthRequest'
      responses:
        '200':
          description: CLI authenticated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthResult'
        '401':
          description: Invalid or expired auth token.
components:
  schemas:
    AuthRequest:
      type: object
      properties:
        token:
          type: string
          description: Graphite auth token copied from the web app.
      required:
      - token
    AuthResult:
      type: object
      properties:
        authenticated:
          type: boolean
        user:
          type: string
  securitySchemes:
    graphiteAuthToken:
      type: http
      scheme: bearer
      description: Graphite auth token registered via `gt auth`, used by the CLI to act on the user's behalf.