> ## Documentation Index
> Fetch the complete documentation index at: https://docs.echozero.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Verify an OAuth callback and issue tokens

> Call this endpoint after the OAuth provider redirects back with `code` and `state`. Returns the same payload as `/auth/verify`.



## OpenAPI

````yaml https://mcp.echozero.app/api/docs-json post /api/auth/social/verify
openapi: 3.0.0
info:
  title: EchoZero MCP API
  description: >-
    EchoZero MCP Server - Developer API for agent management, trading,
    marketplace, and AI chat.


    **Rate Limiting:** All endpoints enforce per-API-key rate limits. Tiers:
    free (60 req/min), standard (300 req/min), premium (1000 req/min). Every
    response includes `X-RateLimit-Limit`, `X-RateLimit-Remaining`,
    `X-RateLimit-Reset` headers. Exceeding the limit returns `429 Too Many
    Requests` with a `Retry-After` header.
  version: '1.0'
  contact: {}
servers:
  - url: https://mcp.echozero.app
    description: Production
security: []
tags:
  - name: MCP Protocol
    description: >-
      Model Context Protocol (Streamable HTTP): `/mcp`, `/mcp/sse` — not under
      `/api`; same API key as REST
  - name: Health
    description: Server health check
  - name: API Keys
    description: API key generation, listing, and revocation
  - name: User
    description: >-
      User profile, sessions, social, onboarding, internal agent subscriptions,
      and bot activations (v1: /v1/users/me)
  - name: Token
    description: Token data and trending
  - name: Trade
    description: Trade execution and history
  - name: Strategy
    description: Strategy (trading bot) configuration and control
  - name: Agent
    description: Agent registration and management
  - name: AI
    description: AI chat, intent, and insights
  - name: Wallet
    description: Wallet operations, deposits, and withdrawals
  - name: Notification
    description: Notification management and settings
  - name: Auth
    description: >-
      Public authentication: signup / login lookup, code verification, Google
      OAuth, refresh, and sign-out. Returns `accessToken` / `refreshToken` in
      the JSON body.
  - name: OAuth
    description: >-
      OAuth 2.1 authorization-code + PKCE for AI assistant clients:
      `/oauth/authorize`, `/oauth/token`, `/oauth/introspect`, `/status`.
  - name: Activity
    description: User trade activity list and search
  - name: Feed
    description: Social activity feed timeline
  - name: Earn
    description: Leaderboard, rewards, and referrals
  - name: Statics
    description: Countries, languages, and static data
  - name: Misc
    description: File uploads and utility endpoints
  - name: Developer
    description: Developer registration and profile
  - name: Developer dashboard
    description: >-
      Per-agent dashboard: subscribers (anonymized), performance detail, signal
      history (v1)
  - name: Developer Agent
    description: Developer agent listings and management
  - name: Developer Agents (Marketplace)
    description: Public browse, search, and subscribe to external developer-listed agents
  - name: Admin
    description: Admin-only endpoints for review, approval, and platform management
  - name: Webhooks
    description: >-
      Inbound provider webhooks (no API key). Telegram signal-bot uses
      `X-Telegram-Bot-Api-Secret-Token` when configured.
paths:
  /api/auth/social/verify:
    post:
      tags:
        - Auth
      summary: Verify an OAuth callback and issue tokens
      description: >-
        Call this endpoint after the OAuth provider redirects back with `code`
        and `state`. Returns the same payload as `/auth/verify`.
      operationId: McpAuthController_verifySocialAuth
      parameters:
        - name: x-signature
          in: header
          required: false
          description: >-
            HMAC-SHA256 signature: HMAC-SHA256(secretKey, timestamp + METHOD +
            path + body). Optional -- when omitted, HMAC verification is
            skipped.
          schema:
            type: string
        - name: x-timestamp
          in: header
          required: false
          description: >-
            Request timestamp in epoch milliseconds. Required when x-signature
            is provided. Rejected if drift exceeds 5 minutes.
          schema:
            type: string
      requestBody:
        required: true
        description: OpenAPI schema **McpVerifySocialAuthBodyDto**.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/McpVerifySocialAuthBodyDto'
            examples:
              minimal:
                summary: State only
                description: >-
                  Send the `state` returned from `/auth/social/url`; `code` is
                  populated by the OAuth provider callback.
                value:
                  state: 550e8400-e29b-41d4-a716-446655440000
              fullAllFields:
                summary: State + code from OAuth callback
                value:
                  state: 550e8400-e29b-41d4-a716-446655440000
                  code: oauth_authorization_code_from_google
      responses:
        '200':
          description: Social authentication succeeded; tokens issued.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/McpSuccessResponseDto'
                  - properties:
                      data:
                        $ref: '#/components/schemas/McpLoginResponseDto'
        '400':
          description: Invalid / expired state or missing OAuth code.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpErrorResponseDto'
components:
  schemas:
    McpVerifySocialAuthBodyDto:
      type: object
      properties:
        state:
          type: string
          description: >-
            UUID state value returned from the corresponding `/auth/social/url`
            call.
          format: uuid
          example: 550e8400-e29b-41d4-a716-446655440000
        code:
          type: string
          description: Authorization code forwarded from the OAuth provider callback.
      required:
        - state
    McpSuccessResponseDto:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          description: Endpoint-specific payload
          additionalProperties: true
      required:
        - success
        - data
    McpLoginResponseDto:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
            - error
        newUser:
          type: boolean
        onBoardingCompleted:
          type: boolean
        mfaRequired:
          type: boolean
        user:
          $ref: '#/components/schemas/McpAuthUserDto'
        tokens:
          description: >-
            Issued tokens. Present on successful non-MFA authentications;
            `mfaAccessToken` only when `mfaRequired` is true.
          allOf:
            - $ref: '#/components/schemas/McpAuthTokensDto'
        errorMessage:
          type: string
        unlocksAt:
          type: string
          format: date-time
      required:
        - status
    McpErrorResponseDto:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          $ref: '#/components/schemas/McpErrorBodyDto'
      required:
        - success
        - error
    McpAuthUserDto:
      type: object
      properties:
        id:
          type: string
          example: 507f1f77bcf86cd799439011
        username:
          type: string
          example: alice_bob
        email:
          type: string
          example: alice@example.com
        languageCode:
          type: string
          enum:
            - EN
            - PT
            - ES
            - RU
            - FR
            - JA
            - UK
            - TR
        emailVerifiedAt:
          type: string
          format: date-time
      required:
        - id
        - username
    McpAuthTokensDto:
      type: object
      properties:
        accessToken:
          type: string
          description: >-
            Short-lived JWT access token. Send as `Authorization: Bearer
            <token>`.
        refreshToken:
          type: string
          description: Long-lived opaque refresh token. Exchange via `POST /auth/refresh`.
        mfaAccessToken:
          type: string
          description: >-
            JWT issued when the account requires MFA verification before login
            can complete.
    McpErrorBodyDto:
      type: object
      properties:
        code:
          type: string
          example: NOT_FOUND
        message:
          type: string
          example: Resource not found
      required:
        - code
        - message

````