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

# Create Room

> Create a new room

### Webhook

When you create a room with webhook parameters,
a webhook will be sent via a POST method for each participant's entry and exit.
The request body for this is as follows.

```ts theme={null}
{
  action: "sessionLeft" | "sessionJoined",
  payload: {
    roomId: string,
    userId?: string,
    memberId: string,
    sessionId: string,
    sessionsCount: number,
    membersCount: number,
    timestamp: string // e.g. '2022-05-31T12:38:15.059Z'
  }
}
```


## OpenAPI

````yaml POST /rooms
openapi: 3.0.0
info:
  title: Pagecall Public API - OpenAPI 3.0
  description: >-
    This is a official Pagecall API Documents written in OpenAPI 3.0.

    Responses from the Pagecall API may contain more information, but what is
    not stated in this document may change at any time without any notice.
  termsOfService: https://pplink.notion.site/774e4131813b47f8b06e3da4524604e8
  contact:
    email: support@pagecall.com
  version: 1.0.0
servers:
  - url: https://api.pagecall.com/v1
security: []
tags:
  - name: room
    description: Operations about room resources
paths:
  /rooms:
    post:
      tags:
        - room
      summary: Create Room
      description: Create a new room
      operationId: createRoom
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRoomRequest'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  room:
                    $ref: '#/components/schemas/Room'
                  paging:
                    $ref: '#/components/schemas/Paging'
        '400':
          description: Invalid Parameters Supplied or Unauthenticated or Unauthorized
        '500':
          description: Validation exception
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateRoomRequest:
      type: object
      description: Request format to create a new room
      required:
        - name
        - type
      properties:
        name:
          type: string
          description: Human-readable name of the room
          example: Meeting Room - 1
        type:
          $ref: '#/components/schemas/RoomType'
        record:
          type: boolean
          description: All meeting will be recorded
          default: true
        max_meeting_seconds:
          type: integer
          description: >-
            Determines the maximum meeting time in seconds. Once this time has
            elapsed, the meeting room will be automatically terminated. The
            'meeting time' refers to the duration during which two or more
            participants are connected. If a `max_meeting_seconds` is set, the
            timer UI will display the remaining meeting time, rather than the
            elapsed time.
        members:
          type: array
          description: Specify inviting user_id and type
          items:
            $ref: '#/components/schemas/RoomMember'
        webhook:
          type: object
          required:
            - url
          properties:
            url:
              type: string
              description: an URL to which the Pagecall server will send the webhook
            headers:
              type: object
              description: >-
                Headers to include when sending the webhook, which can be useful
                when authentication is required.
    Room:
      description: Information about room
      required:
        - id
        - type
        - name
      properties:
        id:
          type: string
          example: 000585f36eed9e8fb6b655b4
          description: ID of the room
        application_id:
          type: string
          example: 000585f36eed9e8fb6b655b4
          description: ID of the workspace
        type:
          $ref: '#/components/schemas/RoomType'
        created_user_id:
          type: string
          example: '#DEPRECATED#'
          description: '*[Deprecated]* ID of the user who create this room'
        name:
          type: string
          example: Weekly Meet
          description: Human readable name of the room
        thumbnail_url:
          type: string
          example: https://example.url/thumbnail.png
          description: Generated thumbnail for this room
        last_thumbnail_updated_at:
          type: string
          example: '#DEPRECATED#'
          description: '*[Deprecated]* Last update time of generated thumbnail'
          format: date-time
        room_template_id:
          type: string
          example: '#DEPRECATED#'
          description: >-
            *[Deprecated]* **Use `layout` instead.** ID of the room template
            used by this room
        layout:
          type: string
          example: SixAll
          description: How the room looks
        record:
          type: boolean
          description: Whether this room is recorded or not.
        meeting_time:
          type: integer
          example: 200000
          description: Total meeting time in seconds
        is_terminated:
          type: boolean
          example: '#DEPRECATED#'
          description: >-
            *[Deprecated]* **Use `terminated_at` instead.** Whether this room is
            terminated or not. If true, not available to join the room
        is_ephemeral:
          type: boolean
          example: '#DEPRECATED#'
          description: >-
            *[Deprecated]* Whether this room is for temporary or not. If true
            and all the members of this room leave, the room will be closed
        is_recurring:
          type: boolean
          example: '#DEPRECATED#'
          description: >-
            *[Deprecated]* Whether this meeting occurs regularly or not. If
            true, it will be reopened according to a predefined schedule.
        started_at:
          example: '2023-01-01T01:00:00.000Z'
          type: string
          description: The meeting is started at specified time format
          format: date-time
        terminated_at:
          example: '2023-01-01T01:00:00.000Z'
          type: string
          description: The room is terminated at specified time format
          format: date-time
        updated_at:
          example: '2023-01-01T01:00:00.000Z'
          type: string
          description: The room settings are changed at specified time format
          format: date-time
        created_at:
          example: '2023-01-01T01:00:00.000Z'
          type: string
          description: The room is created at specified time format
          format: date-time
    Paging:
      description: Details of pagination used for current responses.
      type: object
      required:
        - limit
        - offset
        - total
      properties:
        limit:
          type: number
          default: 30
        offset:
          type: number
          default: 0
        total:
          type: number
          example: 0
    RoomType:
      type: string
      description: >
        Room can have three different type


        * `open`    - anyone who obtain this room url can join and replay the
        meet.

        * `public`  - any member who haved joined in same worksapce can join and
        replay the meet.

        * `private` - only invited workspace user can join and replay the meet.
      enum:
        - open
        - public
        - private
      example: public
    RoomMember:
      type: object
      description: Information about the member joined the room
      required:
        - user_id
        - type
      properties:
        user_id:
          type: string
          description: '`user_id` of the user in application (workspace) scope'
          example: 000585f36eed9e8fb6b655b4
        type:
          $ref: '#/components/schemas/MemberType'
        name:
          type: string
          description: Display name of the user in the meeting room
          example: user-1
    MemberType:
      type: string
      description: >
        Type of user in this room

        - guest: The user is guest.

        - host: The user is host. This user has administrator privileges.

        - monitor: The user is observer. Can watch the meeting, but can not
        join.
      enum:
        - guest
        - host
        - monitor
      example: guest
      default: guest
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: token

````