InstantDB Auth API

Server-side authentication, tokens, and users.

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/instantdb-auth-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

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

OpenAPI Specification

instantdb-auth-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: InstantDB Admin HTTP Auth API
  description: HTTP Admin API for InstantDB (Instant), the realtime client-side database. The Admin API runs server-side at https://api.instantdb.com, authenticated with a Bearer admin token plus an App-Id header, and bypasses permission rules. It exposes InstaQL reads (POST /admin/query), InstaML writes (POST /admin/transact), auth (refresh tokens, magic codes, users), storage (upload, list, delete), and presence.
  termsOfService: https://www.instantdb.com/terms
  contact:
    name: InstantDB Support
    url: https://www.instantdb.com/docs/http-api
  version: '1.0'
servers:
- url: https://api.instantdb.com
  description: InstantDB production Admin API
security:
- adminToken: []
tags:
- name: Auth
  description: Server-side authentication, tokens, and users.
paths:
  /admin/refresh_tokens:
    post:
      operationId: adminRefreshTokens
      tags:
      - Auth
      summary: Create a refresh token for a user
      description: Generates an auth (refresh) token for a user identified by email or id, creating the user if they do not already exist. Optionally set custom `$users` fields with `extra-fields`.
      parameters:
      - $ref: '#/components/parameters/AppId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
                id:
                  type: string
                extra-fields:
                  type: object
                  additionalProperties: true
            example:
              email: alyssa_p_hacker@instantdb.com
      responses:
        '200':
          description: A user record with a refresh token.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '401':
          $ref: '#/components/responses/Error'
  /admin/magic_code:
    post:
      operationId: adminCreateMagicCode
      tags:
      - Auth
      summary: Create a magic code
      description: Creates a magic code for the given email without sending it, so you can deliver it through your own provider.
      parameters:
      - $ref: '#/components/parameters/AppId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - email
              properties:
                email:
                  type: string
                  format: email
      responses:
        '200':
          description: The generated magic code.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /admin/send_magic_code:
    post:
      operationId: adminSendMagicCode
      tags:
      - Auth
      summary: Create and send a magic code
      description: Creates a magic code and sends it to the email via Instant's provider.
      parameters:
      - $ref: '#/components/parameters/AppId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - email
              properties:
                email:
                  type: string
                  format: email
      responses:
        '200':
          description: Magic code sent.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /admin/verify_magic_code:
    post:
      operationId: adminVerifyMagicCode
      tags:
      - Auth
      summary: Verify a magic code
      description: Verifies a magic code for an email and returns the user, creating it if needed. Optionally set custom `$users` fields with `extra-fields`.
      parameters:
      - $ref: '#/components/parameters/AppId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - email
              - code
              properties:
                email:
                  type: string
                  format: email
                code:
                  type: string
                extra-fields:
                  type: object
                  additionalProperties: true
      responses:
        '200':
          description: The verified user with a refresh token.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /admin/users:
    get:
      operationId: adminGetUser
      tags:
      - Auth
      summary: Look up a user
      description: Fetches an app user by email, id, or refresh_token.
      parameters:
      - $ref: '#/components/parameters/AppId'
      - name: email
        in: query
        schema:
          type: string
          format: email
      - name: id
        in: query
        schema:
          type: string
      - name: refresh_token
        in: query
        schema:
          type: string
      responses:
        '200':
          description: The matching user.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '404':
          $ref: '#/components/responses/Error'
    delete:
      operationId: adminDeleteUser
      tags:
      - Auth
      summary: Delete a user
      description: Permanently deletes an app user by email, id, or refresh_token.
      parameters:
      - $ref: '#/components/parameters/AppId'
      - name: email
        in: query
        schema:
          type: string
          format: email
      - name: id
        in: query
        schema:
          type: string
      - name: refresh_token
        in: query
        schema:
          type: string
      responses:
        '200':
          description: The deleted user.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /admin/sign_out:
    post:
      operationId: adminSignOut
      tags:
      - Auth
      summary: Sign a user out
      description: Invalidates a user's sessions / refresh tokens. Identify the user by email, id, or refresh_token.
      parameters:
      - $ref: '#/components/parameters/AppId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
                id:
                  type: string
                refresh_token:
                  type: string
      responses:
        '200':
          description: Sign-out succeeded.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /runtime/auth/verify_refresh_token:
    post:
      operationId: verifyRefreshToken
      tags:
      - Auth
      summary: Verify a refresh token
      description: Validates a refresh token for an app and returns the associated user.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - app-id
              - refresh-token
              properties:
                app-id:
                  type: string
                refresh-token:
                  type: string
      responses:
        '200':
          description: The user associated with the refresh token.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '401':
          $ref: '#/components/responses/Error'
components:
  responses:
    Error:
      description: Error response.
      content:
        application/json:
          schema:
            type: object
            properties:
              type:
                type: string
              message:
                type: string
            additionalProperties: true
  parameters:
    AppId:
      name: App-Id
      in: header
      required: true
      description: The Instant application id.
      schema:
        type: string
  securitySchemes:
    adminToken:
      type: http
      scheme: bearer
      description: 'Admin token issued in the InstantDB dashboard, sent as `Authorization: Bearer $ADMIN_TOKEN`.'