---
title: "Create Datastore"
method: POST
path: "/datastores"
tags: ["/datastores"]
---

# Create Datastore

`POST /datastores`

Create a new `Datastore`.

A `Datastore` is a collection of documents. Documents can be ingested into and deleted from a `Datastore`.

A `Datastore` can be linked to one or more `Agents`, and conversely, an `Agent` can be associated with one or more `Datastores` to ground its responses with relevant data. This flexible many-to-many relationship allows `Agents` to draw from multiple sources of information. This linkage of `Datastore` to `Agent` is done through the `Create Agent` or `Edit Agent` APIs.

> Note that self-serve users are currently required to create datastores through our UI. Otherwise, they will receive the following message: "This endpoint is disabled as you need to go through checkout. Please use the UI to make this request."

## Request body

- DatastoreInput — DatastoreInput for creating a new datastore. If no type is provided, we default to unstructured.
  - `name` string, required — Name of the datastore

## Response `200`

Successful Response

- CreateDatastoreOutput
  - `id` string, uuid, required — ID of the datastore

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/contextualai/apis/endpoints.md) · [All operations](https://skmtc.dev/contextualai/apis/endpoints/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/contextualai/endpoints/revisions/17bdb8a33fb4/schema)
