---
title: "Create datasource"
method: POST
path: "/datasources"
tags: ["Datasources"]
---

# Create datasource

`POST /datasources`

## Request

- Base URL: `https://api.distill.io/v2`
- URL: `https://api.distill.io/v2/datasources`
- Auth: one of:
  - API key in cookie `connect.sid`
  - HTTP bearer
  - API key in query parameter `api_key`

Auth: Enterprise+Admin — Enterprise plan account with admin role on the workspace.

## Request body

- object
  - `name` string, required
  - `description` string, nullable
  - `datasource_type` string
  - `page_type_id` string, uuid, nullable
  - `provider_id` string, uuid, nullable
  - `category_id` string, uuid, required
  - `cost` integer
  - `example_uri` string[], nullable
  - `priority` integer
  - `params` object
  - `state` 0 | 40 | 100
  - `schema` object, nullable
  - `min_plan_price` integer
  - `async` boolean
  - `example_data` object, nullable
  - `slug` string, required
  - `spec` object

## Response `200`

Success

- object
  - `id` string, uuid, required
  - `name` string, required
  - `description` string, nullable
  - `datasource_type` string, nullable
  - `priority` integer, nullable
  - `state` integer, required
  - `category_id` string, uuid, nullable
  - `category` string, nullable
  - `cost` integer, nullable
  - `slug` string, nullable
  - `async` boolean, nullable
  - `min_plan_price` integer, nullable
  - `schema` object, nullable
  - `datasource_params` object, nullable
  - `spec` object
  - `ts` string, date-time, required
  - `ts_mod` string, date-time, required

## Other responses

- `400`: Validation error
- `401`: Unauthorized
- `403`: Forbidden

---

[API](https://skmtc.dev/distill/apis/distill-io-api-v2.md) - [All operations](https://skmtc.dev/distill/apis/distill-io-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/distill/apis/distill-io-api-v2/revisions/c55722ccfe14?raw)
