# Create an external page (or update an external page by external ID)

You can create a new external page by sending a POST request to this endpoint. If an external page already exists with the specified source_id and external_id, it will be updated instead.
OAuth tokens must have the `read_write_ai_content` scope.

Endpoint: POST /ai/external_pages
Version: Preview
Security: bearerAuth

## Header parameters:

  - `Intercom-Version` (string)

## Request fields (application/json):

  - `title` (string, required)
    The title of the external page.
    Example: Getting started with...

  - `html` (string, required)
    The body of the external page in HTML.
    Example: <p>Hello world!</p>

  - `url` (string)
    The URL of the external page. This will be used by Fin to link end users to the page it based its answer on. When a URL is not present, Fin will not reference the source.
    Example: https://help.example.com/en/articles/1234-getting-started

  - `ai_agent_availability` (boolean)
    Whether the external page should be used to answer questions by AI Agent. Will not default when updating an existing external page.
    Example: true

  - `ai_copilot_availability` (boolean)
    Whether the external page should be used to answer questions by AI Copilot. Will not default when updating an existing external page.
    Example: true

  - `ai_sales_agent_availability` (boolean)
    Whether the external page should be used to answer questions by AI Sales Agent. Will not default when updating an existing external page.
    Example: true

  - `locale` (string, required)
    The language code of the external page, for example `en` or `fr`. It must be a language supported by the workspace.
    Example: en

  - `source_id` (integer, required)
    The unique identifier for the source of the external page which was given by Intercom. Every external page must be associated with a Content Import Source which represents the place it comes from and from which it inherits a default audience (configured in the UI). For a new source, make a POST request to the Content Import Source endpoint and an ID for the source will be returned in the response.
    Example: 1234

  - `external_id` (string, required)
    The identifier for the external page which was given by the source. Must be unique for the source.
    Example: 5678

  - `audience_ids` (array)
    The list of audience IDs to target this external page to for Fin AI Agent. Omitting the field preserves any default audience segments inherited from the parent content import source. Pass an explicit array to override inherited defaults with the given set. Pass `[]` to clear all audience memberships (even if the source has defaults). Unknown audience IDs return a `404` error with no partial commit.
    Example: [1,2]

## Response 200 fields (application/json):

  - `type` (string, required)
    Always external_page
    Enum: "external_page"

  - `id` (string, required)
    The unique identifier for the external page which is given by Intercom.
    Example: 1234

  - `title` (string, required)
    The title of the external page.
    Example: Getting started with...

  - `html` (string, required)
    The body of the external page in HTML.
    Example: <p>Hello world!</p>

  - `url` (string)
    The URL of the external page. This will be used by Fin to link end users to the page it based its answer on.
    Example: https://help.example.com/en/articles/1234-getting-started

  - `ai_agent_availability` (boolean, required)
    Whether the external page should be used to answer questions by AI Agent.
    Example: true

  - `ai_copilot_availability` (boolean, required)
    Whether the external page should be used to answer questions by AI Copilot.
    Example: true

  - `ai_sales_agent_availability` (boolean)
    Whether the external page should be used to answer questions by AI Sales Agent.
    Example: true

  - `fin_availability` (boolean)
    Deprecated. Use ai_agent_availability, ai_copilot_availability, and ai_sales_agent_availability instead.
    Example: true

  - `locale` (string, required)
    The language code of the external page, for example `en` or `fr`.
    Example: en

  - `source_id` (integer, required)
    The unique identifier for the source of the external page which was given by Intercom. Every external page must be associated with a Content Import Source which represents the place it comes from and from which it inherits a default audience (configured in the UI). For a new source, make a POST request to the Content Import Source endpoint and an ID for the source will be returned in the response.
    Example: 1234

  - `external_id` (string, required)
    The identifier for the external page which was given by the source. Must be unique for the source.
    Example: 5678

  - `tags` (object)
    The tags applied to the external page.

  - `tags.type` (string)
    The type of the object
    Enum: "tag.list"

  - `tags.tags` (array)
    A list of tags objects associated with the object.

  - `tags.tags.type` (string)
    value is "tag"
    Example: tag

  - `tags.tags.id` (string)
    The id of the tag
    Example: 123456

  - `tags.tags.name` (string)
    The name of the tag
    Example: Test tag

  - `tags.tags.applied_at` (integer)
    The time when the tag was applied to the object. Only present when the tag is returned as part of a tagging operation on a contact, conversation, ticket, article, internal article, content snippet, or external page, when listing the tags on a contact, or when it is returned as part of an external page. `null` when the tag has just been removed from an article, internal article, content snippet or external page. Removing a tag from a contact, conversation or ticket returns the original value.
    Example: 1663597223

  - `tags.tags.applied_by` (object)
    The admin who applied the tag. Only present when the tag is returned as part of a tagging operation on a contact, conversation, ticket, article, internal article, content snippet, or external page, when listing the tags on a contact, or when it is returned as part of an external page. `null` when the tag has just been removed from an article, internal article, content snippet or external page. Removing a tag from a contact, conversation or ticket returns the original value. When no admin is recorded, `type` is `nobody_admin` and `id` is `null`.

  - `tags.tags.applied_by.type` (string)
    Example: contact

  - `tags.tags.applied_by.id` (string)
    Example: 1a2b3c

  - `created_at` (integer, required)
    The time when the external page was created.
    Example: 1672928359

  - `updated_at` (integer, required)
    The time when the external page was last updated.
    Example: 1672928610

  - `last_ingested_at` (integer, required)
    The time when the external page was last ingested.
    Example: 1672928610

  - `audience_ids` (array)
    The list of audience IDs this external page is targeted to for Fin AI Agent. Empty array means no audience targeting is set.
    Example: [1,2]

## Response 400 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: error.list

  - `request_id` (string)
    Example: f93ecfa8-d08a-4325-8694-89aeb89c8f85

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code.
    Example: unauthorized

  - `errors.message` (string)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

## Response 401 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: error.list

  - `request_id` (string)
    Example: f93ecfa8-d08a-4325-8694-89aeb89c8f85

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code.
    Example: unauthorized

  - `errors.message` (string)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

## Response 404 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: error.list

  - `request_id` (string)
    Example: f93ecfa8-d08a-4325-8694-89aeb89c8f85

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code.
    Example: unauthorized

  - `errors.message` (string)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

