# Create a collection

`POST /help_center/collections`

> This is a subset of the full specification, limited to the `POST /help_center/collections` operation.
>
> You can find the full specification here: /_bundle/docs/references/@2.18/rest-api/api.intercom.io.yaml

```yaml
openapi: 3.0.1
info:
  title: Intercom API
  version: '2.18'
  description: This is a subset of the full specification, limited to the `POST /help_center/collections` operation.
  contact:
    name: Intercom Developer Hub
    url: https://developers.intercom.com
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
servers:
  - url: https://api.intercom.io
    description: The production API server
  - url: https://api.eu.intercom.io
    description: The european API server
  - url: https://api.au.intercom.io
    description: The australian API server
security:
  - bearerAuth: []
tags:
  - name: Help Center
    description: Everything about your Help Center
paths:
  /help_center/collections:
    post:
      summary: Create a collection
      parameters:
        - name: Intercom-Version
          in: header
          schema:
            $ref: '#/components/schemas/intercom_version'
      tags:
        - Help Center
      operationId: createCollection
      description: |
        You can create a new collection by making a POST request to `https://api.intercom.io/help_center/collections`.

        Requires the `read_write_articles_scope` or `create_update_articles` OAuth scope.
      responses:
        '200':
          description: collection created
          content:
            application/json:
              examples:
                collection created:
                  value:
                    id: '165'
                    type: collection
                    workspace_id: this_is_an_id100_that_should_be_at_least_
                    name: Thanks for everything
                    url: http://help-center.test/myapp-100/en/collections/165-thanks-for-everything
                    order: 1
                    created_at: 1734537312
                    updated_at: 1734537312
                    description: ''
                    icon: book-bookmark
                    parent_id: null
                    help_center_id: 81
              schema:
                $ref: '#/components/schemas/collection'
        '400':
          description: Bad Request
          content:
            application/json:
              examples:
                Bad Request:
                  value:
                    type: error.list
                    request_id: 816186b3-3187-4b47-adf8-e201bea32208
                    errors:
                      - code: parameter_not_found
                        message: Name is a required parameter.
                Invalid help center:
                  value:
                    type: error.list
                    request_id: 68bc842d-927f-5ac0-a16c-27cfa23c2f2f
                    errors:
                      - code: invalid_help_center_id
                        message: Invalid help center id
                Parent collection not found:
                  value:
                    type: error.list
                    request_id: aefba0b8-1416-5186-9b13-2d2ea4c4eedd
                    errors:
                      - code: parameter_invalid
                        message: Parent collection doesn't exist
              schema:
                $ref: '#/components/schemas/error'
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    type: error.list
                    request_id: 25d96ec2-641f-4354-b24e-83a85d33bd30
                    errors:
                      - code: unauthorized
                        message: Access Token Invalid
              schema:
                $ref: '#/components/schemas/error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create_collection_request'
            examples:
              collection_created:
                summary: collection created
                value:
                  name: Thanks for everything
              bad_request:
                summary: Bad Request
                value:
                  description: Missing required parameter
components:
  schemas:
    collection:
      title: Collection
      type: object
      x-tags:
        - Help Center
      description: Collections are top level containers for Articles within the Help Center.
      properties:
        type:
          type: string
          description: The type of object - `collection`.
          enum:
            - collection
          example: collection
        id:
          type: string
          description: The unique identifier for the collection which is given by Intercom.
          example: '6871119'
        workspace_id:
          type: string
          description: The id of the workspace which the collection belongs to.
          example: hfi1bx4l
        name:
          type: string
          description: The name of the collection. For multilingual collections, this will be the name of the default language's content.
          example: Default language name
        description:
          type: string
          nullable: true
          description: The description of the collection. For multilingual help centers, this will be the description of the collection for the default language.
          example: Default language description
        created_at:
          type: integer
          format: date-time
          description: The time when the article was created (seconds). For multilingual articles, this will be the timestamp of creation of the default language's content.
          example: 1672928359
        updated_at:
          type: integer
          format: date-time
          description: The time when the article was last updated (seconds). For multilingual articles, this will be the timestamp of last update of the default language's content.
          example: 1672928610
        url:
          type: string
          nullable: true
          description: The URL of the collection. For multilingual help centers, this will be the URL of the collection for the default language.
          example: http://intercom.test/help/collection/name
        icon:
          type: string
          nullable: true
          description: The icon of the collection.
          example: book-bookmark
        order:
          type: integer
          description: The order of the section in relation to others sections within a collection. Values go from `0` upwards. `0` is the default if there's no order.
          example: '1'
        default_locale:
          type: string
          description: The default locale of the help center. This field is only returned for multilingual help centers.
          example: en
        translated_content:
          nullable: true
          $ref: '#/components/schemas/group_translated_content'
        parent_id:
          type: string
          nullable: true
          description: The id of the parent collection. If `null` then it is the first level collection.
          example: '6871118'
        help_center_id:
          type: integer
          nullable: true
          description: The id of the help center the collection is in.
          example: '123'
    create_collection_request:
      description: You can create a collection
      type: object
      title: Create Collection Request Payload
      properties:
        name:
          type: string
          description: The name of the collection. For multilingual collections, this will be the name of the default language's content. Required unless a name is provided in `translated_content` under the workspace's default Help Center locale.
          example: collection 51
        description:
          type: string
          description: The description of the collection. For multilingual collections, this will be the description of the default language's content.
          example: English description
        icon:
          type: string
          description: The icon of the collection, for example `book-bookmark`. Defaults to `book-bookmark`.
          example: book-bookmark
        translated_content:
          nullable: true
          $ref: '#/components/schemas/group_translated_content'
        parent_id:
          type: string
          nullable: true
          description: The id of the parent collection. If `null` then it will be created as the first level collection.
          example: '6871118'
        help_center_id:
          type: integer
          nullable: true
          description: The id of the help center where the collection will be created. If `null` then it will be created in the default help center.
          example: '123'
    error:
      type: object
      title: Error
      description: The API will return an Error List for a failed request, which will contain one or more Error objects.
      properties:
        type:
          type: string
          description: The type is error.list
          example: error.list
        request_id:
          type: string
          nullable: true
          format: uuid
          description: ''
          example: f93ecfa8-d08a-4325-8694-89aeb89c8f85
        errors:
          type: array
          description: An array of one or more error objects
          items:
            properties:
              code:
                type: string
                description: A string indicating the kind of error, used to further qualify the HTTP response code.
                example: unauthorized
              message:
                type: string
                nullable: true
                description: Optional. Human readable description of the error.
                example: Access Token Invalid
              data:
                type: object
                nullable: true
                additionalProperties: true
                description: Optional. Extra detail about the error, for example `required_permissions` on a 403 `action_forbidden` error.
                example:
                  required_permissions:
                    - read_conversations
            required:
              - code
      required:
        - type
        - errors
    group_content:
      title: Group Content
      type: object
      description: The Content of a Group.
      nullable: true
      properties:
        type:
          type: string
          description: The type of object - `group_content` .
          enum:
            - null
            - group_content
          example: group_content
          nullable: true
        name:
          type: string
          description: The name of the collection or section.
          example: Collection name
        description:
          type: string
          description: The description of the collection. Only available for collections.
          example: ' Collection description'
    group_translated_content:
      title: Group Translated Content
      type: object
      description: The Translated Content of an Group. The keys are the locale codes and the values are the translated content of the Group.
      nullable: true
      properties:
        type:
          type: string
          description: The type of object - group_translated_content.
          nullable: true
          enum:
            - null
            - group_translated_content
          example: group_translated_content
        ar:
          description: The content of the group in Arabic
          $ref: '#/components/schemas/group_content'
        bg:
          description: The content of the group in Bulgarian
          $ref: '#/components/schemas/group_content'
        bs:
          description: The content of the group in Bosnian
          $ref: '#/components/schemas/group_content'
        ca:
          description: The content of the group in Catalan
          $ref: '#/components/schemas/group_content'
        cs:
          description: The content of the group in Czech
          $ref: '#/components/schemas/group_content'
        da:
          description: The content of the group in Danish
          $ref: '#/components/schemas/group_content'
        de:
          description: The content of the group in German
          $ref: '#/components/schemas/group_content'
        el:
          description: The content of the group in Greek
          $ref: '#/components/schemas/group_content'
        en:
          description: The content of the group in English
          $ref: '#/components/schemas/group_content'
        es:
          description: The content of the group in Spanish
          $ref: '#/components/schemas/group_content'
        et:
          description: The content of the group in Estonian
          $ref: '#/components/schemas/group_content'
        fi:
          description: The content of the group in Finnish
          $ref: '#/components/schemas/group_content'
        fr:
          description: The content of the group in French
          $ref: '#/components/schemas/group_content'
        he:
          description: The content of the group in Hebrew
          $ref: '#/components/schemas/group_content'
        hr:
          description: The content of the group in Croatian
          $ref: '#/components/schemas/group_content'
        hu:
          description: The content of the group in Hungarian
          $ref: '#/components/schemas/group_content'
        id:
          description: The content of the group in Indonesian
          $ref: '#/components/schemas/group_content'
        it:
          description: The content of the group in Italian
          $ref: '#/components/schemas/group_content'
        ja:
          description: The content of the group in Japanese
          $ref: '#/components/schemas/group_content'
        ko:
          description: The content of the group in Korean
          $ref: '#/components/schemas/group_content'
        lt:
          description: The content of the group in Lithuanian
          $ref: '#/components/schemas/group_content'
        lv:
          description: The content of the group in Latvian
          $ref: '#/components/schemas/group_content'
        mn:
          description: The content of the group in Mongolian
          $ref: '#/components/schemas/group_content'
        nb:
          description: The content of the group in Norwegian
          $ref: '#/components/schemas/group_content'
        nl:
          description: The content of the group in Dutch
          $ref: '#/components/schemas/group_content'
        pl:
          description: The content of the group in Polish
          $ref: '#/components/schemas/group_content'
        pt:
          description: The content of the group in Portuguese (Portugal)
          $ref: '#/components/schemas/group_content'
        ro:
          description: The content of the group in Romanian
          $ref: '#/components/schemas/group_content'
        ru:
          description: The content of the group in Russian
          $ref: '#/components/schemas/group_content'
        sl:
          description: The content of the group in Slovenian
          $ref: '#/components/schemas/group_content'
        sr:
          description: The content of the group in Serbian
          $ref: '#/components/schemas/group_content'
        sv:
          description: The content of the group in Swedish
          $ref: '#/components/schemas/group_content'
        tr:
          description: The content of the group in Turkish
          $ref: '#/components/schemas/group_content'
        vi:
          description: The content of the group in Vietnamese
          $ref: '#/components/schemas/group_content'
        pt-BR:
          description: The content of the group in Portuguese (Brazil)
          $ref: '#/components/schemas/group_content'
        zh-CN:
          description: The content of the group in Chinese (China)
          $ref: '#/components/schemas/group_content'
        zh-TW:
          description: The content of the group in Chinese (Taiwan)
          $ref: '#/components/schemas/group_content'
    intercom_version:
      description: Intercom API version.</br>If you omit the header, the API uses the version set in your app package, and 1.0 if none is set.
      type: string
      example: '2.18'
      enum:
        - '1.0'
        - '1.1'
        - '1.2'
        - '1.3'
        - '1.4'
        - '2.0'
        - '2.1'
        - '2.2'
        - '2.3'
        - '2.4'
        - '2.5'
        - '2.6'
        - '2.7'
        - '2.8'
        - '2.9'
        - '2.10'
        - '2.11'
        - '2.12'
        - '2.13'
        - '2.14'
        - '2.15'
        - '2.16'
        - '2.17'
        - '2.18'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
```
