# Run a bulk action on Knowledge Hub content

`POST /content/bulk_actions`

> This is a subset of the full specification, limited to the `POST /content/bulk_actions` 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 /content/bulk_actions` 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: Content
    description: Search and operations over Knowledge Hub content — articles, snippets, external pages, uploaded files, and internal articles.
paths:
  /content/bulk_actions:
    post:
      summary: Run a bulk action on Knowledge Hub content
      parameters:
        - name: Intercom-Version
          in: header
          schema:
            $ref: '#/components/schemas/intercom_version'
      tags:
        - Content
      operationId: bulkContentActions
      description: |
        Asynchronously run a bulk action over up to 1,000 Knowledge Hub content items.

        Six actions are supported:
          * `publish` and `unpublish` — apply to `article_content` only.
          * `delete` — permanently delete content (excludes synced sources and `external_content`).
          * `set_availability` — toggle Fin AI Agent, Copilot, and Sales Agent availability flags.
          * `set_audience` — manage segment membership on content.
          * `update_tags` — apply and/or remove existing tags on content. Unlike the other
            actions, `update_tags` addresses articles by the parent `article` id, not
            `article_content`. Tags must already exist and not be archived; supply at least one of
            `add_tag_ids` / `remove_tag_ids`.

        The endpoint validates the request, enqueues background work, and returns 202 with a
        placeholder envelope. Items whose `type` is not in the action's allowlist are silently
        dropped before processing. Articles imported from synced sources (Confluence, Notion,
        Zendesk, Salesforce Knowledge, etc.) are silently skipped on `delete` — they can only be
        removed by disconnecting the underlying import source.

        Requires the `write_content` OAuth scope.
      responses:
        '202':
          description: Accepted — work has been enqueued
          content:
            application/json:
              examples:
                Queued:
                  summary: Queued
                  value:
                    type: content_bulk_action
                    status: queued
              schema:
                $ref: '#/components/schemas/content_bulk_action_response'
        '401':
          description: Unauthorized. The token is invalid or is missing the `write_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 action, content_ids, or action-specific parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/content_bulk_action_request'
            examples:
              publish:
                summary: Publish articles
                value:
                  action: publish
                  content_ids:
                    - type: article_content
                      id: '12345678'
                    - type: article_content
                      id: '12345679'
              unpublish:
                summary: Unpublish articles
                value:
                  action: unpublish
                  content_ids:
                    - type: article_content
                      id: '12345678'
              delete:
                summary: Delete content across types
                value:
                  action: delete
                  content_ids:
                    - type: article_content
                      id: '12345678'
                    - type: internal_article
                      id: '12345679'
                    - type: content_snippet
                      id: '12345680'
              set_availability:
                summary: Toggle Fin AI Agent on, Copilot off
                value:
                  action: set_availability
                  content_ids:
                    - type: article_content
                      id: '12345678'
                  availability:
                    ai_agent: true
                    copilot: false
              set_audience:
                summary: Add and remove segments
                value:
                  action: set_audience
                  content_ids:
                    - type: article_content
                      id: '12345678'
                  audience:
                    add_segment_ids:
                      - 100
                    remove_segment_ids:
                      - 200
              update_tags:
                summary: Apply and remove tags on an article
                value:
                  action: update_tags
                  content_ids:
                    - type: article
                      id: '12345678'
                  tags:
                    add_tag_ids:
                      - 100
                    remove_tag_ids:
                      - 200
components:
  schemas:
    content_bulk_action_request:
      title: Content Bulk Action Request Payload
      type: object
      required:
        - action
        - content_ids
      properties:
        action:
          type: string
          description: |
            The bulk action to perform. Allowed `content_ids[].type` values vary per action:
              * `publish`, `unpublish`: `article_content`
              * `delete`: `article_content`, `content_snippet`, `file_source_content`, `internal_article`
              * `set_availability`, `set_audience`: `article_content`, `content_snippet`, `external_content`, `file_source_content`, `internal_article`
              * `update_tags`: `article` (the parent Article id, not `article_content`), `content_snippet`, `external_content`, `file_source_content`, `internal_article`
          enum:
            - publish
            - unpublish
            - delete
            - set_availability
            - set_audience
            - update_tags
          example: publish
        content_ids:
          type: array
          maxItems: 1000
          description: Up to 1,000 content items to apply the action to.
          items:
            type: object
            required:
              - type
              - id
            properties:
              type:
                type: string
                enum:
                  - article
                  - article_content
                  - content_snippet
                  - external_content
                  - file_source_content
                  - internal_article
                example: article_content
              id:
                type: string
                example: '12345678'
        availability:
          type: object
          description: |
            Required when `action` is `set_availability`. Each field is optional — only the
            properties present in the request are toggled.
          properties:
            ai_agent:
              type: boolean
              description: Toggle Fin AI Agent availability.
            copilot:
              type: boolean
              description: Toggle Copilot availability.
            sales_agent:
              type: boolean
              description: Toggle Sales Agent availability.
        audience:
          type: object
          description: Required when `action` is `set_audience`. Manages segment membership.
          properties:
            add_segment_ids:
              type: array
              description: Segment IDs to assign to the selected content.
              items:
                type: integer
              example:
                - 100
            remove_segment_ids:
              type: array
              description: Segment IDs to remove from the selected content.
              items:
                type: integer
              example:
                - 200
            remove_all:
              type: boolean
              description: When `true`, removes all segments from the selected content.
              example: false
        tags:
          type: object
          description: |
            Required when `action` is `update_tags`. Applies and/or removes existing tags.
            Supply at least one of `add_tag_ids` / `remove_tag_ids`. At most 100 distinct tag IDs
            may be supplied across `add_tag_ids` and `remove_tag_ids` combined. Tag IDs must
            reference existing, non-archived tags; exceeding the limit or referencing unknown or
            archived IDs is rejected with `parameter_invalid` (HTTP 422).
          properties:
            add_tag_ids:
              type: array
              description: Tag IDs to apply to the selected content.
              items:
                type: integer
              example:
                - 100
            remove_tag_ids:
              type: array
              description: Tag IDs to remove from the selected content.
              items:
                type: integer
              example:
                - 200
    content_bulk_action_response:
      title: Content Bulk Action Response Envelope
      type: object
      description: |
        Phase 1 envelope returned immediately after the request is enqueued. A future
        Preview release will replace this with a polling-friendly job resource that
        surfaces progress and per-item results (updated, unchanged, skipped, failed).
      properties:
        type:
          type: string
          example: content_bulk_action
        status:
          type: string
          example: queued
    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
```
