Skip to main content
A
Docs

API Reference

Complete API reference for the Anar Present AI presentation generator.

Base URL

http://localhost:8011/api/v1

All endpoints require Bearer token authentication in the Authorization header.

Presentations

Generate Presentation

POST
/api/v1/presentations/generate

Generate a complete presentation from a natural language prompt.

Request Body:

{
  "prompt": "Government AI adoption strategy for 2025",
  "template_id": "tmpl-a1b2c3",
  "slide_count": 10,
  "language": "en"
}
FieldTypeRequiredDescription
promptstringYesPresentation description (1-5,000 characters)
template_idstringNoTemplate ID for branding
slide_countintegerNoNumber of slides (1-30, default: 8)
languagestringNoen or ar (default: en)

Response:

{
  "pres_id": "pres-a1b2c3",
  "title": "Government AI Adoption Strategy 2025",
  "prompt": "Government AI adoption strategy for 2025",
  "status": "completed",
  "slide_count": 10,
  "template_id": "tmpl-a1b2c3",
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:05Z"
}

List Presentations

GET
/api/v1/presentations

Returns all presentations with their status and metadata.

Get Presentation

GET
/api/v1/presentations/{pres_id}

Returns full presentation details.

Delete Presentation

DELETE
/api/v1/presentations/{pres_id}

Permanently delete a presentation and its associated data.

Slide Editing

Edit Slide

POST
/api/v1/presentations/{pres_id}/slides/{slide_idx}/edit

Apply a natural language editing instruction to a specific slide. The slide_idx parameter is zero-indexed.

Request Body:

{
  "instruction": "Add a comparison table showing Q3 vs Q4 performance metrics"
}
FieldTypeRequiredDescription
instructionstringYesEditing instruction (1-2,000 characters)

Export

Export PPTX

POST
/api/v1/presentations/{pres_id}/export/pptx

Export the presentation as a PowerPoint file. Returns a binary PPTX file download.

Export PDF

POST
/api/v1/presentations/{pres_id}/export/pdf

Export the presentation as a PDF document. Returns a binary PDF file download.

Templates

Upload Template

POST
/api/v1/templates/upload

Upload a PPTX file as a reusable template. Accepts multipart/form-data.

Form Fields:

FieldTypeRequiredDescription
filebinaryYesPPTX template file
namestringYesTemplate name
descriptionstringNoTemplate description

Response:

{
  "template_id": "tmpl-a1b2c3",
  "name": "Ministry Branded Template",
  "description": "Official template with ministry branding",
  "created_at": "2024-01-15T10:30:00Z"
}

List Templates

GET
/api/v1/templates

Returns all available templates.

Comments

Create Comment

POST
/api/v1/presentations/{pres_id}/comments

Add a review comment to a specific slide.

Request Body:

{
  "slide_index": 3,
  "element_id": "",
  "text": "Please update the budget figures",
  "author": "Ahmed Al Mansoori"
}
FieldTypeRequiredDescription
slide_indexintegerYesZero-indexed slide number
element_idstringNoSpecific element on the slide
textstringYesComment text (1-2,000 characters)
authorstringNoComment author name

List Comments

GET
/api/v1/presentations/{pres_id}/comments

Returns all comments for a presentation, optionally filtered by slide.

Query Parameters:

ParameterTypeDescription
slide_indexintegerFilter comments to a specific slide

Health

Health Check

GET
/health

Returns service health status.

Metrics

GET
/metrics

Returns service metrics including uptime and request counts.