notanATS OAuth — flow API

The OAuth — flow API from notanATS — 4 operation(s) for oauth — flow.

GitHub OpenAPI

Operations 5

GET /oauth/authorize Authorization endpoint (browser page, not a JSON API) #
POST /oauth/token Token endpoint (OAuth 2.1, public clients, PKCE) #
GET /oauth/userinfo UserInfo endpoint (OpenID Connect, OAuth Bearer access token) #
POST /oauth/userinfo UserInfo endpoint (OpenID Connect, POST form of the GET operation) #
POST /api/oauth/decision Request / consent / cancel actions behind the authorize page (manager session) #

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/notanats-com:notanats-com-oauth-flow-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

notanats-com-oauth-flow-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: notanATS Agent API + OAuth OAuth — flow API
  version: 1.0.0
  description: 'Generated from the implemented route contracts (src/lib/agent-contract/openapi.ts) — do not edit the published file by hand; run `npm run contract:generate`. Covers the delegated-agent REST API (Bearer static nagt_ keys only — OAuth access tokens (noat_) authenticate the MCP transport only and do NOT authenticate REST; see the known gap in docs/agent/README.md), the legacy /api/v1 data reads (nagt_ or nats_), and the OAuth 2.1 endpoints. The MCP server at /mcp is JSON-RPC, not REST, and is contracted separately in /agent/mcp-contract.json. Quickstart: docs/agent/quickstart.md.'
servers:
- url: https://notanats.com
tags:
- name: OAuth — flow
paths:
  /oauth/authorize:
    get:
      operationId: oauthAuthorize
      tags:
      - OAuth — flow
      summary: Authorization endpoint (browser page, not a JSON API)
      description: 'The webapp page a client sends the manager’s browser to. Query: response_type=code (only), client_id (an https URL of a Client ID Metadata Document), redirect_uri (must EXACTLY match the client document), code_challenge + code_challenge_method=S256 (required; plain is never accepted), state, resource (must be this deployment’s /mcp URL). A signed-out manager is sent to /login and returns to this exact URL. The page walks: no live request → request connection (admins are notified, NO access exists while pending) → pending → approved → consent naming the organization and the manager the agent will represent → the decision endpoint issues a single-use code. Denied requests state the denial plainly; a denied manager may request again after 24 hours.'
      parameters:
      - name: response_type
        in: query
        required: true
        schema:
          type: string
          enum:
          - code
      - name: client_id
        in: query
        required: true
        schema:
          type: string
          format: uri
      - name: redirect_uri
        in: query
        required: true
        schema:
          type: string
          format: uri
      - name: code_challenge
        in: query
        required: true
        schema:
          type: string
      - name: code_challenge_method
        in: query
        required: true
        schema:
          type: string
          enum:
          - S256
      - name: state
        in: query
        schema:
          type: string
      - name: resource
        in: query
        schema:
          type: string
          format: uri
      security:
      - managerSession: []
      responses:
        '200':
          description: An HTML page (request / waiting / consent / denied states).
        '302':
          description: Redirect to /login (signed-out manager, full authorize URL preserved), or to the client redirect_uri with code + state after consent.
  /oauth/token:
    post:
      operationId: oauthToken
      tags:
      - OAuth — flow
      summary: Token endpoint (OAuth 2.1, public clients, PKCE)
      description: 'Form-encoded. authorization_code: code + client_id + redirect_uri + code_verifier (+ optional resource, which must name this deployment’s /mcp URL). Codes are single-use, bound to the approved connection request, client, redirect URI, manager, organization, PKCE challenge, and resource, and live 10 minutes. refresh_token: refresh tokens rotate — replaying a consumed refresh token is rejected, and refresh can never restore denied, revoked, or expired access (a credential past its expires_at, WO-552, is dead at redemption, refresh, and resolution alike). Access tokens live 1 hour; refresh tokens 30 days. Errors follow RFC 6749 §5.2 and are uniformly invalid_grant for grant failures — the endpoint never reveals which binding failed.'
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                grant_type:
                  type: string
                  enum:
                  - authorization_code
                  - refresh_token
                code:
                  type: string
                client_id:
                  type: string
                redirect_uri:
                  type: string
                code_verifier:
                  type: string
                refresh_token:
                  type: string
                resource:
                  type: string
              required:
              - grant_type
      security: []
      responses:
        '200':
          description: Tokens issued.
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                  token_type:
                    type: string
                    enum:
                    - Bearer
                  expires_in:
                    type: integer
                    enum:
                    - 3600
                  refresh_token:
                    type: string
        '400':
          description: 'RFC 6749 §5.2 error: { error, error_description } — invalid_request, invalid_grant, or unsupported_grant_type.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  error_description:
                    type: string
        '500':
          description: server_error.
  /oauth/userinfo:
    get:
      operationId: oauthUserinfo
      tags:
      - OAuth — flow
      summary: UserInfo endpoint (OpenID Connect, OAuth Bearer access token)
      description: 'The OIDC UserInfo endpoint: the caller presents an OAuth access token (noat_) as an Authorization: Bearer header — the token authenticates by possession, never by session, which is why this operation carries the token endpoint’s "public" security class (the credential travels in the header, documented below, not in a session). Validation is the resource server’s own path (the same resolution /mcp uses): token row unrevoked and unexpired, audience this deployment’s /mcp resource, credential unrevoked, unexpired, and issued through the OAuth channel only — an api_key-channel credential and a static nagt_ key are refused — and the delegated manager present, same-organization, active, and unblocked. Success returns exactly three claims for the delegated manager: sub (the manager id), name, email. Every failure is the same 401 invalid_token (RFC 6750) with the RFC 9728 WWW-Authenticate discovery challenge /mcp also sends — the endpoint never reveals which check failed.'
      parameters:
      - name: Authorization
        in: header
        required: true
        description: Bearer <OAuth access token> — an access token issued by POST /oauth/token.
        schema:
          type: string
      security: []
      responses:
        '200':
          description: The delegated manager’s claims.
          content:
            application/json:
              schema:
                type: object
                properties:
                  sub:
                    type: string
                  name:
                    type: string
                  email:
                    type: string
                    format: email
                required:
                - sub
                - name
                - email
        '401':
          description: 'RFC 6750 error: { error: "invalid_token", error_description } — missing, malformed, unknown, revoked, or expired token; a token for a revoked, expired, or non-OAuth credential; or a deactivated, blocked, or missing delegated manager. Carries the WWW-Authenticate discovery challenge.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                    - invalid_token
                  error_description:
                    type: string
    post:
      operationId: oauthUserinfoPost
      tags:
      - OAuth — flow
      summary: UserInfo endpoint (OpenID Connect, POST form of the GET operation)
      description: 'The POST form of the UserInfo endpoint (OIDC UserInfo is defined for both GET and POST): identical Bearer OAuth access-token authentication, identical validation path, and identical claims and 401 invalid_token behaviour as GET /oauth/userinfo. No request body is read.'
      parameters:
      - name: Authorization
        in: header
        required: true
        description: Bearer <OAuth access token> — an access token issued by POST /oauth/token.
        schema:
          type: string
      security: []
      responses:
        '200':
          description: The delegated manager’s claims.
          content:
            application/json:
              schema:
                type: object
                properties:
                  sub:
                    type: string
                  name:
                    type: string
                  email:
                    type: string
                    format: email
                required:
                - sub
                - name
                - email
        '401':
          description: 'RFC 6750 error: { error: "invalid_token", error_description }, with the WWW-Authenticate discovery challenge — identical to the GET operation.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                    - invalid_token
                  error_description:
                    type: string
  /api/oauth/decision:
    post:
      operationId: oauthDecision
      tags:
      - OAuth — flow
      summary: Request / consent / cancel actions behind the authorize page (manager session)
      description: 'Session-authenticated. Body action: "request" creates the pending connection request (admins are notified; no credential or token exists while pending), "consent" (after admin approval) mints the admin-approved delegated credential and the single-use authorization code, "cancel" abandons the flow. A token request is never held open waiting for another person’s approval — approval and consent are separate steps, and after approval the manager starts a FRESH authorization flow to reconnect.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                action:
                  type: string
                  enum:
                  - request
                  - consent
                  - cancel
      security:
      - managerSession: []
      responses:
        '200':
          description: Action applied.
          content:
            application/json:
              schema:
                type: object
        '400':
          description: 'Session-surface error shape { error: "<string>" } — missing client/redirect, an unmatched redirect URI, an invalid request_id or code challenge, or an unknown action.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '401':
          description: 'Session-surface error shape { error: "Unauthorized" } — no manager session.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '403':
          description: 'Session-surface error shape { error: "<string>" } — e.g. an inactive manager.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '404':
          description: 'Session-surface error shape { error: "<string>" } — consent for a missing request.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '409':
          description: 'Session-surface error shape { error: "<string>" } — e.g. consent before approval, or approval for a different resource.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
components:
  securitySchemes:
    agentBearer:
      type: http
      scheme: bearer
      description: 'A static delegated agent key (prefix nagt_) minted by an organization admin for a named delegated manager. This is the ONLY credential class the REST agent API authenticates: the REST guard resolves nagt_ (and, on the legacy /api/v1 data routes, nats_) keys only. An OAuth access token (noat_) does NOT authenticate REST — it resolves only in the MCP seam at /mcp.'
    v1Bearer:
      type: http
      scheme: bearer
      description: 'For the legacy /api/v1 data routes only: a delegated agent key (nagt_) or a legacy organization key (nats_). Agent keys are narrowed to their delegated manager’s visibility; legacy org keys keep organization scope.'
    managerSession:
      type: apiKey
      in: cookie
      name: sb-*-auth-token
      description: The signed-in manager/admin webapp session, carried by the app’s Supabase SSR session cookies (the sb-<project>-auth-token cookie and any chunked companions, set at sign-in; the exact cookie name is derived from the Supabase project, so the name shown is a pattern, not a literal). These surfaces are not callable with an agent credential.