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

# Upsert User Into Clan

> Upserts a user into the clan.



## OpenAPI

````yaml PUT /clan/{handle}/members
openapi: 3.0.1
info:
  title: CodeCombat API
  version: 0.0.1
servers:
  - url: https://codecombat.com/api
    description: default
security: []
paths:
  /clan/{handle}/members:
    put:
      tags:
        - Clans
      summary: Upsert User Into Clan
      description: Upserts a user into the clan.
      operationId: clans_upsertMember
      parameters:
        - name: handle
          in: path
          description: The document's `_id` or `slug`.
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userId:
                  type: string
                  description: The `_id` or `slug` of the user to add to the clan.
              required:
                - userId
      responses:
        '200':
          description: The clan with the member added.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClanResponse'
      security:
        - BasicAuth: []
components:
  schemas:
    ClanResponse:
      title: ClanResponse
      type: object
      description: Subset of properties listed here
      properties:
        _id:
          $ref: '#/components/schemas/objectIdString'
          nullable: true
        name:
          type: string
          nullable: true
        displayName:
          type: string
          nullable: true
        members:
          type: array
          items:
            $ref: '#/components/schemas/objectIdString'
          nullable: true
        ownerID:
          $ref: '#/components/schemas/objectIdString'
          nullable: true
        description:
          type: string
          nullable: true
        type:
          type: string
          nullable: true
        kind:
          type: string
          nullable: true
        metadata:
          type: object
          additionalProperties: true
          nullable: true
    objectIdString:
      title: objectIdString
      type: string
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic

````