# Search knowledge base contents

`GET /content/search`

> This is a subset of the full specification, limited to the `GET /content/search` 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 `GET /content/search` operation. Components more than 3 `$ref` hops away are not included.
  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: Content
    description: Search and operations over Knowledge Hub content — articles, snippets, external pages, uploaded files, and internal articles.
paths:
  /content/search:
    get:
      summary: Search knowledge base contents
      parameters:
        - name: Intercom-Version
          in: header
          schema:
            $ref: '#/components/schemas/intercom_version'
        - name: query
          in: query
          required: false
          description: A free-text search term matched against the title and body of each content item. When omitted, returns the most recent content items. Keep it to 500 characters or fewer. The API doesn't currently reject longer values.
          example: billing
          schema:
            type: string
            maxLength: 500
        - name: page
          in: query
          required: false
          description: The page number to fetch. Defaults to 1. Values below 1 are clamped to 1. Values above 5001 return a `400` `parameter_invalid` error.
          example: 1
          schema:
            type: integer
            default: 1
            minimum: 1
        - name: per_page
          in: query
          required: false
          description: Number of results per page. Defaults to 10. Maximum 50.
          example: 10
          schema:
            type: integer
            default: 10
            minimum: 1
            maximum: 50
        - name: states
          in: query
          required: false
          description: Filter by publication state. Accepts a comma-separated list or repeated params.
          example: published,draft
          schema:
            type: array
            items:
              type: string
              enum:
                - published
                - draft
          style: form
          explode: false
        - name: locales
          in: query
          required: false
          description: Filter by locale codes (e.g. `en`, `fr`, `de`). Accepts a comma-separated list or repeated params.
          example: en,fr
          schema:
            type: array
            items:
              type: string
          style: form
          explode: false
        - name: tag_ids
          in: query
          required: false
          description: Filter by tag IDs. Pairs with `tag_operator` to control match semantics. Accepts a comma-separated list or repeated params.
          example: 1,2,3
          schema:
            type: array
            items:
              type: integer
          style: form
          explode: false
        - name: tag_operator
          in: query
          required: false
          description: Match operator paired with `tag_ids`. `IN` returns content matching any of the given tags; `NIN` excludes content matching any of them.
          example: IN
          schema:
            type: string
            enum:
              - IN
              - NIN
        - name: any_tag_ids
          in: query
          required: false
          description: Filter by tag IDs using OR semantics — returns content matching any of the given tags. Alternative to `tag_ids` + `tag_operator`. Accepts a comma-separated list or repeated params.
          example: 1,2,3
          schema:
            type: array
            items:
              type: integer
          style: form
          explode: false
        - name: folder_ids
          in: query
          required: false
          description: Filter by folder IDs. Must be sent together with `folder_entity_type`. Accepts a comma-separated list or repeated params.
          example: 10,20
          schema:
            type: array
            items:
              type: integer
          style: form
          explode: false
        - name: folder_entity_type
          in: query
          required: false
          description: Required when `folder_ids` is provided. Identifies the entity type the folder IDs refer to.
          example: folder
          schema:
            type: string
            enum:
              - folder
        - name: content_types
          in: query
          required: false
          description: Restrict the search to specific content types. When provided, this REPLACES the default content type set rather than filtering on top of it. Accepts a comma-separated list or repeated params.
          example: article,snippet
          schema:
            type: array
            items:
              type: string
              enum:
                - snippet
                - external_content
                - file_source_content
                - internal_article
                - article
          style: form
          explode: false
        - name: copilot_state
          in: query
          required: false
          description: Filter by whether the content is enabled for Copilot.
          example: 'on'
          schema:
            type: string
            enum:
              - 'on'
              - 'off'
        - name: fin_service_state
          in: query
          required: false
          description: Filter by whether the content is enabled for Fin AI Agent (customer-facing service).
          example: 'on'
          schema:
            type: string
            enum:
              - 'on'
              - 'off'
        - name: fin_sales_state
          in: query
          required: false
          description: Filter by whether the content is enabled for Fin Sales Agent.
          example: 'on'
          schema:
            type: string
            enum:
              - 'on'
              - 'off'
        - name: created_by_ids
          in: query
          required: false
          description: Filter by the admin IDs that created the content. Accepts a comma-separated list or repeated params.
          example: 991267464,991267465
          schema:
            type: array
            items:
              type: integer
          style: form
          explode: false
        - name: last_updated_by_ids
          in: query
          required: false
          description: Filter by the admin IDs that last updated the content. Accepts a comma-separated list or repeated params.
          example: 991267464,991267465
          schema:
            type: array
            items:
              type: integer
          style: form
          explode: false
        - name: created_at_after
          in: query
          required: false
          description: Return content created at or after this time. Unix epoch seconds.
          example: 1677253093
          schema:
            type: integer
        - name: created_at_before
          in: query
          required: false
          description: Return content created at or before this time. Unix epoch seconds.
          example: 1677861493
          schema:
            type: integer
        - name: updated_at_after
          in: query
          required: false
          description: Return content last updated at or after this time. Unix epoch seconds.
          example: 1677253093
          schema:
            type: integer
        - name: updated_at_before
          in: query
          required: false
          description: Return content last updated at or before this time. Unix epoch seconds.
          example: 1677861493
          schema:
            type: integer
      tags:
        - Content
      operationId: searchContent
      description: |
        Search the knowledge base contents — articles, snippets, external pages, uploaded files, and internal articles — using a keyword query.

        Each result row has a `type` discriminator. Most types (`content_snippet`, `external_content`, `file_source_content`, `internal_article`) return a flat `{ type, id, title }` shape. Help center articles return a nested shape with a `contents[]` array, one entry per locale.

        Requires the `read_content` OAuth scope.
      responses:
        '200':
          description: Search successful
          content:
            application/json:
              examples:
                Search successful:
                  value:
                    type: list
                    total_count: 5
                    pages:
                      type: pages
                      page: 1
                      per_page: 10
                      total_pages: 1
                    data:
                      - type: content_snippet
                        id: '123'
                        title: Billing FAQ
                      - type: external_content
                        id: '456'
                        title: How to reset your password
                      - type: file_source_content
                        id: '789'
                        title: billing-guide.pdf
                      - type: internal_article
                        id: '012'
                        title: 'Internal SOP: Refunds'
                      - type: article
                        id: '345'
                        title: Billing FAQ
                        contents:
                          - type: article_content
                            id: '678'
                            title: Billing FAQ
                            locale: en
                          - type: article_content
                            id: '910'
                            title: Facturation FAQ
                            locale: fr
              schema:
                $ref: '#/components/schemas/content_search_response'
        '400':
          description: Page number too high. `page` multiplied by `per_page` must not exceed 10,000, and `page` must not exceed 5001. Going over the 10,000 window returns `bad_request`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '401':
          description: Unauthorized. The token is invalid or is missing the `read_content` OAuth scope
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    type: error.list
                    request_id: 12a938a3-314e-4939-b773-5cd45738bd21
                    errors:
                      - code: unauthorized
                        message: Access Token Invalid
                Token lacks required scope:
                  value:
                    type: error.list
                    request_id: a3e5b8e2-1234-5678-9abc-def012345678
                    errors:
                      - code: token_unauthorized
                        message: Not authorized to access resource
              schema:
                $ref: '#/components/schemas/error'
        '422':
          description: Invalid filter value
          content:
            application/json:
              examples:
                Invalid states value:
                  value:
                    type: error.list
                    request_id: f0c3b8a5-1d62-4e97-a4b1-8c7e2d5a9f30
                    errors:
                      - code: parameter_invalid
                        message: 'invalid value for states: "foo"; must be one of published, draft'
                Incomplete folder filter:
                  value:
                    type: error.list
                    request_id: 1a5e7c9d-3b84-4f20-96d1-e2b8a4c6f503
                    errors:
                      - code: parameter_invalid
                        message: folder_ids and folder_entity_type must be provided together
              schema:
                $ref: '#/components/schemas/error'
components:
  schemas:
    content_search_article_item:
      title: Content Search Article Item
      type: object
      description: A help center article result from Knowledge Hub search, with one nested `article_content` entry per locale.
      required:
        - type
      properties:
        type:
          type: string
          description: Always `article`.
          enum:
            - article
          example: article
        id:
          type: string
          description: The unique identifier of the article.
          example: '345'
        title:
          type: string
          description: The article's canonical title.
          example: Billing FAQ
        contents:
          type: array
          description: One entry per locale of the article.
          items:
            $ref: '#/components/schemas/content_search_article_content_item'
    content_search_default_item:
      title: Content Search Default Item
      type: object
      description: The flat result shape returned from Knowledge Hub search for content snippets, external pages, uploaded files, and internal articles.
      required:
        - type
      properties:
        type:
          type: string
          description: The kind of content item.
          enum:
            - content_snippet
            - external_content
            - file_source_content
            - internal_article
          example: content_snippet
        id:
          type: string
          description: The unique identifier of the content item.
          example: '123'
        title:
          type: string
          description: The display title of the content item.
          example: Billing FAQ
    content_search_response:
      title: Content Search Response
      type: object
      description: A paginated list of Knowledge Hub content results matching a search query.
      properties:
        type:
          type: string
          description: Always `list`.
          enum:
            - list
          example: list
        total_count:
          type: integer
          description: Total number of results matching the query.
          example: 5
        pages:
          type: object
          description: Pagination metadata, including links to neighbouring pages.
          properties:
            type:
              type: string
              enum:
                - pages
              example: pages
            page:
              type: integer
              description: The current page number.
              example: 1
            per_page:
              type: integer
              description: Number of results per page.
              example: 10
            total_pages:
              type: integer
              description: Total number of pages of results.
              example: 1
            next:
              type: string
              format: uri
              description: A link to the next page of results. Omitted when on the last page.
              example: https://api.intercom.io/content/search?query=billing&per_page=10&page=2
            prev:
              type: string
              format: uri
              description: A link to the previous page of results. Omitted when on the first page.
              example: https://api.intercom.io/content/search?query=billing&per_page=10&page=1
        data:
          type: array
          description: The list of matched content items. Each item's `type` field determines its shape.
          items:
            $ref: '#/components/schemas/content_search_result'
    content_search_result:
      title: Content Search Result
      description: A single search result. The `type` field discriminates between the flat shape used for snippets, external pages, files, and internal articles, and the nested shape used for help center articles.
      oneOf:
        - $ref: '#/components/schemas/content_search_default_item'
        - $ref: '#/components/schemas/content_search_article_item'
      discriminator:
        propertyName: type
        mapping:
          content_snippet: '#/components/schemas/content_search_default_item'
          external_content: '#/components/schemas/content_search_default_item'
          file_source_content: '#/components/schemas/content_search_default_item'
          internal_article: '#/components/schemas/content_search_default_item'
          article: '#/components/schemas/content_search_article_item'
    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
    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
```
