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

# Create a room

> Creates a room in the community. The owner must be an existing user who is allowed to create rooms



## OpenAPI

````yaml https://api.zapnito.com/api/docs/v1/swagger.json post /api/v1/rooms
openapi: 3.0.1
info:
  title: API V1
  version: v1
  description: Zapnito API Documentation
servers:
  - url: https://{host}
    description: Your community domain
    variables:
      host:
        default: your-community.com
        description: Your community domain, for example your-community.com
security: []
tags:
  - name: Health Check
    description: Check that the API is reachable and that your API key is valid
  - name: Identity
    description: Find out which community your API key belongs to
  - name: Users
    description: >-
      Look up the people in your community, update their profile and choose
      which notifications they receive
  - name: Organisations
    description: >-
      Create and update the organisations in your community and manage who
      belongs to them
  - name: Groups
    description: Create groups and manage which users belong to them
  - name: Invitations
    description: Invite people to join your community
  - name: Posts
    description: Create, read and update posts on behalf of your community members
  - name: Contents
    description: >-
      Read the published content of your community and publish, schedule or
      unpublish it
  - name: Channels
    description: List the channels in your community and the content published in each
  - name: Rooms
    description: Create and read the rooms where your community members meet
  - name: Tags
    description: Create tags and apply them to content
  - name: Badges
    description: Create badges and award them to content or to users
  - name: Custom Fields
    description: Read the custom profile fields your community asks its members to fill in
  - name: Third-Party Resources
    description: >-
      Link to resources hosted outside your community so they appear alongside
      your content
  - name: Rest Hooks
    description: >-
      Subscribe a URL to events in your community, so you are told when they
      happen
paths:
  /api/v1/rooms:
    post:
      tags:
        - Rooms
      summary: Create a room
      description: >-
        Creates a room in the community. The owner must be an existing user who
        is allowed to create rooms
      operationId: createRoom
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoomCreateRequest'
            examples:
              new_room:
                summary: A room with its name and owner
                value:
                  room:
                    name: Cardiology
                    owner_email: jane@example.com
        required: true
        description: Room payload wrapped in a room object
      responses:
        '200':
          description: The room was created
          content:
            application/json:
              examples:
                example:
                  value:
                    room:
                      id: 1
                      name: Cardiology
                      slug: cardiology
                      description: A room for cardiology discussions
                      about: About this room...
                      position: 1
                      type: public
                      contributor_group_uuid: abc-123
                      member_group_uuid: def-456
                      open: true
                      secret: false
                      private: false
                      state: open
              schema:
                type: object
                properties:
                  room:
                    $ref: '#/components/schemas/Room'
                required:
                  - room
        '401':
          description: >-
            The API key is missing or invalid. The response body is the text
            `HTTP Token: Access denied.`
        '422':
          description: The request failed validation
          content:
            application/json:
              examples:
                error:
                  value:
                    errors:
                      owner_email:
                        - >-
                          Couldn't find a user that has permission to create
                          rooms with that email
              schema:
                type: object
                properties:
                  errors:
                    type: object
                    properties:
                      owner_email:
                        type: array
                        items:
                          type: string
                        example:
                          - >-
                            Couldn't find a user that has permission to create
                            rooms with that email
                required:
                  - errors
      security:
        - tokenAuth: []
components:
  schemas:
    RoomCreateRequest:
      type: object
      properties:
        room:
          type: object
          properties:
            name:
              type: string
              example: Cardiology
            description:
              type: string
              example: A room for cardiology discussions
            about:
              type: string
              example: About this room...
            position:
              type: integer
              example: 1
            type:
              type: string
              enum:
                - public
                - private
                - secret
              example: private
              description: Who can find and join the room. Defaults to public
            owner_email:
              type: string
              format: email
              example: jane@example.com
              description: Email address of the user who owns the room
          required:
            - name
            - owner_email
      required:
        - room
    Room:
      type: object
      properties:
        id:
          type: integer
          example: 1
        name:
          type: string
          example: Cardiology
        slug:
          type: string
          example: cardiology
        description:
          type: string
          nullable: true
          example: A room for cardiology discussions
        about:
          type: string
          nullable: true
          example: About this room...
        position:
          type: integer
          example: 1
        type:
          type: string
          example: public
          enum:
            - public
            - private
            - secret
          description: Who can find and join the room
        contributor_group_uuid:
          type: string
          example: abc-123
          description: UUID of the group of people who can contribute to the room
        member_group_uuid:
          type: string
          example: def-456
          description: UUID of the group of people who are members of the room
        open:
          type: boolean
          example: true
          description: Whether anyone can join the room
        secret:
          type: boolean
          example: false
          description: Whether the room is hidden from people who are not members
        private:
          type: boolean
          example: false
          description: Whether people need permission to join the room
        state:
          type: string
          example: open
          enum:
            - open
            - closed
            - secret
          description: >-
            The state of the room. An open room is public, a closed room is
            private
      required:
        - id
        - name
        - slug
        - position
        - type
        - contributor_group_uuid
        - member_group_uuid
        - open
        - secret
        - private
        - state
  securitySchemes:
    tokenAuth:
      type: apiKey
      name: Authorization
      in: header
      description: >-
        API authentication using your community API secret. The value below is
        sent as the Authorization header verbatim, so paste the whole header
        value including the prefix: Token token=<api-key>
      x-default: Token token=<api-key>

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.