> ## Documentation Index
> Fetch the complete documentation index at: https://koreai-content-gov.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Content APIs

<Badge icon="arrow-left" color="gray">[Back to API List](/ai-for-service/apis/searchai/api-list)</Badge>

## Get Content By ID

This API returns the requested content.

| Field             | Value                                                |
| ----------------- | ---------------------------------------------------- |
| **Method**        | GET                                                  |
| **Endpoint**      | `<host_url>/api/public/bot/:appId/content/contentId` |
| **Content-Type**  | `application/json`                                   |
| **Authorization** | `auth: <JWT Token>`                                  |
| **API Scope**     | Document Management                                  |

### Query Parameters

| Parameter | Description                                                                                                                                                                                   | Mandatory |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| appId     | Provide your application ID here.                                                                                                                                                             | Yes       |
| ContentID | Unique ID of the content to retrieve. Returned as `doc_id` in the advancedSearch API response. Also visible in the Chunk Browser as `docId` or in the JSON view of ingested content as `_id`. | Yes       |

### Sample Response

```json expandable=true theme={null}
{
  "_id": "fc-26d474d1-2aa7-50cf-984d-e719a4884792",
  "searchIndexId": "sidx-cdd15c7a-47d5-5839-80ee-e4f418489f70",
  "streamId": "st-7561b874-2114-5b8f-8086-ea69007b5f53",
  "createdBy": "u-4d04030a-93f3-5cba-a07b-1a5b20a7e9a9",
  "createdOn": "2024-03-06T12:08:39.719Z",
  "lMod": "2024-11-18T07:33:35.000Z",
  "extractionType": "jira",
  "extractionSourceId": "fs-5c651c22-eb9f-5bb7-ad51-84de1df15639",
  "jobId": "fj-fecfb47b-eea8-5419-aadb-ad8552c0a7e5",
  "_source": {
    "meta_data": {
      "assignee": "John",
      "projectId": "10000",
      "issueType": "Task",
      "projectName": "Searchassist_Test",
      "issueStatus": "To Do",
      "comments": " Continue Working on it.. Give the Latest Update ",
      "reporter": "Jacob",
      "ticketId": "ST-2"
    },
    "sys_racl": ["10000"],
    "sys_content_type": "jira",
    "sys_source_name": "Jira COnnector",
    "sourceType": "jira",
    "raw_data": "...",
    "base_url": "",
    "title": "Debugging Request",
    "content": "Debugging Request...",
    "url": "https://myprojectjira.atlassian.net/browse/xx-2",
    "type": "Task",
    "comments": " Please Update the status."
  },
  "connectorId": "fcon-c13cc009-be5f-50d8-b903-941f88f7b3b7",
  "externalSourceId": "sidx-cdd15c7a-47d5-5839-80ee-e4f418489f70_ST-2",
  "updatedOn": "2024-09-09T10:32:27.394Z",
  "__v": 0
}
```

***

## Delete Content

This API deletes specific content from the SearchAI application. Deleting content also deletes the corresponding chunks.

| Field             | Value                                      |
| ----------------- | ------------------------------------------ |
| **Method**        | DELETE                                     |
| **Endpoint**      | `<host_url>/api/public/bot/:appId/content` |
| **Content-Type**  | `application/json`                         |
| **Authorization** | `auth: <JWT Token>`                        |
| **API Scope**     | Document Management                        |

### Query Parameters

| Parameter | Description                       | Mandatory |
| --------- | --------------------------------- | --------- |
| appId     | Provide your application ID here. | Yes       |

### Request Parameters

| Parameter | Description                                                                                                                               | Mandatory |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| `docIDs`  | Array of record identifiers to delete. The ID is available as `doc_id` and starts with `"d-"`. Use this field for structured data/chunks. | Yes       |

**Sample Request**

```json theme={null}
{
  "docIds": [
    "fc-dafe0d2b-cb65-5f74-8f42-e0d4855e20ee",
    "fc-dafe0d2b-cb65-5f74-8f42-e0d4855e20edd"
  ]
}
```

### Response Parameters

| Parameter      | Description                            |
| -------------- | -------------------------------------- |
| `deletedCount` | Count of records deleted successfully. |

***

## Get Content by Condition

This API fetches specific content from the SearchAI application based on a given condition.

| Field             | Value                                              |
| ----------------- | -------------------------------------------------- |
| **Method**        | POST                                               |
| **Endpoint**      | `<host_url>/api/public/bot/:appId/content-by-cond` |
| **Content-Type**  | `application/json`                                 |
| **Authorization** | `auth: <JWT Token>`                                |
| **API Scope**     | Document Management                                |

### Query Parameters

| Parameter | Description                       | Mandatory |
| --------- | --------------------------------- | --------- |
| appId     | Provide your application ID here. | Yes       |

### Request Parameters

| Parameter    | Description                                                                                                                                                                                                                                           | Mandatory |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| `query`      | Contains fields on which filters are applied. Multiple fields are combined with a logical AND. For example, `{"sys_content_type": "file"}` returns all file-type content. Adding `"title": "my file"` narrows results to files with that exact title. | Yes       |
| `nextCursor` | Used for cursor-based pagination. Omit on first request. Pass the cursor from the previous response to get the next page. A `null` value indicates the end of results.                                                                                | No        |

### Sample Request

```json theme={null}
{
  "query": {
    "title": "title of the file",
    "sys_content_type": "file"
  }
}
```

### Sample Response

```json expandable=true theme={null}
{
  "data": [
    {
      "_id": "fc-d19666d5-234b-587c-a197-40efa2ec9d3d",
      "searchIndexId": "sidx-d8d728ad-1ddd-57f0-aa98-895efa328898",
      "streamId": "st-86b7aeda-c010-504d-ac5e-f01df1407ec6",
      "createdBy": "u-1e066081-f25d-5b7b-99d5-1b873ea50b09",
      "lModBy": "u-1e066081-f25d-5b7b-99d5-1b873ea50b09",
      "createdOn": "2025-11-04T05:37:21.694Z",
      "lMod": "2025-11-04T05:37:21.000Z",
      "extractionType": "file",
      "extractionSourceId": "fs-9a3feb4e-d97f-5bfc-84cd-c999f62dc6fa",
      "jobId": "fj-75b384de-e38c-5b85-b152-6d45aa5a042d",
      "_meta": {
        "state": "approved",
        "isDeleted": false,
        "contentSource": "file",
        "size": 1322647,
        "updateAvailable": false,
        "recordsCount": 4,
        "file_url": "https://host/api/getMediaStream/findly/f-c65e029e-e553-59bd-83e2-0b230ba88deb.pdf?..."
      },
      "_source": {
        "file_title": "Company.ai_Conversational_AI_Solutions_Brief.pdf",
        "sys_racl": ["*"],
        "sys_content_type": "file",
        "sys_source_name": "Default Directory",
        "type": "application/pdf",
        "sys_file_type": "pdf"
      },
      "__v": 0
    }
  ],
  "nextCursor": null,
  "prevCursor": "fc-d19666d5-234b-587c-a197-40efa2ec9d3d"
}
```

## Get Content By Status

This API returns the content by status. Use the API after a Web Crawl to retrieve pages that were deleted during the most recent crawl. Currently, the API supports retrieving only content ingested via **web crawls**.

<Note>The Get Content By Status API is available only for Web Crawl sources.</Note>

| Field             | Value                                                           |
| ----------------- | --------------------------------------------------------------- |
| **Method**        | POST                                                            |
| **Endpoint**      | `<host_url>/api/public/bot/:appId/search/get-content-by-status` |
| **Content-Type**  | `application/json`                                              |
| **Authorization** | `auth: <JWT Token>`                                             |
| **API Scope**     | Document Management                                             |

### Query Parameters

| Parameter | Description                       | Mandatory |
| --------- | --------------------------------- | --------- |
| appId     | Provide your application ID here. | Yes       |

### Request Parameters

| Parameter  | Description                                                                                | Mandatory |
| ---------- | ------------------------------------------------------------------------------------------ | --------- |
| sourceName | Name of the crawl source for which content is to be retrieved.                             | Yes       |
| status     | Content status to retrieve. The status of the page can be `success`, `failed` or `deleted` | Yes       |

### Sample Request

```
curl --location 'https://domain/api/public/bot/st-5909d84b-14ec-5630-ae96-a289fde6e621/search/get-content-by-status' \
--header 'auth: eyJhbGcixxxxxxxxxxxxxxxxxxxxxxxxxxx.eyJhcHBJZCI6ImNzLTAxYjhkNDFmLTcwZGYtNTZmNi04YWY4LWM5YzkwMTUxMTQ3YyJ9.bi5ofPtmUl8E1WjyUQ223x82Hr7T9sIwO5lcGU_OT3k' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '{
  "sourceName": "docs", //name of the crawl source
  "status": "deleted"
}'
```

### Sample Response

```json theme={null}
{
    "status": "deleted",
    "data": [
        {
            "url": "https://domain/abl-reference/data-types-and-utilities",
            "title": "Data Types and Utilities",
            "docId": "fc-9b060df5-ddb4-44eb-8fe7-491aee00dac7",
            "jobId": "fj-52f8a37e-c72c-5f20-8647-6a21636cf21b",
            "sourceId": "fs-d972cf75-8b03-55e7-85fe-2f043d667f3c",
            "status": "deleted",
            "createdOn": "2026-08-10T06:36:11.807Z",
            "deletedOn": "2026-08-10T06:36:11.807Z"
        },
        {
            "url": "https://domain/abl-reference/agent-declaration",
            "title": "Agent Declaration",
            "docId": "fc-79b9fd45-43a0-40d5-b095-ed43a57fa29d",
            "jobId": "fj-52f8a37e-c72c-5f20-8647-6a21636cf21b",
            "sourceId": "fs-d972cf75-8b03-55e7-85fe-2f043d667f3c",
            "status": "deleted",
            "createdOn": "2026-08-10T06:36:11.807Z",
            "deletedOn": "2026-08-10T06:36:11.807Z"
        },
        {
            "url": "https://domain/abl-reference/behavior-profiles",
            "title": "Behavior profiles",
            "docId": "fc-2312d6e4-ec8a-4f4e-8150-344d7c7f7b65",
            "jobId": "fj-52f8a37e-c72c-5f20-8647-6a21636cf21b",
            "sourceId": "fs-d972cf75-8b03-55e7-85fe-2f043d667f3c",
            "status": "deleted",
            "createdOn": "2026-08-10T06:36:11.807Z",
            "deletedOn": "2026-08-10T06:36:11.807Z"
        }
    ],
    "hasMore": false,
    "nextCursor": null,
    "prevCursor": "ferr-5069ec29-ab4f-5394-aff5-9617b109e6e9"
}
```

## Use Case: Synchronize an External Content Store with Search AI

This use case applies only to **Web Crawl sources**.

If you maintain an external search index or vector database that mirrors the content ingested into Search AI, you can use the following APIs to keep your external system synchronized with Search AI.

After each Web Crawl:

* To retrieve newly added and updated pages, call the **Get Content By Condition** API and set the following request parameter:

  ```json theme={null}
    {
      "query": {
        "lastCrawlStatus": "CHANGED"
      } 
    }
  ```

  This returns all pages that were created or updated since the previous crawl.

* To retrieve deleted pages, call the **Get Content By Status** API with the following request body:

  ```json theme={null}
  {
    "sourceName": "<source_name>",
    "status": "deleted"
  }
  ```

  This returns all pages that were deleted from the website during the crawl.
