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

# Send an email to invite a user to a team

> The user receiving this email can join the team by clicking on the link in the email. If the user does not have an account yet, they will be prompted to create one.



## OpenAPI

````yaml /openapi/client.json post /team-invitations/send-code
openapi: 3.1.0
info:
  title: Hexclave REST API
  version: 1.0.0
  description: >-
    The Hexclave REST API. All request headers are documented as canonical
    `X-Hexclave-*`; the equivalent `X-Stack-*` aliases are accepted on every
    endpoint for backwards compatibility. Response headers
    `X-Hexclave-actual-status`, `X-Hexclave-known-error`, and
    `X-Hexclave-request-id` are emitted alongside their legacy `X-Stack-*`
    equivalents.
servers:
  - url: https://api.hexclave.com/api/v1
    description: Hexclave REST API
security: []
paths:
  /team-invitations/send-code:
    post:
      tags:
        - Teams
      summary: Send an email to invite a user to a team
      description: >-
        The user receiving this email can join the team by clicking on the link
        in the email. If the user does not have an account yet, they will be
        prompted to create one.
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                team_id:
                  type: string
                  example: ad962777-8244-496a-b6a2-e0c6a449c79e
                  description: The unique identifier of the team
                email:
                  type: string
                  example: johndoe@example.com
                  description: The email of the user to invite.
                callback_url:
                  type: string
                  example: https://example.com/handler/team-invitation
                  description: >-
                    The base callback URL to construct an invite link with. A
                    query parameter `code` with the verification code will be
                    appended to it. The page should then make a request to the
                    `/team-invitations/accept` endpoint.
              required:
                - team_id
                - email
                - callback_url
              example:
                team_id: ad962777-8244-496a-b6a2-e0c6a449c79e
                email: johndoe@example.com
                callback_url: https://example.com/handler/team-invitation
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  id:
                    type: string
                required:
                  - success
                  - id

````