Space Context Auth API

The Auth API from Space Context — 2 operation(s) for auth.

GitHub OpenAPI

Operations 2

POST /auth/device Start a device sign-in (the CLI) #
POST /auth/device/token Poll a device sign-in #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/spacecontext-app:spacecontext-app-auth-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

spacecontext-app-auth-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Space Context Auth API
  version: v1
servers:
- url: https://api.spacecontext.app/v1
tags:
- name: Auth
paths:
  /auth/device:
    post:
      operationId: startDeviceSignIn
      summary: Start a device sign-in (the CLI)
      description: 'A terminal that has no browser session asks for a code. It shows `user_code` and `verification_url` to the person, who opens the console and types the code (never a link with the code in it: a link could be sent by someone else to get their terminal approved), then polls `POST /auth/device/token` with `device_code` every `interval` seconds. The code lives `expires_in` seconds. Public; limited per IP.'
      security: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeviceStartRequest'
      responses:
        '201':
          description: Codes for the terminal and the person
          headers:
            Cache-Control:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceStart'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimited'
      tags:
      - Auth
  /auth/device/token:
    post:
      operationId: claimDeviceSignIn
      summary: Poll a device sign-in
      description: Answers 400 `AUTHORIZATION_PENDING` until the person decides, 400 `SLOW_DOWN` when polled faster than `interval`, 400 `DEVICE_CODE_EXPIRED` after ten minutes, 403 `ACCESS_DENIED` when denied, and the new API key exactly once when approved. Public.
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeviceTokenRequest'
      responses:
        '200':
          description: The key, once
          headers:
            Cache-Control:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceToken'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimited'
      tags:
      - Auth
components:
  schemas:
    DeviceToken:
      type: object
      required:
      - api_key
      - key
      - user
      properties:
        api_key:
          type: string
          description: 'The new key: shown once, store it.'
        key:
          type: object
          required:
          - id
          - name
          - mode
          - prefix
          - scopes
          - monthly_cap_cents
          - created_at
          properties:
            id:
              type: string
            name:
              type: string
            mode:
              type: string
              enum:
              - live
              - test
            prefix:
              type: string
            scopes:
              type: array
              items:
                type: string
            monthly_cap_cents:
              type:
              - integer
              - 'null'
            created_at:
              type: string
        user:
          $ref: '#/components/schemas/ConsoleUser'
    DeviceStartRequest:
      type: object
      properties:
        name:
          type: string
          maxLength: 60
          description: 'What is asking, shown to the person: "CLI on MacBook". Default "CLI".'
        mode:
          type: string
          enum:
          - live
          - test
          description: The mode of the key asked for (the person can change it). Default live.
    ConsoleUser:
      type: object
      required:
      - id
      - email
      - name
      - is_pro
      - is_admin
      properties:
        id:
          type: string
        email:
          type: string
          format: email
        name:
          type:
          - string
          - 'null'
        is_pro:
          type: boolean
        is_admin:
          type: boolean
          description: True only for Space Context staff accounts, which the console shows extra internal pages; false for everyone else.
    DeviceTokenRequest:
      type: object
      required:
      - device_code
      properties:
        device_code:
          type: string
    Error:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - code
          - message
          - request_id
          properties:
            code:
              type: string
            message:
              type: string
            request_id:
              type: string
            retry_after:
              type: integer
              description: 'On a 429: seconds to wait, as in `Retry-After`.'
            daily_limit:
              type: integer
              description: 'On a 429 for a daily allowance: the allowance (it resets at midnight UTC).'
            max_streams:
              type: integer
              description: 'On a 429 from `GET /scans/{id}/events`: the streams an account may hold open at once.'
            max_open_scans:
              type: integer
              description: 'On a 429 from `POST /spaces/{id}/scans`: the scans an account may hold created and not started.'
          additionalProperties: true
    DeviceStart:
      type: object
      required:
      - device_code
      - user_code
      - verification_url
      - expires_in
      - interval
      properties:
        device_code:
          type: string
          description: 'The terminal''s secret: never shown to the person.'
        user_code:
          type: string
          example: BCDF-2345
        verification_url:
          type: string
          format: uri
          description: The console page where the person types the code.
        expires_in:
          type: integer
        interval:
          type: integer
          description: Seconds between polls.
  responses:
    RateLimited:
      description: Too many requests. Retry after the number of seconds in `Retry-After`.
      headers:
        Retry-After:
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ErrorResponse:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: sc_live or sc_test