Generations API – GET /api/generations

Retrieve a paginated list of your previous generations, with optional filtering by type or archived status. This endpoint helps users browse, search, and manage generated documentation, tests, diagrams, and other artifacts.

πŸ”’ Authentication

Include a valid Bearer token in the Authorization header to access user-scoped generations .

πŸ“¬ Endpoint

GET https://app.docuwriter.ai/api/generations

πŸ› οΈ Query Parameters

Use these optional parameters to filter and paginate results :

Parameter Type Description Required
type string Filter by generation type (e.g., documentation, tests) No
archived boolean Include archived generations (true or false) No
per_page integer Items per page (min 1, max 100; default 20) No
page integer Page number (default 1) No

🎯 Success Response

  • Status Code: 200 OK
  • Content Type: application/json
{
  "success": true,
  "data": [
    {
      "uuid": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
      "generated_by_user_email": "[email protected]",
      "filename": "TestClass.php",
      "generated": "## Class: TestClass\nThis class handles…",
      "created_at": "2025-09-18T12:34:56Z",
      "updated_at": "2025-09-18T12:34:56Z",
      "generation_type": "documentation",
      "tag": "main"
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 5,
    "per_page": 20,
    "total": 100
  }
}

Response Items

Field Type Description
uuid string Unique identifier of the generation
generatedbyuser_email string null
filename string Name of the file or descriptor for this generation
generated string The generated markdown content
created_at datetime ISO timestamp when the generation was created
updated_at datetime ISO timestamp of the last update
generation_type string Type of generation (e.g., documentation, tests, optimizer)
tag string Repository tag or identifier associated with the generation
meta.current_page integer Current page in the paginated result
meta.last_page integer Last available page
meta.per_page integer Number of items per page
meta.total integer Total number of generations

🚨 Error Responses

Status Condition Body Model
401 Missing/invalid token { "message": "Unauthenticated." }
422 Validation failed { "message": "The given data was invalid.", "errors": { "perpage": ["The perpage ..."] } }

πŸ”— Interactive API Example

{
    "title": "List Generations",
    "description": "Retrieve a paginated list of previous generations with optional filtering.",
    "method": "GET",
    "baseUrl": "https://app.docuwriter.ai",
    "endpoint": "/api/generations",
    "headers": [
        {
            "key": "Authorization",
            "value": "Bearer <token>",
            "required": true
        }
    ],
    "queryParams": [
        {
            "key": "type",
            "value": "Filter by generation type (e.g., documentation, tests)",
            "required": false
        },
        {
            "key": "archived",
            "value": "Include archived generations (true/false)",
            "required": false
        },
        {
            "key": "per_page",
            "value": "Number of items per page (1-100)",
            "required": false
        },
        {
            "key": "page",
            "value": "Page number for pagination",
            "required": false
        }
    ],
    "pathParams": [],
    "bodyType": "none",
    "requestBody": "",
    "formData": [],
    "rawBody": "",
    "responses": {
        "200": {
            "description": "Successful response with paginated generations list",
            "body": "{\n  \"success\": true,\n  \"data\": [\n    { ... }\n  ],\n  \"meta\": { ... }\n}"
        },
        "401": {
            "description": "Authentication failed",
            "body": "{\n  \"message\": \"Unauthenticated.\"\n}"
        },
        "422": {
            "description": "Validation error",
            "body": "{\n  \"message\": \"The given data was invalid.\",\n  \"errors\": { ... }\n}"
        }
    }
}