Skip to content

API reference

Reusable assets

Mahvash assets are reusable project-scoped files. Upload once and pass the asset UUID in supported asset_ids requests; they are not public or cross-project files.

File inputs & retrieval ↗ · Build document Q&A ↗

How it fits together

  1. 01Upload one reusable Mahvash file
  2. 02List owned Mahvash files
  3. 03Download an asset through a signed URL

Select an action to see its complete inputs, request, response, and status codes.

Upload one reusable Mahvash file

POST/api/v1/chat/assets/upload
Production base URLhttps://api.mahvashai.ir
AuthenticationProject API key or user JWT
ResponseMahvash product envelope
Content typemultipart/form-data

Parameters

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

NameLocationTypeRequiredSupportDetails
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.
fileFormstring (binary)RequiredMahvash extensionFile contents.

Request

curl -X POST 'https://api.mahvashai.ir/api/v1/chat/assets/upload' \
  -H "Authorization: Bearer $MAHVASH_API_KEY" \
  -F 'file=@./your-file'

Response

{
  "status": 0,
  "data": "<value>"
}

Illustrative response shape; actual fields depend on the operation and model.

Status codes

HTTPDetails
201Upload one reusable Mahvash file.
400The request is not valid.
401Authentication credentials are missing or invalid.
403The principal is not allowed to perform this request.
429A quota or rate limit was exceeded.
500An internal error occurred.
503A dependency is temporarily unavailable.

List owned Mahvash files

GET/api/v1/chat/assets
Production base URLhttps://api.mahvashai.ir
AuthenticationProject API key or user JWT
ResponseMahvash product envelope

Parameters

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

NameLocationTypeRequiredSupportDetails
typeQuerystringOptionalMahvash extensionFilter by asset kind.
sourceQuerystringOptionalMahvash extensionFilter by origin: UPLOAD, REMOTE, or GENERATED.
orderingQuerystringOptionalMahvash extensioncreated_at or -created_at.
pageQueryintegerOptionalMahvash extensionOne-based result page.
searchQuerystringOptionalMahvash extensionCase-insensitive substring of the file name.
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/chat/assets' \
  -H "Authorization: Bearer $MAHVASH_API_KEY"

Response

{
  "status": 0,
  "data": "<value>"
}

Illustrative response shape; actual fields depend on the operation and model.

Status codes

HTTPDetails
200List owned Mahvash files.
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.
429A quota or rate limit was exceeded.
500An internal error occurred.

Download an asset through a signed URL

GET/api/v1/chat/assets/{asset_id}/content
Production base URLhttps://api.mahvashai.ir
AuthenticationProject API key or user JWT
ResponseMahvash product envelope

Parameters

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

NameLocationTypeRequiredSupportDetails
asset_idPathstringRequiredMahvash extensionAsset UUID.
tokenQuerystringRequiredMahvash extensionSigned, expiring delivery capability.
X-Request-IDHeaderstringOptionalMahvash extensionClient-supplied correlation ID. Echoed on every response; replaced when absent or malformed.

Request

curl -X GET 'https://api.mahvashai.ir/api/v1/chat/assets/<asset_id>/content?token=<token>' \
  -H "Authorization: Bearer $MAHVASH_API_KEY"

Response

This endpoint returns no JSON body or delivers binary content.

Status codes

HTTPDetails
200Download an asset through a signed URL.
404No such resource is visible to this principal.
429A quota or rate limit was exceeded.
500An internal error occurred.
503A dependency is temporarily unavailable.

Delete one owned Mahvash file

DELETE/api/v1/chat/assets/{asset_id}
Production base URLhttps://api.mahvashai.ir
AuthenticationProject API key or user JWT
ResponseMahvash product envelope

Parameters

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

NameLocationTypeRequiredSupportDetails
asset_idPathstringRequiredMahvash extensionAsset 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/chat/assets/<asset_id>' \
  -H "Authorization: Bearer $MAHVASH_API_KEY"

Response

This endpoint returns no JSON body or delivers binary content.

Status codes

HTTPDetails
204Delete one owned Mahvash file.
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.