Update Prompt
Sprint 3
Update an existing prompt. All fields are optional - only provided fields will be updated.
Endpoint
PATCH /api/v1/prompts/{prompt_id}
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <access_token> |
Content-Type | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt_id | integer | Yes | Prompt ID |
Request Body
All fields are optional. Only provided fields will be updated.
{
"name": "Updated Sales Report",
"tags": ["sales", "updated"],
"metadata": {
"category": "reports"
}
}
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Prompt name |
tags | array[string] | No | Tags for categorization |
metadata | object | No | Additional metadata |
Response
Success (200)
{
"success": true,
"data": {
"id": 1,
"name": "Updated Sales Report",
"tags": ["sales", "updated"],
"metadata": {
"category": "reports"
},
"updated_at": "2024-12-01T11:00:00Z"
},
"message": "Prompt updated successfully"
}
Error Codes
| Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Invalid or missing authentication token |
| 404 | NOT_FOUND | Prompt not found |
| 500 | INTERNAL_SERVER_ERROR | Internal server error |
Features
- Partial updates (only provided fields are updated)
- Organization-scoped access control
- Updates
updated_atautomatically
Example
curl -X PATCH "https://api.rivergen.com/api/v1/prompts/1" \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Sales Report",
"tags": ["sales", "updated"]
}'
Related Endpoints
- Get Prompt - Get current prompt details
- Execute Prompt - Execute prompt