# Admin · Indexing

8 operations on the Logion v1 API.

- [Get known indexed sources](#get-known-indexed-sources) — `GET /v1/admin/indexing/known`
- [Create indexed bundle upload (permissive only)](#create-indexed-bundle-upload-permissive-only) — `POST /v1/admin/indexing/listings/{listing_id}/bundle-upload`
- [Complete an indexed bundle upload (verify + flip hosting_mode)](#complete-an-indexed-bundle-upload-verify-flip-hosting-mode) — `POST /v1/admin/indexing/listings/{listing_id}/bundle-upload/completion`
- [Batch upsert indexed listings](#batch-upsert-indexed-listings) — `POST /v1/admin/indexing/listings:batch-upsert`
- [Open an indexing run](#open-an-indexing-run) — `POST /v1/admin/indexing/runs`
- [Get indexing run progress](#get-indexing-run-progress) — `GET /v1/admin/indexing/runs/{run_id}`
- [Complete an indexing run](#complete-an-indexing-run) — `PATCH /v1/admin/indexing/runs/{run_id}/completion`
- [Update indexing run progress](#update-indexing-run-progress) — `PATCH /v1/admin/indexing/runs/{run_id}/progress`

## Get known indexed sources

```http
GET /v1/admin/indexing/known
```

Operation id: `get_known_indexed_sources`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `ids` | query | string[] | yes |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | `GetKnownIndexedSourcesResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `422` | Validation Error | `HTTPValidationError` |

Returns `GetKnownIndexedSourcesResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `known` | object | yes |  |

## Create indexed bundle upload (permissive only)

```http
POST /v1/admin/indexing/listings/{listing_id}/bundle-upload
```

Operation id: `create_indexed_bundle_upload`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `listing_id` | path | string(uuid) | yes |

**Request body**

Body `CreateIndexedBundleUploadRequest, optional`.

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | OK | `CreateIndexedBundleUploadResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `409` | Conflict | `ErrorResponse` |
| `422` | Validation Error | `HTTPValidationError` |

Returns `CreateIndexedBundleUploadResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `bundle_key` | string | yes |  |
| `listing_id` | string(uuid) | yes |  |
| `put_url` | string | yes |  |

## Complete an indexed bundle upload (verify + flip hosting_mode)

```http
POST /v1/admin/indexing/listings/{listing_id}/bundle-upload/completion
```

Operation id: `complete_indexed_bundle_upload`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `listing_id` | path | string(uuid) | yes |

**Request body**

Body `CompleteIndexedBundleUploadRequest`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `bundle_key` | string | yes |  |
| `sha256` | string | yes |  |
| `size_bytes` | integer | yes |  |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | OK | `CompleteIndexedBundleUploadResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `409` | Conflict | `ErrorResponse` |
| `422` | Unprocessable entity | `ErrorResponse` |

Returns `CompleteIndexedBundleUploadResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `hosting_mode` | string | yes |  |
| `listing_id` | string(uuid) | yes |  |
| `mirrored_bundle_key` | string | yes |  |

## Batch upsert indexed listings

```http
POST /v1/admin/indexing/listings:batch-upsert
```

Operation id: `batch_upsert_listings`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Request body**

Body `BatchUpsertListingsRequest`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `items` | BatchItemSchema[] | yes |  |
| `run_id` | string(uuid), optional | no |  |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | `BatchUpsertListingsResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Unknown run_id | `ErrorResponse` |
| `409` | Run already closed | `ErrorResponse` |
| `422` | Validation error (batch size exceeded) | `ErrorResponse` |

Returns `BatchUpsertListingsResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `results` | BatchItemResultSchema[] | yes |  |

## Open an indexing run

```http
POST /v1/admin/indexing/runs
```

Operation id: `open_indexing_run`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `201` | Created | `OpenIndexingRunResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `422` | Validation Error | `HTTPValidationError` |

Returns `OpenIndexingRunResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `run_id` | string(uuid) | yes |  |

## Get indexing run progress

```http
GET /v1/admin/indexing/runs/{run_id}
```

Operation id: `get_indexing_run_progress`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `run_id` | path | string(uuid) | yes |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | `GetIndexingRunProgressResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `422` | Validation Error | `HTTPValidationError` |

Returns `GetIndexingRunProgressResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `closed_at` | string(date-time), optional | yes |  |
| `created_at` | string(date-time) | yes |  |
| `run_id` | string(uuid) | yes |  |
| `stats` | object, optional | yes |  |
| `status` | enum("open", "closed") | yes |  |
| `updated_at` | string(date-time) | yes |  |

## Complete an indexing run

```http
PATCH /v1/admin/indexing/runs/{run_id}/completion
```

Operation id: `complete_indexing_run`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `run_id` | path | string(uuid) | yes |

**Request body**

Body `CompleteIndexingRunRequest`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `stats` | object, optional | no |  |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | `CompleteIndexingRunResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `409` | Conflict | `ErrorResponse` |
| `422` | Validation Error | `HTTPValidationError` |

Returns `CompleteIndexingRunResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `run_id` | string(uuid) | yes |  |
| `stats` | object, optional | yes |  |
| `status` | string | yes |  |

## Update indexing run progress

```http
PATCH /v1/admin/indexing/runs/{run_id}/progress
```

Operation id: `update_indexing_run_progress`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `run_id` | path | string(uuid) | yes |

**Request body**

Body `UpdateIndexingRunProgressRequest`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `stats` | IndexingRunProgressStats | yes |  |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | `UpdateIndexingRunProgressResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `409` | Run already closed | `ErrorResponse` |
| `422` | Validation Error | `HTTPValidationError` |

Returns `UpdateIndexingRunProgressResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `closed_at` | string(date-time), optional | yes |  |
| `created_at` | string(date-time) | yes |  |
| `run_id` | string(uuid) | yes |  |
| `stats` | object | yes |  |
| `status` | enum("open", "closed") | yes |  |
| `updated_at` | string(date-time) | yes |  |
