# Attach project data source `POST` `/api/v1/carve/projects/{project_id}/data-sources` Attach an existing CSV data source to the project. The data source must belong to the same account as the project. Pass an asset:// URI as source.id — the UUID is returned by the Assets endpoint. Only csv sources are currently supported. The first data source attached to a project is automatically set as the primary data source. If the account has a Carve subscription with a row limit, that limit is enforced when attaching the primary data source. Set `use_credits` to true to allow the data source to exceed the row limit by charging credits for the overage (1 credit per 10 rows above the limit). Returns 422 if the account has insufficient credits. The account sheet will need to be refreshed to reflect any changes. ## Path parameters | Name | Type | Required | Description | |------|------|----------|-------------| | project_id | string | yes | — | ## Request body `application/json` | Field | Type | Required | Description | |-------|------|----------|-------------| | source | object | yes | The data source to attach to the project. | | source.type | string | yes | Source type. Currently only 'csv' is supported. | | source.id | string | yes | asset:// URI for the data source (see Assets endpoint). | | use_credits | boolean | no | When true, and the data source exceeds the project row limit, charge credits to expand the limit rather than rejecting the request. Credits are charged only for rows above the current limit at the rate of 1 credit per 10 rows. The request is rejected with 422 if the account has insufficient credits. | ## Response `201 Created` — `application/json` | Field | Type | Description | |-------|------|-------------| | id | string | — | | name | string | — | | type | string | — | | is_primary | boolean | — | | created_at | string | — | | updated_at | string | — | ## Errors | Status | Description | |--------|-------------| | 403 | Forbidden | | 404 | Not Found | | 409 | Conflict | | 422 | Unprocessable Entity | | 500 | Internal Server Error |