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

# Join team via invite

> Joins a team using an invite token. Note: The user (externalId) must have a `userGameId` mapped for the team's `gameId` before joining. Refer to the [Create User Game ID Mapping](/api-reference/create-user-game-id-mapping) endpoint for details.



## OpenAPI

````yaml /api-reference/teams/openapi.json post /teams/invites/{token}/join
openapi: 3.0.0
info:
  title: Teams
  version: 1.0.0
  description: API endpoints for managing teams in the 16TMS platform
servers:
  - url: https://api.16tms.com/api/v1
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /teams/invites/{token}/join:
    post:
      summary: Join team via invite
      description: >-
        Joins a team using an invite token. Note: The user (externalId) must
        have a `userGameId` mapped for the team's `gameId` before joining. Refer
        to the [Create User Game ID
        Mapping](/api-reference/create-user-game-id-mapping) endpoint for
        details.
      operationId: joinTeamWithInvite
      parameters:
        - name: token
          in: path
          description: The invite token
          required: true
          schema:
            type: string
        - name: externalId
          in: query
          description: External user ID of the user joining the team
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successfully joined the team
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JoinTeamResponse'
              example:
                success: true
                message: Successfully joined the team
                data:
                  teamId: e86e814e-ca93-412e-b347-fb71837c6466
                  name: boss official
                  description: string
                  teamSize: 16
                  ownerId: cbf66c47-a05a-457c-9d3f-322ddd04d79a
                  ownerName: Dhruv
                  logo: string
                  coverImage: string
                  gameId: 8a7b084c-d30a-40e7-85e0-865164a9076b
                  gameName: Counter Stirke
                  gameImage: >-
                    https://metaninzamedia.blob.core.windows.net/media/games/20260211055726_cs2.webp
                  members:
                    - userId: cbf66c47-a05a-457c-9d3f-322ddd04d79a
                      email: ''
                      username: dfs
                      role: 1
                      joinedAt: '2026-02-11T05:59:42.710198Z'
                      profileImage: strsdfsding
                      gameId: 8a7b084c-d30a-40e7-85e0-865164a9076b
                      userGameId: Bossxdhruv
                    - userId: 165a759d-d243-4549-830d-bca932046245
                      email: ''
                      username: lol
                      role: 3
                      joinedAt: '2026-02-11T06:14:26.975106Z'
                      profileImage: null
                      gameId: 8a7b084c-d30a-40e7-85e0-865164a9076b
                      userGameId: est
                meta:
                  traceId: 00-d37a7cd8e29472edf762e86465e468e8-fb9607ab34703613-00
                  elapsedMs: 54.6
                  serverTimestamp: '2026-02-11T06:14:27.0253634Z'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Team or invite not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict - Already a member or game account not linked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessRuleErrorResponse'
              examples:
                alreadyMember:
                  summary: Already a member
                  value:
                    success: false
                    error:
                      code: BUSINESS_RULE_VIOLATION
                      message: You are already a member of this team.
                    meta:
                      traceId: 00-4cfc730c433e903baa76e4b24222c001-17cd11d4a1c2425d-00
                gameAccountNotLinked:
                  summary: Game account not linked
                  value:
                    success: false
                    error:
                      code: BUSINESS_RULE_VIOLATION
                      message: Link your game account to join team
                    meta:
                      traceId: 00-ac42ce53b9e64e82a5d5a4af5e1e92b5-67b16e9b5cdd25b0-00
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    JoinTeamResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          $ref: '#/components/schemas/TeamWithMembers'
        meta:
          type: object
          properties:
            traceId:
              type: string
            elapsedMs:
              type: number
            serverTimestamp:
              type: string
              format: date-time
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Indicates if the request was successful
          example: false
        message:
          type: string
          description: Error message describing what went wrong
          example: Invalid API key
        errors:
          type: array
          description: Detailed error information
          items:
            type: object
            properties:
              field:
                type: string
                description: The field that caused the error
                example: name
              message:
                type: string
                description: Description of the error
                example: This field is required
        meta:
          type: object
          properties:
            traceId:
              type: string
              description: Unique trace identifier for debugging purposes
            serverTimestamp:
              type: string
              format: date-time
              description: Server timestamp when the error occurred
    BusinessRuleErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Indicates if the request was successful
          example: false
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code identifying the type of business rule violation
              example: BUSINESS_RULE_VIOLATION
            message:
              type: string
              description: Human-readable error message
              example: Link your game account to create team
        meta:
          type: object
          properties:
            traceId:
              type: string
              description: Unique trace identifier for debugging purposes
              example: 00-861ab230a64e2191f50b84e76e901a09-c031a9c74a1a91ad-00
    TeamWithMembers:
      type: object
      properties:
        teamId:
          type: string
          format: uuid
          description: Unique identifier for the team
          example: f0ae597c-a8e9-455c-96ea-d54cf9e98c23
        name:
          type: string
          description: Name of the team
          example: dhruvvv
        role:
          $ref: '#/components/schemas/TeamRole'
        isOwner:
          type: boolean
          description: Indicates if the user is the owner of the team
          example: true
        logo:
          type: string
          description: URL to the team's logo
          example: test
        gameId:
          type: string
          format: uuid
          description: ID of the game this team is associated with
          example: 3b1dd428-f288-4654-beff-ae523005f47a
        gameName:
          type: string
          description: Name of the game
          example: BGMI
        gameImage:
          type: string
          format: uri
          description: URL to the game's image
          example: >-
            https://metaninzamedia.blob.core.windows.net/media/games/20260209131841_8be0463e43471d299608f26d92555064.webp
        joinedAt:
          type: string
          format: date-time
          description: Timestamp when the user joined the team
          example: '2026-02-09T13:22:47.392121Z'
        members:
          type: array
          description: List of team members
          items:
            $ref: '#/components/schemas/TeamMember'
    TeamRole:
      type: integer
      description: Role of the member in the team (1 = Owner, 3 = Member)
      enum:
        - 1
        - 3
      x-enum-varnames:
        - Owner
        - Member
      x-enum-descriptions:
        - Team Owner
        - Team Member
    TeamMember:
      type: object
      properties:
        userId:
          type: string
          format: uuid
          description: Unique identifier for the user
          example: 302cb943-26a3-40e1-92f4-216ac2b264d7
        externalId:
          type: string
          description: External identifier for the user
          nullable: true
          example: null
        email:
          type: string
          format: email
          description: Email address of the team member
          example: ''
        username:
          type: string
          description: Username of the team member
          example: dhruvpatel
        role:
          $ref: '#/components/schemas/TeamRole'
        joinedAt:
          type: string
          format: date-time
          description: Timestamp when the member joined the team
          example: '2026-02-09T13:22:47.392121Z'
        profileImage:
          type: string
          format: uri
          description: URL to the member's profile image
          example: null
          nullable: true
        gameId:
          type: string
          format: uuid
          description: ID of the game
          example: 3b1dd428-f288-4654-beff-ae523005f47a
        userGameId:
          type: string
          description: User's in-game ID
          example: bossxdhruv
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        API key for authentication. You can generate this from the 16TMS
        console.

````