WitWiki Auth API

The Auth API from WitWiki, for auth.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 10

POST /api/auth/register Register a new user (auto-provisions a personal org + project) #
POST /api/auth/login Log in (sets refresh cookie; may require TOTP) #
POST /api/auth/totp/login Complete login with a TOTP code + challenge token #
POST /api/auth/refresh Exchange the refresh cookie for a new access token #
POST /api/auth/logout Log out (clears refresh cookie) #
GET /api/auth/invite/{token} Look up a pending org invite by token #
POST /api/auth/invite/{token}/accept Accept an org invite #
GET /api/auth/me Current authenticated user #
POST /api/auth/totp/setup Begin TOTP enrollment (returns secret + otpauth URL) #
POST /api/auth/totp/verify Verify a TOTP code to enable MFA #

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/witwiki-app:witwiki-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

witwiki-app-auth-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: WitWiki Auth API
  version: 1.0.0
  description: 'REST API for **WitWiki** — a hosted, MCP-native, cross-linked knowledge base

    that gives LLM agents and humans a shared, persistent wiki.


    This document is hand-authored (source at `api/internal/openapi/openapi.yaml`,

    embedded into the binary) and served at `GET /openapi.yaml`, with interactive

    Swagger UI at `GET /docs`. It covers the

    REST surface rooted at `/api`, plus the open auth routes, OAuth discovery, and

    the Stripe webhook. The MCP transport at `/mcp` is documented separately

    (`docs/witwiki-mcp.md`); it is not a REST surface.


    ## Authentication

    All `/api/*` routes (except the open auth routes below) require a bearer token

    in the `Authorization` header. The token may be either:

    - a **project API key** (resolves directly to a project), or

    - a **JWT session access token** (from `POST /api/auth/login`). On the JWT path,

    send the active project in the `X-Project-ID` header.


    ## Errors

    Errors are returned as `{ "error": "" }` with an appropriate status

    (400 invalid input, 401 unauthenticated, 403 role/scope denied, 404 not found,

    402 quota exceeded, 409/410 transfer state conflicts, 500 internal).'
servers:
- url: https://api.witwiki.app
  description: Production
- url: http://localhost:8080
  description: Local development
security:
- bearerAuth: []
tags:
- name: Auth
paths:
  /api/auth/register:
    post:
      tags:
      - Auth
      summary: Register a new user (auto-provisions a personal org + project)
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Credentials'
      responses:
        '201':
          description: Created user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          $ref: '#/components/responses/BadRequest'
      operationId: postApiAuthRegister
      x-operation-id-source: derived
  /api/auth/login:
    post:
      tags:
      - Auth
      summary: Log in (sets refresh cookie; may require TOTP)
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Credentials'
      responses:
        '200':
          description: Session tokens, or a TOTP challenge
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoginResult'
        '401':
          $ref: '#/components/responses/Unauthorized'
      operationId: postApiAuthLogin
      x-operation-id-source: derived
  /api/auth/totp/login:
    post:
      tags:
      - Auth
      summary: Complete login with a TOTP code + challenge token
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                challenge_token:
                  type: string
                code:
                  type: string
      responses:
        '200':
          description: Session tokens
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoginResult'
      operationId: postApiAuthTotpLogin
      x-operation-id-source: derived
  /api/auth/refresh:
    post:
      tags:
      - Auth
      summary: Exchange the refresh cookie for a new access token
      security: []
      responses:
        '200':
          description: New access token
        '401':
          $ref: '#/components/responses/Unauthorized'
      operationId: postApiAuthRefresh
      x-operation-id-source: derived
  /api/auth/logout:
    post:
      tags:
      - Auth
      summary: Log out (clears refresh cookie)
      security: []
      responses:
        '204':
          description: Logged out
      operationId: postApiAuthLogout
      x-operation-id-source: derived
  /api/auth/invite/{token}:
    get:
      tags:
      - Auth
      summary: Look up a pending org invite by token
      security: []
      parameters:
      - name: token
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Invite details
        '404':
          $ref: '#/components/responses/NotFound'
      operationId: getApiAuthInviteByToken
      x-operation-id-source: derived
  /api/auth/invite/{token}/accept:
    post:
      tags:
      - Auth
      summary: Accept an org invite
      security: []
      parameters:
      - name: token
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Accepted
      operationId: postApiAuthInviteByTokenAccept
      x-operation-id-source: derived
  /api/auth/me:
    get:
      tags:
      - Auth
      summary: Current authenticated user
      responses:
        '200':
          description: User
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '401':
          $ref: '#/components/responses/Unauthorized'
      operationId: getApiAuthMe
      x-operation-id-source: derived
  /api/auth/totp/setup:
    post:
      tags:
      - Auth
      summary: Begin TOTP enrollment (returns secret + otpauth URL)
      responses:
        '200':
          description: TOTP secret
      operationId: postApiAuthTotpSetup
      x-operation-id-source: derived
  /api/auth/totp/verify:
    post:
      tags:
      - Auth
      summary: Verify a TOTP code to enable MFA
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
      responses:
        '200':
          description: Enabled
      operationId: postApiAuthTotpVerify
      x-operation-id-source: derived
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
      required:
      - error
    Credentials:
      type: object
      required:
      - email
      - password
      properties:
        email:
          type: string
          format: email
        password:
          type: string
          format: password
    LoginResult:
      type: object
      properties:
        access_token:
          type: string
        user:
          $ref: '#/components/schemas/User'
        requires_totp:
          type: boolean
        challenge_token:
          type: string
    User:
      type: object
      properties:
        id:
          type: string
        email:
          type: string
          format: email
        created_at:
          type: string
          format: date-time
  responses:
    BadRequest:
      description: Invalid input
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A project API key or a JWT session access token.