Skip to content

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

  1. 01Attach a vector store to a project
  2. 02List the vector stores attached to a project
  3. 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

POST/api/v1/tenancy/projects/{project_id}/data-sources
Production base URLhttps://api.mahvashai.ir
AuthenticationUser access JWT
ResponseMahvash product envelope
Content typeapplication/json

Parameters

The table shows the accepted inputs for this endpoint. Examples use placeholders and illustrate a safe integration pattern.

NameLocationTypeRequiredSupportDetails
project_idPathstringRequiredMahvash extensionProject UUID.
X-Request-IDHeaderstringOptionalMahvash extensionClient-supplied correlation ID. Echoed on every response; replaced when absent or malformed.
X-Mahvash-ProjectHeaderstringOptionalMahvash extensionProject slug or ID within the caller's organization. Narrows the request principal; it can never widen it.
positionBodyintegerOptionalMahvash extensionOptional ordering position.
vector_store_idBodystringRequiredMahvash extensionOwned 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

HTTPDetails
201Attach a vector store to a project.
400The request is not valid.
401Authentication credentials are missing or invalid.
403The principal is not allowed to perform this request.
404No such resource is visible to this principal.
409The requested transition conflicts with durable resource state.
429A quota or rate limit was exceeded.
500An internal error occurred.

List the vector stores attached to a project

GET/api/v1/tenancy/projects/{project_id}/data-sources
Production base URLhttps://api.mahvashai.ir
AuthenticationUser access JWT
ResponseMahvash product envelope

Parameters

The table shows the accepted inputs for this endpoint. Examples use placeholders and illustrate a safe integration pattern.

NameLocationTypeRequiredSupportDetails
project_idPathstringRequiredMahvash extensionProject UUID.
X-Request-IDHeaderstringOptionalMahvash extensionClient-supplied correlation ID. Echoed on every response; replaced when absent or malformed.
X-Mahvash-ProjectHeaderstringOptionalMahvash extensionProject 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

HTTPDetails
200List the vector stores attached to a project.
401Authentication credentials are missing or invalid.
403The principal is not allowed to perform this request.
404No such resource is visible to this principal.
429A quota or rate limit was exceeded.
500An internal error occurred.

Detach a vector store from a project

DELETE/api/v1/tenancy/projects/{project_id}/data-sources/{vector_store_id}
Production base URLhttps://api.mahvashai.ir
AuthenticationUser access JWT
ResponseMahvash product envelope

Parameters

The table shows the accepted inputs for this endpoint. Examples use placeholders and illustrate a safe integration pattern.

NameLocationTypeRequiredSupportDetails
project_idPathstringRequiredMahvash extensionProject UUID.
vector_store_idPathstringRequiredMahvash extensionVector store UUID.
X-Request-IDHeaderstringOptionalMahvash extensionClient-supplied correlation ID. Echoed on every response; replaced when absent or malformed.
X-Mahvash-ProjectHeaderstringOptionalMahvash extensionProject 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

HTTPDetails
204Detach a vector store from a project.
401Authentication credentials are missing or invalid.
403The principal is not allowed to perform this request.
404No such resource is visible to this principal.
429A quota or rate limit was exceeded.
500An internal error occurred.