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

# Redeem bootstrap code for token pair

> Exchanges the single-use bootstrap code (extracted from the return_to URL fragment) for a contact JWT access+refresh token pair. Sets the refresh token as an HttpOnly cookie. The request Origin header is verified against the origin stored in the code.



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/external-login/session
openapi: 3.1.0
info:
  description: >-
    Production API reference for Membership.io. Use the authored guides for
    workflows and the generated endpoint pages for exact parameters and schemas.
  title: Membership.io API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.member.dev
security:
  - bearerAuth: []
paths:
  /api/v1/external-login/session:
    post:
      tags:
        - external-login
      summary: Redeem bootstrap code for token pair
      description: >-
        Exchanges the single-use bootstrap code (extracted from the return_to
        URL fragment) for a contact JWT access+refresh token pair. Sets the
        refresh token as an HttpOnly cookie. The request Origin header is
        verified against the origin stored in the code.
      operationId: external_login.post_external_login_post_external_login_session
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/_SessionRequest'
        required: true
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema: {}
          description: Successful Response
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    _SessionRequest:
      properties:
        code:
          title: Code
          type: string
      required:
        - code
      title: _SessionRequest
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT or mio_sk API key
      description: >-
        Send platform JWTs, contact JWTs, or team API keys as `Authorization:
        Bearer <token>`.
      scheme: bearer
      type: http

````