Get Execution History
Sprint 3
Get execution history for a prompt.
Endpoint
GET /api/v1/prompts/{prompt_id}/executions
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <access_token> |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt_id | integer | Yes | Prompt ID |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number (default: 1, min: 1) |
page_size | integer | No | Items per page (default: 20, min: 1, max: 100) |
status | string | No | Filter by status |
Response
Success (200)
{
"success": true,
"data": {
"prompt_id": 1,
"items": [
{
"id": 1,
"status": "completed",
"started_at": "2024-12-01T10:00:00Z",
"completed_at": "2024-12-01T10:00:10Z",
"total_duration_ms": 10000,
"rows_returned": 5,
"user_id": 5,
"user_name": "John Doe"
}
],
"pagination": {
"page": 1,
"page_size": 20,
"total_items": 15,
"total_pages": 1
}
},
"message": "Execution history retrieved 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
- Pagination support
- Filter by status
- Execution duration tracking
- User information
- Organization-scoped access control
Example
curl -X GET "https://api.rivergen.com/api/v1/prompts/1/executions?page=1&page_size=20&status=completed" \
-H "Authorization: Bearer <access_token>"
Related Endpoints
- Get Prompt - Get prompt details
- Get Execution Status - Get specific execution status