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

# Create a join token

> Create a join token for one participant, in the languages they speak.

This is how every participant enters a room, including the first — and it is where
languages are chosen, one participant at a time. Each token is short-lived and tied
to the `identity` it was issued for; a participant is disconnected when their token
expires.

Send two `languages` when one connection covers two people, such as two colleagues
sharing a phone. That alone makes the room bilingual and starts the translator.

**The first token for a room decides its streaming mode**, unless the room was created
with one: two languages makes it `mono`, one makes it `dual`. That mode then holds for
the room's lifetime, and a later token whose language count disagrees returns 409 — one
language per participant in a `dual` room, two on every connection in a `mono` one. The
mode a room settled on is reported by `GET /v1/rooms/{room_id}`.

A room translates between at most two languages. A request that would make a third
returns 409 — but the check is against who is connected *right now*, so once a
speaker leaves, their language frees up and a different one is admitted.

Only live rooms belonging to your organization can be joined — anything else
returns 404.



## OpenAPI

````yaml https://api.staging.glot.com/openapi.json post /v1/rooms/{room_name}/token
openapi: 3.1.0
info:
  title: glot-api
  version: 0.1.0
servers: []
security: []
tags:
  - name: rooms
    description: Create translation rooms and let participants join them.
  - name: usage
    description: Minutes and charges over time, for reporting and charts.
  - name: billing
    description: Buy prepaid credit and review the balance behind it.
  - name: api-keys
    description: Create and revoke keys used to authenticate requests.
  - name: supported-languages
    description: Languages available for translation.
  - name: users
    description: The authenticated user's own profile.
paths:
  /v1/rooms/{room_name}/token:
    post:
      tags:
        - rooms
      summary: Create a join token
      description: >-
        Create a join token for one participant, in the languages they speak.


        This is how every participant enters a room, including the first — and
        it is where

        languages are chosen, one participant at a time. Each token is
        short-lived and tied

        to the `identity` it was issued for; a participant is disconnected when
        their token

        expires.


        Send two `languages` when one connection covers two people, such as two
        colleagues

        sharing a phone. That alone makes the room bilingual and starts the
        translator.


        **The first token for a room decides its streaming mode**, unless the
        room was created

        with one: two languages makes it `mono`, one makes it `dual`. That mode
        then holds for

        the room's lifetime, and a later token whose language count disagrees
        returns 409 — one

        language per participant in a `dual` room, two on every connection in a
        `mono` one. The

        mode a room settled on is reported by `GET /v1/rooms/{room_id}`.


        A room translates between at most two languages. A request that would
        make a third

        returns 409 — but the check is against who is connected *right now*, so
        once a

        speaker leaves, their language frees up and a different one is admitted.


        Only live rooms belonging to your organization can be joined — anything
        else

        returns 404.
      operationId: create_join_token_v1_rooms__room_name__token_post
      parameters:
        - name: room_name
          in: path
          required: true
          schema:
            type: string
            title: Room Name
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JoinTokenRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JoinTokenResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    JoinTokenRequest:
      properties:
        identity:
          type: string
          title: Identity
          description: >-
            Who the token is issued for — this is how that participant appears
            in the room, and how their connection is attributed in the room's
            usage breakdown. Two participants of the same room must not share an
            identity.
          examples:
            - alice
        languages:
          items:
            $ref: '#/components/schemas/LanguageCode'
          type: array
          maxItems: 2
          minItems: 1
          title: Languages
          description: >-
            The languages this participant speaks and wants to hear, from `GET
            /v1/supported-languages`. Usually one. Send two when a single
            connection covers two people — for example two colleagues sharing
            one phone — which is enough on its own to start the translator.


            **How many you send fixes the room's streaming mode, and then has to
            keep matching it.** The first token for a room with no mode sets it:
            two languages makes it `mono`, one makes it `dual`. Every later
            token for that room must carry the same count or the request returns
            409 — so a `dual` room takes one language per participant, and a
            `mono` room takes two on each connection.


            A room translates between at most two languages, so a request that
            would make a third returns 409. Once a participant disconnects,
            their language frees up again.
          examples:
            - - en
            - - en
              - zh
      type: object
      required:
        - identity
        - languages
      title: JoinTokenRequest
      description: Request a join token for one participant, in the languages they speak.
    JoinTokenResponse:
      properties:
        room:
          type: string
          title: Room
        token:
          type: string
          title: Token
        url:
          type: string
          title: Url
        languages:
          items:
            $ref: '#/components/schemas/LanguageCode'
          type: array
          title: Languages
      type: object
      required:
        - room
        - token
        - url
        - languages
      title: JoinTokenResponse
      description: >-
        Credentials for one participant to join a room.


        Connect a client to `url` with `token`. The token is short-lived, and
        the

        participant is disconnected when it expires.


        The translator joins the room by itself once two languages are present,
        and leaves

        when fewer than two remain — there is nothing to call for it.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LanguageCode:
      type: string
      enum:
        - ar
        - ca
        - da
        - de
        - el
        - en
        - es
        - fi
        - fr
        - he
        - hi
        - hu
        - it
        - ja
        - ko
        - nl
        - 'no'
        - pl
        - pt
        - ro
        - ru
        - sv
        - tr
        - uk
        - ur
        - zh
      title: LanguageCode
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````