My Generations API – POST /api/my-generations
Retrieves a paginated list of AI-generated artifacts (docs, tests, diagrams, etc.) created by the authenticated user. Supports optional filtering by generation type and custom page sizes.
🔒 Authentication
Requests must include a valid API token in the Authorization header.
Unauthenticated requests return a 401 Unauthorized response .
📝 Request Parameters
All parameters are sent in a JSON body.
| Field | Type | Required | Description |
|---|---|---|---|
per_page |
integer | No | Number of items per page (1–100). Defaults to 15. |
page |
integer | No | Page number (≥1). Defaults to 1. |
| type | string | No | Filter by generation type. Allowed values:
documentationtestsoptimizerconverterswaggerapidocscommentdiagramsgit_documentationgit_readmegitfulltree_documentationgitreleasenotesgit_codebasechanges_summary. |
📦 Response Structure
Successful responses use HTTP 200 OK and follow resource-collection format:
data: array of generation objectslinks: pagination URLs (first,last,prev,next)meta: pagination details (currentpage,lastpage,per_page,total,from,to) .
Generation Object
Each item in data is represented by Generation Object:
| Field | Type | Description |
|---|---|---|
id |
integer | Internal generation ID. |
filename |
string | Name of the file generated. |
source |
string | Original source code submitted. |
generation_type |
integer | Enum value for type (e.g. 1 = Documentation). |
created_at |
timestamp | ISO-8601 timestamp when generation occurred. |
generated_markdown |
string | Raw Markdown output from AI. |
generated_html |
string | HTML rendered version of the Markdown. . |
🚨 Error Responses
| Status | Condition | Body |
|---|---|---|
| 401 | Missing or invalid token | { "message": "Unauthenticated." } |
| 422 | Validation failed | { "message": "The given data was invalid.", "errors": { "type": ["The selected type is invalid."] } } |
⚡ Example
{
"title": "Fetch My Generations",
"description": "Returns the authenticated user\u2019s previous generations, 10 per page, filtered to documentation only.",
"method": "POST",
"baseUrl": "https://app.docuwriter.ai",
"endpoint": "/api/my-generations",
"headers": [
{
"key": "Authorization",
"value": "Bearer <token>",
"required": true
},
{
"key": "Content-Type",
"value": "application/json",
"required": true
}
],
"queryParams": [],
"pathParams": [],
"bodyType": "json",
"requestBody": "{\n \"per_page\": 10,\n \"page\": 1,\n \"type\": \"documentation\"\n}",
"formData": [],
"rawBody": "",
"responses": {
"200": {
"description": "A paginated list of generations.",
"body": "{\n \"data\": [\n {\n \"id\": 42,\n \"filename\": \"MyClass.php\",\n \"source\": \"<?php class MyClass {}\",\n \"generation_type\": 1,\n \"created_at\": \"2025-09-17T12:34:56Z\",\n \"generated_markdown\": \"# MyClass overview...\",\n \"generated_html\": \"<h1>MyClass overview...</h1>\"\n }\n ],\n \"links\": {\n \"first\": \"...\",\n \"last\": \"...\",\n \"prev\": null,\n \"next\": \"...\"\n },\n \"meta\": {\n \"current_page\": 1,\n \"last_page\": 3,\n \"per_page\": 10,\n \"total\": 25,\n \"from\": 1,\n \"to\": 10\n }\n}"
},
"401": {
"description": "Authentication required.",
"body": "{\n \"message\": \"Unauthenticated.\"\n}"
},
"422": {
"description": "Invalid parameters.",
"body": "{\n \"message\": \"The given data was invalid.\",\n \"errors\": {\n \"type\": [\"The selected type is invalid.\"]\n }\n}"
}
}
}
Updated