Measure Auth API

Sign in, session validation, token refresh and sign out.

GitHub OpenAPI

Operations 6

POST /auth/github Sign in with GitHub #
POST /auth/google Sign in with Google #
POST /auth/validateInvite Validate invite #
POST /auth/refresh Refresh session #
GET /auth/session Fetch session #
DELETE /auth/signout Sign out #

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/measure-sh:measure-sh-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

measure-sh-auth-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Measure Dashboard Auth API
  version: 1.0.0
  description: 'Reference for Measure''s Dashboard REST API. Every endpoint, request body,

    response format and status code.


    Requests are authenticated with the user''s access token in

    `Authorization: Bearer ` format, unless cookies are used to

    send tokens. Set `Content-Type: application/json; charset=utf-8` on each

    request.


    Failed requests have the following response shape:


    ```json

    {

    "error": "Error message",

    "details": "Additional error details, when available"

    }

    ```'
servers:
- url: https://api.measure.sh
  description: Measure cloud
- url: http://localhost:8080
  description: Self-hosted Measure API origin
security:
- bearerAuth: []
tags:
- name: Auth
  description: Sign in, session validation, token refresh and sign out.
paths:
  /auth/github:
    post:
      operationId: signinGithub
      tags:
      - Auth
      summary: Sign in with GitHub
      description: 'Sign in with Github.


        Should pass in type as "code" along with state and code received from Github.'
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - type
              - state
              properties:
                type:
                  type: string
                  description: OAuth flow step, "init" or "code".
                state:
                  type: string
                  description: Opaque OAuth state value.
                code:
                  type: string
                  description: Authorization code received from GitHub. Required when type is "code".
            examples:
              request:
                value:
                  type: code
                  state: eyJyYW5kb20iOiIxOGY0NDIzZjExY2FiM2ZkOTRiNDZlMzU0ZWU1MDNlZjEyODk1MmY3YzViMDgxNjczMDkwMzVhYzU3ZjNkYjgxIiwicGF0aCI6IiJ9
                  code: ccd85e1fbfae2924588a
      responses:
        '200':
          description: Successful response, no errors.
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                  refresh_token:
                    type: string
                  session_id:
                    type: string
                  user_id:
                    type: string
                  own_team_id:
                    type: string
              examples:
                response:
                  value:
                    access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDUyMjU0ODR9.UA-rtIY8TPjB3gkt0xgxTTXWa84uB6nr9vMyg0gMnSI
                    refresh_token: yJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDU4Mjg0ODR9.1-meGfGQ8i9IlNxKXmBlDc4lEu-O63jG2vrd7yP0-j8
                    session_id: afae8473-2419-4303-a262-2aea520de295
                    user_id: 835283a5-cddc-472b-84ad-5ea3319efeed
                    own_team_id: e47ac49d-0697-4e85-8607-1a34536c04e3
        '400':
          description: Request is malformed or does not meet one or more acceptance criteria. Check the `error` field for more details.
        '401':
          description: GitHub rejected the sign-in. The authorization code is invalid, already used or expired.
        '429':
          description: Rate limit of the requester has crossed maximum limits.
        '500':
          description: Measure server encountered an unfortunate error. Report this to your server administrator.
  /auth/google:
    post:
      operationId: signinGoogle
      tags:
      - Auth
      summary: Sign in with Google
      description: 'Sign in with Google.


        Should pass in type as "code" along with state and code received from Google.'
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - type
              - state
              properties:
                type:
                  type: string
                  description: OAuth flow step, "init" or "code".
                state:
                  type: string
                  description: Opaque OAuth state value.
                code:
                  type: string
                  description: Authorization code received from Google. Required when type is "code".
            examples:
              request:
                value:
                  type: code
                  state: eyJyYW5kb20iOiJiMGNkMTBjNzViOTI3NjQ1MmM4NTRlMzJiMjlkOTI1ZmI0YjkyNGI5ODFkZDQ0ZjM4OTMwYWQwYzU2YjEzMDk3IiwicGF0aCI6IiJ9
                  code: 4/0AeaYSHBg8Yt2VXpDbb1kMqzy
      responses:
        '200':
          description: Successful response, no errors.
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                  refresh_token:
                    type: string
                  session_id:
                    type: string
                  user_id:
                    type: string
                  own_team_id:
                    type: string
              examples:
                response:
                  value:
                    access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDUyMjU2NTl9.XzbpImWw9GXFlIXHCu92QNsA1D8m_Y9ZFVDEDqG_wtM
                    refresh_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDU4Mjg2NTl9.MeMIsk1KEHvPa2AAbDBQWqeKJwQcxbk1lXb7Mhcz-uQ
                    session_id: afae8473-2419-4303-a262-2aea520de295
                    user_id: 835283a5-cddc-472b-84ad-5ea3319efeed
                    own_team_id: e47ac49d-0697-4e85-8607-1a34536c04e3
        '400':
          description: Request is malformed or does not meet one or more acceptance criteria. Check the `error` field for more details.
        '401':
          description: Google rejected the sign-in. The authorization code is invalid, already used or expired.
        '429':
          description: Rate limit of the requester has crossed maximum limits.
        '500':
          description: Measure server encountered an unfortunate error. Report this to your server administrator.
  /auth/validateInvite:
    post:
      operationId: validateInvite
      tags:
      - Auth
      summary: Validate invite
      description: 'Validate invite.


        Should pass in Invite ID.'
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                invite_id:
                  type: string
            examples:
              request:
                value:
                  invite_id: 8e07edcf-92be-43c6-934e-c9cc96f2ddfb
      responses:
        '200':
          description: Successful response, no errors.
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid:
                    type: boolean
              examples:
                response:
                  value:
                    valid: true
        '400':
          description: Request is malformed or does not meet one or more acceptance criteria. Check the `error` field for more details.
        '410':
          description: Invite has expired.
        '429':
          description: Rate limit of the requester has crossed maximum limits.
        '500':
          description: Measure server encountered an unfortunate error. Report this to your server administrator.
  /auth/refresh:
    post:
      operationId: refreshToken
      tags:
      - Auth
      summary: Refresh session
      description: 'Refresh session.


        Should pass in refresh token as cookies or in auth header. Set the

        session''s refresh token in `Authorization: Bearer `

        format unless you are using cookies to send refresh tokens.'
      responses:
        '200':
          description: Successful response, no errors.
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                  refresh_token:
                    type: string
              examples:
                response:
                  value:
                    access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDUyMjU2NTl9.XzbpImWw9GXFlIXHCu92QNsA1D8m_Y9ZFVDEDqG_wtM
                    refresh_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDU4Mjg2NTl9.MeMIsk1KEHvPa2AAbDBQWqeKJwQcxbk1lXb7Mhcz-uQ
        '401':
          description: Either the user's refresh token is invalid or has expired.
        '403':
          description: Requester does not have access to this resource.
        '429':
          description: Rate limit of the requester has crossed maximum limits.
        '500':
          description: Measure server encountered an unfortunate error. Report this to your server administrator.
  /auth/session:
    get:
      operationId: getAuthSession
      tags:
      - Auth
      summary: Fetch session
      description: 'Fetch session.


        Only active sessions that have not been cleaned up will receive a

        response. Invalid sessions return an error.'
      responses:
        '200':
          description: Successful response, no errors.
          content:
            application/json:
              schema:
                type: object
                properties:
                  user:
                    type: object
                    properties:
                      id:
                        type: string
                      own_team_id:
                        type: string
                      name:
                        type: string
                      email:
                        type: string
                      confirmed_at:
                        type: string
                      last_sign_in_at:
                        type: string
                      created_at:
                        type: string
                      updated_at:
                        type: string
              examples:
                response:
                  value:
                    user:
                      id: 835283a5-cddc-472b-84ad-5ea3319efeed
                      own_team_id: e47ac49d-0697-4e85-8607-1a34536c04e3
                      name: Dummy User
                      email: dummy@gmail.com
                      confirmed_at: '2024-06-19T22:14:49.77Z'
                      last_sign_in_at: '2024-06-19T22:14:49.77Z'
                      created_at: '2024-06-19T22:14:49.77Z'
                      updated_at: '2024-06-19T22:14:49.77Z'
        '401':
          description: Either the user's access token is invalid or has expired.
        '403':
          description: Requester does not have access to this resource.
        '429':
          description: Rate limit of the requester has crossed maximum limits.
        '500':
          description: Measure server encountered an unfortunate error. Report this to your server administrator.
  /auth/signout:
    delete:
      operationId: signout
      tags:
      - Auth
      summary: Sign out
      description: 'Sign out.


        Only active sessions that have not been cleaned up will receive a

        response. Invalid sessions return an error. Set the session''s refresh

        token in `Authorization: Bearer ` format unless you are

        using cookies to send refresh tokens.'
      responses:
        '200':
          description: Successful response, no errors.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
              examples:
                response:
                  value:
                    ok: true
        '401':
          description: Either the user's refresh token is invalid or has expired.
        '403':
          description: Requester does not have access to this resource.
        '429':
          description: Rate limit of the requester has crossed maximum limits.
        '500':
          description: Measure server encountered an unfortunate error. Report this to your server administrator.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'User access token issued at sign-in. Sent as

        `Authorization: Bearer <access-token>` unless cookies are used to send

        tokens. The `/auth/refresh` and `/auth/signout` endpoints expect the

        session''s refresh token in the same header format instead.

        '