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

# Create Room User

> Livepeer Studio API endpoint

<OpenAPI path="POST /room/{id}/user" />


## OpenAPI

````yaml POST /room/{id}/user
openapi: 3.1.0
info:
  title: Livepeer API Reference
  description: |
    Welcome to the Livepeer API reference docs. Here you will find all the
    endpoints exposed on the standard Livepeer API, learn how to use them and
    what they return.
  version: 1.0.0
servers:
  - url: https://livepeer.studio/api
security:
  - apiKey: []
tags:
  - name: stream
    description: Operations related to livestream api
  - name: asset
    description: Operations related to asset/vod api
  - name: webhook
    description: Operations related to webhook api
  - name: multistream
    description: Operations related to multistream api
  - name: session
    description: Operations related to session api
  - name: room
    description: Operations related to rooms api
  - name: transcode
    description: Operations related to transcode api
  - name: metrics
    description: Operations related to metrics api
  - name: playback
    description: Operations related to playback api
  - name: accessControl
    description: Operations related to access control/signing keys api
  - name: task
    description: Operations related to tasks api
  - name: generate
    description: Operations related to AI generate api
paths:
  /room/{id}/user:
    post:
      tags:
        - room
      summary: Create a room user
      description: >
        Call this endpoint to add a user to a room, specifying a display name at
        a minimum.

        The response will contain a joining URL for Livepeer's default meeting
        app.

        Alternatively the joining token can be used with a custom app.
      operationId: createRoomUser
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/room-user-payload'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/room-user-response'
                x-speakeasy-name-override: data
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      deprecated: true
      x-codeSamples:
        - lang: go
          label: createRoomUser
          source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    s := livepeergo.New(\n        livepeergo.WithSecurity(\"<YOUR_BEARER_TOKEN_HERE>\"),\n    )\n\n    ctx := context.Background()\n    res, err := s.Room.CreateUser(ctx, \"<id>\", components.RoomUserPayload{\n        Name: \"name\",\n        CanPublish: livepeergo.Bool(true),\n        CanPublishData: livepeergo.Bool(true),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.RoomUserResponse != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: createRoomUser
          source: |-
            from livepeer import Livepeer

            s = Livepeer(
                api_key="<YOUR_BEARER_TOKEN_HERE>",
            )

            res = s.room.create_user(id="<id>", room_user_payload={
                "name": "name",
                "can_publish": True,
                "can_publish_data": True,
            })

            if res.room_user_response is not None:
                # handle response
                pass
components:
  schemas:
    room-user-payload:
      type: object
      required:
        - name
      additionalProperties: false
      properties:
        name:
          type: string
          description: Display name
          example: name
        canPublish:
          type: boolean
          description: Whether a user is allowed to publish audio/video tracks
          example: true
        canPublishData:
          type: boolean
          description: Whether a user is allowed to publish data messages to the room
          example: true
        metadata:
          type: string
          description: User defined payload to store for the participant
    room-user-response:
      type: object
      properties:
        id:
          type: string
          description: The ID of the user
          example: d32ae9e6-c459-4931-9898-e86e2f5e7e16
        joinUrl:
          type: string
          description: >-
            Joining URL - use this for Livepeer's default meeting app (see the
            multiparticipant streaming guide for more info).
          example: https://meet.livepeer.chat
        token:
          type: string
          description: >-
            Joining JWT - this can be used if you have a custom meeting app (see
            the multiparticipant streaming guide for more info).
          example: token
    error:
      type: object
      properties:
        errors:
          type: array
          minItems: 1
          items:
            type: string
            example:
              - id not provided
              - Account not found
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````