# Indexing

## Check indexing job status for a drive

> Get the indexing job status for a drive

```json
{"openapi":"3.1.0","info":{"title":"shade","version":"dev"},"paths":{"/indexing/job-status/{drive_id}":{"get":{"tags":["indexing"],"summary":"Check indexing job status for a drive","description":"Get the indexing job status for a drive","operationId":"get_indexing_job_status_indexing_job_status__drive_id__get","parameters":[{"name":"drive_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Drive Id"}},{"name":"password","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"The password","description":"The password header to use to fetch the preview"},"description":"The password header to use to fetch the preview"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_get_indexing_job_status_indexing_job_status__drive_id__get"}}}},"responses":{"200":{"description":"The current indexing job status for the drive","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndexingStatusDTO"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_get_indexing_job_status_indexing_job_status__drive_id__get":{"properties":{"body":{"additionalProperties":true,"type":"object","title":"Body","default":{}}},"type":"object","title":"Body_get_indexing_job_status_indexing_job_status__drive_id__get"},"IndexingStatusDTO":{"properties":{"jobs":{"items":{"$ref":"#/components/schemas/JobsRemainingDTO"},"type":"array","title":"Jobs"}},"type":"object","required":["jobs"],"title":"IndexingStatusDTO","description":"A DTO that shows the indexing status of a drive"},"JobsRemainingDTO":{"properties":{"name":{"$ref":"#/components/schemas/IndexingJobType"},"to_do":{"type":"integer","title":"To Do"}},"type":"object","required":["name","to_do"],"title":"JobsRemainingDTO","description":"A DTO that shows the number of jobs remaining for a specific job type"},"IndexingJobType":{"type":"string","enum":["download","metadata","image_preview","video_preview","complex_preview","document_preview","cpu_proxy","gpu_proxy","proxy","audio_proxy","core_audio","core_vision","color_palette","facial_recognition","custom_metadata","transcription","chunk_video","chunk_document","chunk_image"],"title":"IndexingJobType"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## Get the asset roots

> Get the asset roots

```json
{"openapi":"3.1.0","info":{"title":"shade","version":"dev"},"paths":{"/indexing/roots":{"get":{"tags":["indexing"],"summary":"Get the asset roots","description":"Get the asset roots","operationId":"get_asset_roots_indexing_roots_get","parameters":[{"name":"drive_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"The drive id","description":"The id of the drive we want to add users to"},"description":"The id of the drive we want to add users to"},{"name":"password","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"The password","description":"The password header to use to fetch the preview"},"description":"The password header to use to fetch the preview"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_get_asset_roots_indexing_roots_get"}}}},"responses":{"200":{"description":"The asset roots","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RootDTO"},"title":"Response Get Asset Roots Indexing Roots Get"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_get_asset_roots_indexing_roots_get":{"properties":{"body":{"additionalProperties":true,"type":"object","title":"Body","default":{}}},"type":"object","title":"Body_get_asset_roots_indexing_roots_get"},"RootDTO":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"path":{"type":"string","title":"Path"},"created":{"type":"string","format":"date-time","title":"Created"},"updated":{"type":"string","format":"date-time","title":"Updated"},"files_found":{"type":"integer","title":"Files Found","default":0},"size_bytes":{"type":"integer","title":"Size Bytes","default":0}},"type":"object","required":["id","path","created","updated"],"title":"RootDTO"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## Add asset roots

> Add asset roots

```json
{"openapi":"3.1.0","info":{"title":"shade","version":"dev"},"paths":{"/indexing/roots":{"post":{"tags":["indexing"],"summary":"Add asset roots","description":"Add asset roots","operationId":"create_roots_indexing_roots_post","parameters":[{"name":"password","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"The password","description":"The password header to use to fetch the preview"},"description":"The password header to use to fetch the preview"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_create_roots_indexing_roots_post"}}}},"responses":{"200":{"description":"The ID of the new root","content":{"application/json":{"schema":{"type":"array","items":{"type":"string","format":"uuid"},"title":"Response Create Roots Indexing Roots Post"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_create_roots_indexing_roots_post":{"properties":{"paths":{"items":{"type":"string","format":"path"},"type":"array","title":"Paths","description":"The paths to add as asset roots"},"drive_id":{"type":"string","format":"uuid","title":"Drive ID","description":"The ID of the drive"},"body":{"additionalProperties":true,"type":"object","title":"Body","default":{}}},"type":"object","required":["paths","drive_id"],"title":"Body_create_roots_indexing_roots_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## Remove an asset root

> Remove an asset root

```json
{"openapi":"3.1.0","info":{"title":"shade","version":"dev"},"paths":{"/indexing/roots/{root_id}":{"delete":{"tags":["indexing"],"summary":"Remove an asset root","description":"Remove an asset root","operationId":"delete_root_indexing_roots__root_id__delete","parameters":[{"name":"root_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Root ID","description":"The ID of the root to remove"},"description":"The ID of the root to remove"},{"name":"password","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"The password","description":"The password header to use to fetch the preview"},"description":"The password header to use to fetch the preview"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_delete_root_indexing_roots__root_id__delete"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_delete_root_indexing_roots__root_id__delete":{"properties":{"body":{"additionalProperties":true,"type":"object","title":"Body","default":{}}},"type":"object","title":"Body_delete_root_indexing_roots__root_id__delete"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```
