> ## 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.

# Create a contact channel

> Add a new contact channel for a user.



## OpenAPI

````yaml /openapi/server.json post /contact-channels
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:
  /contact-channels:
    post:
      tags:
        - Contact Channels
      summary: Create a contact channel
      description: Add a new contact channel for a user.
      parameters:
        - name: user_id
          in: query
          schema:
            type: string
            example: 3241a285-8329-4d69-8f3d-316e08cf140c
            description: >-
              The ID of the user, or the special value `me` for the currently
              authenticated user
          description: >-
            The ID of the user, or the special value `me` for the currently
            authenticated user
          required: false
        - name: contact_channel_id
          in: query
          schema:
            type: string
          required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                is_verified:
                  type: boolean
                  example: true
                  description: >-
                    Whether the contact channel has been verified. If this is
                    set to `true`, the contact channel has been verified to
                    belong to the user.
                user_id:
                  type: string
                  example: 3241a285-8329-4d69-8f3d-316e08cf140c
                  description: >-
                    The ID of the user, or the special value `me` for the
                    currently authenticated user
                value:
                  type: string
                  example: johndoe@example.com
                  description: >-
                    The value of the contact channel. For email, this should be
                    a valid email address.
                type:
                  type: string
                  enum:
                    - email
                  example: email
                  description: >-
                    The type of the contact channel. Currently only "email" is
                    supported.
                used_for_auth:
                  type: boolean
                  example: true
                  description: >-
                    Whether the contact channel is used for authentication. If
                    this is set to `true`, the user will be able to sign in with
                    the contact channel with password or OTP.
                is_primary:
                  type: boolean
                  example: true
                  description: >-
                    Whether the contact channel is the primary contact channel.
                    If this is set to `true`, it will be used for authentication
                    and notifications by default.
              required:
                - user_id
                - value
                - type
                - used_for_auth
              example:
                is_verified: true
                user_id: 3241a285-8329-4d69-8f3d-316e08cf140c
                value: johndoe@example.com
                type: email
                used_for_auth: true
                is_primary: true
      responses:
        '201':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  user_id:
                    type: string
                    example: 3241a285-8329-4d69-8f3d-316e08cf140c
                    description: The unique identifier of the user
                  id:
                    type: string
                    example: b3d396b8-c574-4c80-97b3-50031675ceb2
                    description: The unique identifier of the contact channel
                  value:
                    type: string
                    example: johndoe@example.com
                    description: >-
                      The value of the contact channel. For email, this should
                      be a valid email address.
                  type:
                    type: string
                    enum:
                      - email
                    example: email
                    description: >-
                      The type of the contact channel. Currently only "email" is
                      supported.
                  used_for_auth:
                    type: boolean
                    example: true
                    description: >-
                      Whether the contact channel is used for authentication. If
                      this is set to `true`, the user will be able to sign in
                      with the contact channel with password or OTP.
                  is_verified:
                    type: boolean
                    example: true
                    description: >-
                      Whether the contact channel has been verified. If this is
                      set to `true`, the contact channel has been verified to
                      belong to the user.
                  is_primary:
                    type: boolean
                    example: true
                    description: >-
                      Whether the contact channel is the primary contact
                      channel. If this is set to `true`, it will be used for
                      authentication and notifications by default.
                required:
                  - user_id
                  - id
                  - value
                  - type
                  - used_for_auth
                  - is_verified
                  - is_primary

````