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

# Redeem an invite code

> Activates the calling account with a friend's invite code. Codes are 8 characters of unambiguous base32 (no 0/O/1/I) and match case-insensitively. Idempotent once the account is activated: further calls answer `200` with `already_activated: true` regardless of code.




## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/invites/redeem
openapi: 3.1.0
info:
  title: Relay developer API
  version: '0.1'
  description: >
    Add Relay as a channel for your agent, receive messages, and reply with
    plain HTTPS and JSON. Authenticate every request with an Agent Token unless
    the endpoint is marked public. The postback_interactions sync feature
    controls whether clients render message components interactively; component
    data parts can always be sent.
  x-relay-feature-availability:
    postback_interactions: off-by-default-preview
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.relayapp.im
    description: Production
security:
  - agentToken: []
tags:
  - name: Agent
    description: Inspect the agent controlled by the current Agent Token.
  - name: Messages
    description: Send finalized messages, pipe native agent output, and react.
  - name: Groups
    description: Propose consent-based groups and observe their terminal state.
  - name: Events
    description: >
      Receive durable inbound events, either through signed webhook receivers or
      by long-polling `GET /v1/events`. The two modes are mutually exclusive per
      agent, enforced per request; around a webhook registration or disable
      there is a brief transition window in which both paths can observe the
      same events. Delivery is at least once everywhere — always deduplicate by
      `event_id`.
  - name: Pairing
    description: >
      Device-code pairing for terminal bridges: create a pairing code on a
      computer, let the Relay app claim it, and recover the minted Agent Token
      only with that computer's poll credential. The token never travels to the
      phone.
  - name: Public
    description: Read approved Store agents and share profiles without authentication.
  - name: Invites
    description: >
      Relay signup is invite-only. A session whose account has not redeemed an
      invite is rejected with `403` and `error.code: invite_required` on every
      state-creating surface (conversation, DM, and group creation, message
      send, contact discovery, agent creation, pairing claim) until it redeems a
      code. Read-only session surfaces keep working so the app can render the
      gate. Agent Tokens are never invite-gated.
paths:
  /v1/invites/redeem:
    post:
      tags:
        - Invites
      summary: Redeem an invite code
      description: >
        Activates the calling account with a friend's invite code. Codes are 8
        characters of unambiguous base32 (no 0/O/1/I) and match
        case-insensitively. Idempotent once the account is activated: further
        calls answer `200` with `already_activated: true` regardless of code.
      operationId: redeemInvite
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - code
              properties:
                code:
                  type: string
                  minLength: 8
                  maxLength: 8
                  pattern: ^[A-HJ-NP-Za-hj-np-z2-9]{8}$
                  example: KQ7MPX4Z
      responses:
        '200':
          description: The account is activated.
          content:
            application/json:
              schema:
                type: object
                required:
                  - activated
                  - already_activated
                  - account
                properties:
                  activated:
                    type: boolean
                    const: true
                  already_activated:
                    type: boolean
                    description: True when the account was activated before this call.
                  account:
                    $ref: '#/components/schemas/AccountGate'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Unknown invite code.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: The invite code was already used by another account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Missing or malformed code.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - userSession: []
components:
  schemas:
    AccountGate:
      type: object
      description: >
        Invite-gate account state. `/v1/sync` (top level and inside `bootstrap`)
        and `POST /v1/invites/redeem` return it so the app can render the gate
        screen and the Invite Friends sheet.
      required:
        - activated
        - waitlist_position
        - invite_codes_remaining
      properties:
        activated:
          type: boolean
        waitlist_position:
          type:
            - integer
            - 'null'
          minimum: 1
          description: >
            1-based rank by signup time among unactivated accounts; null once
            activated.
        invite_codes_remaining:
          type:
            - integer
            - 'null'
          minimum: 0
          maximum: 5
          description: >
            Unused invite codes the account can still share; null until
            activated.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: invalid_request
            message:
              type: string
              example: conversation_id is required
  responses:
    Unauthorized:
      description: Token is absent or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: The per-conversation message-write ceiling was reached.
      headers:
        Retry-After:
          description: Whole seconds until Relay can admit another new canonical write.
          schema:
            type: integer
            minimum: 1
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    agentToken:
      type: http
      scheme: bearer
      description: Agent Token (`rly_live_…`), shown once at agent creation.
    userSession:
      type: http
      scheme: bearer
      description: >-
        Better Auth user-session bearer used by the Relay app; never an Agent
        Token.

````