Skip to content

API reference

Project prompts

Keep reusable prompts with the project that owns them. Manage versions and archive prompts that should no longer be selected.

How it fits together

  1. 01Create a project prompt
  2. 02Retrieve a project prompt
  3. 03Update and version a project prompt

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

Create a project prompt

POST/api/v1/tenancy/projects/{project_id}/prompts
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.
bodyBodystringRequiredMahvash extensionBounded prompt body.
descriptionBodystringOptionalMahvash extensionPrompt description.
nameBodystringRequiredMahvash extensionPrompt name.

Request

curl -X POST 'https://api.mahvashai.ir/api/v1/tenancy/projects/<project_id>/prompts' \
  -H "Authorization: Bearer $MAHVASH_USER_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "body": "Cite every source.",
  "name": "Research rules"
}'

Response

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

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

Status codes

HTTPDetails
201Create a project prompt.
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.

Retrieve a project prompt

GET/api/v1/tenancy/projects/{project_id}/prompts/{prompt_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.
prompt_idPathstringRequiredMahvash extensionPrompt 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>/prompts/<prompt_id>' \
  -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
200Retrieve a project prompt.
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.

Update and version a project prompt

PATCH/api/v1/tenancy/projects/{project_id}/prompts/{prompt_id}
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.
prompt_idPathstringRequiredMahvash extensionPrompt 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.
bodyBodystringOptionalMahvash extensionNew prompt body.
descriptionBodystringOptionalMahvash extensionNew prompt description.
nameBodystringOptionalMahvash extensionNew prompt name.

Request

curl -X PATCH 'https://api.mahvashai.ir/api/v1/tenancy/projects/<project_id>/prompts/<prompt_id>' \
  -H "Authorization: Bearer $MAHVASH_USER_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "body": "Cite every source."
}'

Response

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

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

Status codes

HTTPDetails
200Update and version a project prompt.
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.

Archive a project prompt

DELETE/api/v1/tenancy/projects/{project_id}/prompts/{prompt_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.
prompt_idPathstringRequiredMahvash extensionPrompt 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>/prompts/<prompt_id>' \
  -H "Authorization: Bearer $MAHVASH_USER_JWT"

Response

This endpoint returns no JSON body or delivers binary content.

Status codes

HTTPDetails
204Archive a project prompt.
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.

List project prompts

GET/api/v1/tenancy/projects/{project_id}/prompts
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>/prompts' \
  -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 project prompts.
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.