Niche Auth API

The auth API from Niche — 11 operation(s) for auth.

GitHub OpenAPI

Operations 13

GET /auth/me Me #
DELETE /auth/me Delete Account #
GET /auth/me/export Export My Data #
PATCH /auth/me/welcome Mark Welcome Seen #
PATCH /auth/me/profile Update Profile #
PATCH /auth/me/notifications Update Notification Prefs #
GET /auth/me/security-events List Security Events #
POST /auth/me/sign-in-event Record Sign In #
POST /auth/me/email Change Email #
POST /auth/me/sessions/revoke Revoke All Sessions #
GET /auth/me/api-keys List Api Keys #
POST /auth/me/api-keys Create Api Key Route #
DELETE /auth/me/api-keys/{key_id} Revoke Api Key Route #

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/nicheangle-com:nicheangle-com-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

nicheangle-com-auth-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Signal Auth API
  version: 0.1.0
tags:
- name: Auth
paths:
  /auth/me:
    get:
      tags:
      - Auth
      summary: Me
      description: 'Identity + onboarding + plan state. One round-trip on first paint

        of any authed page; cached client-side until sign-out.'
      operationId: me_auth_me_get
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Auth
      summary: Delete Account
      description: 'Hard-delete the user''s account end-to-end.


        Order of operations:

        1. Best-effort cancel any active Stripe subscription (logged,

        non-fatal — a dangling sub is reconcilable; a half-deleted

        account is not).

        2. Delete every row the user owns, children-before-parents, in a

        single transaction. FK CASCADE is inconsistent across child

        tables (credits/api_keys/modules/oauth cascade; sessions,

        outputs, brand_*, etc. do NOT) so we delete explicitly. Session-

        keyed children (outputs, story_picks, scheduled_posts) go before

        their parent sessions. On any DB error we roll back — the user

        keeps a working account rather than a half-deleted one.

        3. Delete the app User row (cascading children clean up here).

        4. Delete the Supabase auth user via the admin API. Best-effort:

        the app data is already gone, so a failure here leaves an

        orphaned auth identity that we log for manual cleanup but still

        return success.


        `users.id` equals the Supabase auth uid — CurrentUser.id comes

        straight from the Supabase token `id` claim (see app/auth.py

        `_verify_supabase_bearer_token`), and `_ensure_user` writes the row

        with that same id. So the same UUID drives both the app deletes and

        the Supabase admin delete.'
      operationId: delete_account_auth_me_delete
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /auth/me/export:
    get:
      tags:
      - Auth
      summary: Export My Data
      description: 'GDPR-style "download my data" export.


        Returns everything we hold for the authenticated user as a single

        JSON document, served as a file attachment. Deliberately excludes

        secrets: social-connection OAuth tokens (access_token_enc /

        refresh_token_enc) and PAT secrets (key_hash) are NEVER included —

        only display-safe metadata. Giant raw signal blobs on sessions

        (raw_signals / stories / search_plan / niche_profile) are omitted;

        the user gets their decisions (story/angle picks + headline) and

        their finished content (outputs).'
      operationId: export_my_data_auth_me_export_get
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /auth/me/welcome:
    patch:
      tags:
      - Auth
      summary: Mark Welcome Seen
      description: 'Mark the welcome deck as seen. Called when the user clicks

        ''Type your beat →'' on the final slide OR clicks ''Skip''. Idempotent —

        re-marking just leaves the existing timestamp in place.'
      operationId: mark_welcome_seen_auth_me_welcome_patch
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /auth/me/profile:
    patch:
      tags:
      - Auth
      summary: Update Profile
      description: 'Set the optional display name shown in the header in place of the email.

        Trimmed + length-capped; empty clears it (back to the email).'
      operationId: update_profile_auth_me_profile_patch
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProfileUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /auth/me/notifications:
    patch:
      tags:
      - Auth
      summary: Update Notification Prefs
      description: 'Update notification preferences. Only fields present in the body

        are written; omitted fields are left untouched. Returns the updated

        three booleans.'
      operationId: update_notification_prefs_auth_me_notifications_patch
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationPrefs'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /auth/me/security-events:
    get:
      tags:
      - Auth
      summary: List Security Events
      description: 'The user''s ~50 most recent account-security events, newest-first.


        Surfaces the audit log on /settings (PAT mint/revoke, social

        connect/disconnect, etc.). `ip` and `user_agent` are deliberately

        NOT returned — they''re server-side-only forensic fields.'
      operationId: list_security_events_auth_me_security_events_get
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response List Security Events Auth Me Security Events Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /auth/me/sign-in-event:
    post:
      tags:
      - Auth
      summary: Record Sign In
      description: 'Record a sign-in for the security activity log.


        Sign-in happens at Supabase, not here, so the web client pings this

        on a genuine SIGNED_IN auth event. Supabase fires SIGNED_IN on more

        than just a fresh login (e.g. tab refocus / token refresh paths), so

        we dedupe server-side: if a sign_in event for this user already

        landed in the last 10 minutes, this is a no-op. The IP + user-agent

        are captured here, server-side, where they''re trustworthy.'
      operationId: record_sign_in_auth_me_sign_in_event_post
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /auth/me/email:
    post:
      tags:
      - Auth
      summary: Change Email
      description: 'Start an email change. We hand the new address to Supabase with

        `email_confirm: false` so Supabase fires its re-verification flow —

        we never auto-confirm.


        The app `users.email` column reconciles on the next token

        verification: `_ensure_user` in app/auth.py rewrites the app row''s

        email whenever the verified Supabase token''s email differs (the

        `elif user.email != email` branch). So once the user confirms via the

        link and their next token carries the new email, the app row follows

        automatically — no extra sync needed here.'
      operationId: change_email_auth_me_email_post
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChangeEmailRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /auth/me/sessions/revoke:
    post:
      tags:
      - Auth
      summary: Revoke All Sessions
      description: 'Sign out everywhere — revoke all refresh tokens via the Supabase

        admin logout endpoint. Existing access tokens keep working until they

        expire (short TTL), but no new ones can be minted.'
      operationId: revoke_all_sessions_auth_me_sessions_revoke_post
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /auth/me/api-keys:
    get:
      tags:
      - Auth
      summary: List Api Keys
      description: 'List all keys for the current user, including 24h credit burn

        per PAT. The full token is never returned — only the prefix +

        metadata + burn.


        Burn computation: one GROUP BY on credit_transactions for the

        user''s keys. Avoids N+1; cheap even at hundreds of PATs.'
      operationId: list_api_keys_auth_me_api_keys_get
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response List Api Keys Auth Me Api Keys Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - Auth
      summary: Create Api Key Route
      description: 'Mint a new PAT. The plaintext is returned exactly once in the

        response body — the UI must show it immediately and warn the user

        they won''t see it again.


        PAT issuance is plan-gated (the locked pricing makes the agent surface

        a paid feature): Creator/free = 0, Studio = 1, Operator = unlimited.

        We gate minting, not per-call — the token IS the capability. Existing

        keys on a now-ineligible plan are left intact (no retroactive

        lockout); only NEW issuance is blocked.'
      operationId: create_api_key_route_auth_me_api_keys_post
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateKeyRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateKeyResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /auth/me/api-keys/{key_id}:
    delete:
      tags:
      - Auth
      summary: Revoke Api Key Route
      description: Soft-delete the key. Subsequent requests with that token return 401.
      operationId: revoke_api_key_route_auth_me_api_keys__key_id__delete
      parameters:
      - name: key_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Key Id
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ProfileUpdate:
      properties:
        display_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Display Name
      type: object
      title: ProfileUpdate
    NotificationPrefs:
      properties:
        notify_run_complete:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Notify Run Complete
        notify_trial_marketing:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Notify Trial Marketing
        notify_product_updates:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Notify Product Updates
        notify_digest:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Notify Digest
      type: object
      title: NotificationPrefs
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CreateKeyRequest:
      properties:
        name:
          type: string
          title: Name
          default: ''
      type: object
      title: CreateKeyRequest
    ChangeEmailRequest:
      properties:
        new_email:
          type: string
          format: email
          title: New Email
      type: object
      required:
      - new_email
      title: ChangeEmailRequest
    CreateKeyResponse:
      properties:
        key:
          $ref: '#/components/schemas/ApiKeyOut'
        plaintext:
          type: string
          title: Plaintext
      type: object
      required:
      - key
      - plaintext
      title: CreateKeyResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    ApiKeyOut:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        prefix:
          type: string
          title: Prefix
        created_at:
          type: string
          title: Created At
        last_used_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Used At
        disabled_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Disabled At
        burn_24h_credits:
          type: integer
          title: Burn 24H Credits
          default: 0
      type: object
      required:
      - id
      - name
      - prefix
      - created_at
      - last_used_at
      - disabled_at
      title: ApiKeyOut