---
title: "Create a data source"
method: POST
path: "/v1/users/{userId}/data-sources"
tags: ["Data sources"]
---

# Create a data source

`POST /v1/users/{userId}/data-sources`

## Request body

- object
  - `dataSource` union, required
    - object
      - `name` string, required — The name of the data source, for display purposes.
      - `type` 'CSV' — The type of the data source. The type of a data source dictates where the data source's data comes from.
      - `columnsMetadata` DataSourceColumnMetadata[], required — A description of the format of each column of the data source's data.
        - `name` string, required
        - `type` object, required
          - `name` string
      - `rows` array[], required — The data source's data. Each item in the outer array represents a row, while each item in each inner array represents a cell in that row.
        - string[]
    - object
      - `name` string, required — The name of the data source, for display purposes.
      - `type` 'DATABASE', required — The type of the data source. The type of a data source dictates where the data source's data comes from.
      - `databaseConnection` string, required — The ID of the database connection this data source retrieves its data from.
      - `tableName` string, required — The name of the table or view in the database that this data source retrieves its data from.

## Response `201`

Success

- object
  - `dataSource` union, required
    - object
      - `id` string, required
      - `name` string, required
      - `aclObject` string — The ACL object ID of the entity.
      - `lastUpdatedTime` string, required
      - `version` number, required
      - `type` 'CSV', required
      - `state` 'ENABLED' | 'DISABLED', required
      - `links` object, required
        - `self` string, required
        - `acl` string, required
      - `columnsMetadata` DataSourceColumnMetadata[], required
        - `name` string, required
        - `type` object, required
          - `name` string
    - object
      - `id` string, required
      - `name` string, required
      - `aclObject` string — The ACL object ID of the entity.
      - `lastUpdatedTime` string, required
      - `version` number, required
      - `type` 'DATABASE', required
      - `state` 'ENABLED' | 'DISABLED', required
      - `links` object, required
        - `self` string, required
        - `acl` string, required
      - `databaseConnection` string, required
      - `tableName` string, required

## Other responses

- `400` — 400 Bad Request response
- `401` — 401 Unauthenticated response
- `403` — 403 Unauthorized response
- `422` — 422 Bad Entity response

---

[API](https://skmtc.net/wiremock/apis/wiremock-cloud.md) · [All operations](https://skmtc.net/wiremock/apis/wiremock-cloud/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/wiremock/wiremock-cloud/revisions/93bebefc672f/schema)
