> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.app/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/:botId/content/contentId` |
| **Content-Type**  | `application/json`                                   |
| **Authorization** | `auth: <JWT Token>`                                  |
| **API Scope**     | Document Management                                  |

### Query Parameters

| Parameter | Description                                                                                                                                                                                   | Mandatory |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| Bot ID    | 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 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/:botId/content` |
| **Content-Type**  | `application/json`                         |
| **Authorization** | `auth: <JWT Token>`                        |
| **API Scope**     | Document Management                        |

### Query Parameters

| Parameter | Description                       | Mandatory |
| --------- | --------------------------------- | --------- |
| Bot ID    | 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/:botId/content-by-cond` |
| **Content-Type**  | `application/json`                                 |
| **Authorization** | `auth: <JWT Token>`                                |
| **API Scope**     | Document Management                                |

### Query Parameters

| Parameter | Description                       | Mandatory |
| --------- | --------------------------------- | --------- |
| Bot ID    | 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 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"
}
```
