API reference
Project data sources
Attach a project-owned vector store as a project data source. This differs from attaching a file to a store and enables project-level retrieval behavior.
File inputs & retrieval ↗ · Build document Q&A ↗
How it fits together
- 01Attach a vector store to a project
- 02List the vector stores attached to a project
- 03Detach a vector store from a project
Select an action to see its complete inputs, request, response, and status codes.
Attach a vector store to a project
/api/v1/tenancy/projects/{project_id}/data-sourceshttps://api.mahvashai.irapplication/jsonParameters
The table shows the accepted inputs for this endpoint. Examples use placeholders and illustrate a safe integration pattern.
| Name | Location | Type | Required | Support | Details |
|---|---|---|---|---|---|
project_id | Path | string | Required | Mahvash extension | Project UUID. |
X-Request-ID | Header | string | Optional | Mahvash extension | Client-supplied correlation ID. Echoed on every response; replaced when absent or malformed. |
X-Mahvash-Project | Header | string | Optional | Mahvash extension | Project slug or ID within the caller's organization. Narrows the request principal; it can never widen it. |
position | Body | integer | Optional | Mahvash extension | Optional ordering position. |
vector_store_id | Body | string | Required | Mahvash extension | Owned vector store UUID. |
Request
curl -X POST 'https://api.mahvashai.ir/api/v1/tenancy/projects/<project_id>/data-sources' \
-H "Authorization: Bearer $MAHVASH_USER_JWT" \
-H "Content-Type: application/json" \
-d '{
"vector_store_id": "3f5a8c4e-6b8d-4a4f-9d2c-1f0a2b3c4d5e"
}'Response
{
"status": 201,
"data": {
"id": "<data-source-uuid>",
"vector_store_id": "<store-uuid>",
"position": 0,
"added_by": "<user-id>"
}
}Illustrative response shape; actual fields depend on the operation and model.
Status codes
| HTTP | Details |
|---|---|
| 201 | Attach a vector store to a project. |
| 400 | The request is not valid. |
| 401 | Authentication credentials are missing or invalid. |
| 403 | The principal is not allowed to perform this request. |
| 404 | No such resource is visible to this principal. |
| 409 | The requested transition conflicts with durable resource state. |
| 429 | A quota or rate limit was exceeded. |
| 500 | An internal error occurred. |
List the vector stores attached to a project
/api/v1/tenancy/projects/{project_id}/data-sourceshttps://api.mahvashai.irParameters
The table shows the accepted inputs for this endpoint. Examples use placeholders and illustrate a safe integration pattern.
| Name | Location | Type | Required | Support | Details |
|---|---|---|---|---|---|
project_id | Path | string | Required | Mahvash extension | Project UUID. |
X-Request-ID | Header | string | Optional | Mahvash extension | Client-supplied correlation ID. Echoed on every response; replaced when absent or malformed. |
X-Mahvash-Project | Header | string | Optional | Mahvash extension | Project slug or ID within the caller's organization. Narrows the request principal; it can never widen it. |
Request
curl -X GET 'https://api.mahvashai.ir/api/v1/tenancy/projects/<project_id>/data-sources' \
-H "Authorization: Bearer $MAHVASH_USER_JWT"Response
{
"status": 0,
"data": "<value>"
}Illustrative response shape; actual fields depend on the operation and model.
Status codes
| HTTP | Details |
|---|---|
| 200 | List the vector stores attached to a project. |
| 401 | Authentication credentials are missing or invalid. |
| 403 | The principal is not allowed to perform this request. |
| 404 | No such resource is visible to this principal. |
| 429 | A quota or rate limit was exceeded. |
| 500 | An internal error occurred. |
Detach a vector store from a project
/api/v1/tenancy/projects/{project_id}/data-sources/{vector_store_id}https://api.mahvashai.irParameters
The table shows the accepted inputs for this endpoint. Examples use placeholders and illustrate a safe integration pattern.
| Name | Location | Type | Required | Support | Details |
|---|---|---|---|---|---|
project_id | Path | string | Required | Mahvash extension | Project UUID. |
vector_store_id | Path | string | Required | Mahvash extension | Vector store UUID. |
X-Request-ID | Header | string | Optional | Mahvash extension | Client-supplied correlation ID. Echoed on every response; replaced when absent or malformed. |
X-Mahvash-Project | Header | string | Optional | Mahvash extension | Project slug or ID within the caller's organization. Narrows the request principal; it can never widen it. |
Request
curl -X DELETE 'https://api.mahvashai.ir/api/v1/tenancy/projects/<project_id>/data-sources/<vector_store_id>' \
-H "Authorization: Bearer $MAHVASH_USER_JWT"Response
This endpoint returns no JSON body or delivers binary content.
Status codes
| HTTP | Details |
|---|---|
| 204 | Detach a vector store from a project. |
| 401 | Authentication credentials are missing or invalid. |
| 403 | The principal is not allowed to perform this request. |
| 404 | No such resource is visible to this principal. |
| 429 | A quota or rate limit was exceeded. |
| 500 | An internal error occurred. |