Glamzn / API Documentation
← Back to API Keys

API Reference

Base URL: https://glamzn.ai/api/glamzn

Authentication

All requests require an API key passed via the X-API-Key header.

// Example

curl -X GET https://glamzn.ai/api/glamzn/me \
  -H "X-API-Key: your_api_key"

Response Format

File conversion endpoints return a JSON object with a base64-encoded file field.

// Success

{
  "success": true,
  "filename": "document.docx",
  "mime_type": "application/...",
  "file": "UEsDBBQAAAAI..."
}

// Error

{
  "success": false,
  "error": "Monthly limit reached",
  "code": "LIMIT_REACHED",
  "usage": 10,
  "limit": 10
}

Error Codes

HTTP Code Description
200Success
202Accepted — async job started, poll the status URL
401UNAUTHORIZEDMissing or invalid API key
403NO_PLANNo active subscription
403ACTION_NOT_ALLOWEDAction not included in your plan
422VALIDATION_ERRORInvalid request parameters
422GENERATION_FAILEDGeneration or conversion failed
429LIMIT_REACHEDMonthly usage limit exceeded
500INTERNAL_ERRORInternal server error
Account
GET /api/glamzn/me

Returns the authenticated user profile and subscription info.

// Example

curl -X GET https://glamzn.ai/api/glamzn/me \
  -H "X-API-Key: your_api_key"
PDF Conversions
POST/api/glamzn/pdf/to-word

Convert a PDF file to Word (.docx) format.

ParameterTypeRequiredDescription
fileFile (PDF)RequiredThe PDF file to convert

// cURL

curl -X POST https://glamzn.ai/api/glamzn/pdf/to-word \
  -H "X-API-Key: your_api_key" \
  -F "file=@document.pdf"
POST/api/glamzn/pdf/to-excel

Convert a PDF file to Excel (.xlsx) format.

ParameterTypeRequiredDescription
fileFile (PDF)RequiredThe PDF file to convert
pagesstringOptionalPages to convert (e.g. "all", "1-3")

// cURL

curl -X POST https://glamzn.ai/api/glamzn/pdf/to-excel \
  -H "X-API-Key: your_api_key" \
  -F "file=@document.pdf" -F "pages=all"
POST/api/glamzn/pdf/to-image

Convert PDF pages to images (PNG, JPG, WebP).

ParameterTypeRequiredDescription
fileFile (PDF)RequiredThe PDF file
formatstringOptionalpng, jpg, webp (default: png)
dpiintegerOptionalResolution in DPI (default: 150)
pagesstringOptionalPages to convert (e.g. "1-3", "all")

// cURL

curl -X POST https://glamzn.ai/api/glamzn/pdf/to-image \
  -H "X-API-Key: your_api_key" \
  -F "file=@document.pdf" -F "format=png" -F "dpi=150"
POST/api/glamzn/pdf/to-powerpoint

Convert a PDF file to PowerPoint (.pptx) format.

ParameterTypeRequiredDescription
fileFile (PDF)RequiredThe PDF file to convert

// cURL

curl -X POST https://glamzn.ai/api/glamzn/pdf/to-powerpoint \
  -H "X-API-Key: your_api_key" -F "file=@document.pdf"
To PDF
POST/api/glamzn/word/to-pdf

Convert a Word document (.docx/.doc) to PDF.

ParameterTypeRequiredDescription
fileFile (DOCX/DOC)RequiredThe Word file to convert

// cURL

curl -X POST https://glamzn.ai/api/glamzn/word/to-pdf \
  -H "X-API-Key: your_api_key" -F "file=@document.docx"
POST/api/glamzn/excel/to-pdf

Convert an Excel spreadsheet (.xlsx/.xls) to PDF.

ParameterTypeRequiredDescription
fileFile (XLSX/XLS)RequiredThe Excel file to convert

// cURL

curl -X POST https://glamzn.ai/api/glamzn/excel/to-pdf \
  -H "X-API-Key: your_api_key" -F "file=@spreadsheet.xlsx"
POST/api/glamzn/image/to-pdf

Convert one or more images to a single PDF.

ParameterTypeRequiredDescription
files[]File[] (images)RequiredImage files to combine into PDF

// cURL

curl -X POST https://glamzn.ai/api/glamzn/image/to-pdf \
  -H "X-API-Key: your_api_key" \
  -F "files[]=@page1.png" -F "files[]=@page2.png"
PDF Manipulation
POST/api/glamzn/pdf/compress

Compress a PDF to reduce file size.

ParameterTypeRequiredDescription
fileFile (PDF)RequiredThe PDF file to compress
levelstringOptionallow, medium, high (default: medium)

// cURL

curl -X POST https://glamzn.ai/api/glamzn/pdf/compress \
  -H "X-API-Key: your_api_key" \
  -F "file=@document.pdf" -F "level=medium"
POST/api/glamzn/pdf/merge

Merge multiple PDF files into one.

ParameterTypeRequiredDescription
files[]File[] (PDF)RequiredPDF files to merge (in order)

// cURL

curl -X POST https://glamzn.ai/api/glamzn/pdf/merge \
  -H "X-API-Key: your_api_key" \
  -F "files[]=@doc1.pdf" -F "files[]=@doc2.pdf"
POST/api/glamzn/pdf/split

Split a PDF into multiple files.

ParameterTypeRequiredDescription
fileFile (PDF)RequiredThe PDF file to split
rangesstringOptionalPage ranges (e.g. "1-3,4-6")
single_pagesbooleanOptionalSplit into individual pages

// cURL

curl -X POST https://glamzn.ai/api/glamzn/pdf/split \
  -H "X-API-Key: your_api_key" \
  -F "file=@document.pdf" -F "ranges=1-3,4-6"
POST/api/glamzn/pdf/rotate

Rotate pages of a PDF.

ParameterTypeRequiredDescription
fileFile (PDF)RequiredThe PDF file
rotationintegerOptional90, 180, 270 (default: 90)
pagesstringOptionalPages to rotate (e.g. "1,3,5" or "all")
POST/api/glamzn/pdf/watermark

Add a text watermark to a PDF.

ParameterTypeRequiredDescription
fileFile (PDF)RequiredThe PDF file
textstringOptionalWatermark text (default: "CONFIDENTIAL")
opacityintegerOptional0–100 (default: 30)
positionstringOptionalcenter, top-left, top-right, bottom-left, bottom-right
rotationintegerOptionalRotation angle (default: -45)
font_sizeintegerOptionalFont size in pt (default: 48)
colorstringOptionalHex color (default: #000000)
POST/api/glamzn/pdf/protect

Password-protect a PDF.

ParameterTypeRequiredDescription
fileFile (PDF)RequiredThe PDF file
user_passwordstringRequiredPassword to open the document
owner_passwordstringOptionalOwner password for permissions
POST/api/glamzn/pdf/ocr

Run OCR on a scanned PDF to make it searchable.

ParameterTypeRequiredDescription
fileFile (PDF)RequiredThe scanned PDF file
languagestringOptionalOCR language(s) (e.g. "eng", "fra+eng")
POST/api/glamzn/pdf/add-page-numbers

Add page numbers to a PDF.

ParameterTypeRequiredDescription
fileFile (PDF)RequiredThe PDF file
positionstringOptionale.g. "bottom-center"
formatstringOptionale.g. "Page {current}/{total}"
font_sizeintegerOptionalFont size in pt
colorstringOptionalHex color
start_pageintegerOptionalFirst page to number
POST/api/glamzn/pdf/edit

Edit a PDF: add text, signatures, images, delete pages, rotate, or redact.

ParameterTypeRequiredDescription
fileFile (PDF)RequiredThe PDF file to edit
text_modificationsJSONOptionalArray of text additions
signaturesJSONOptionalArray of signatures to add
imagesJSONOptionalArray of images to add
deleted_pagesJSONOptionalArray of page indexes to delete
rotationsJSONOptionalArray of page rotations
redactionsJSONOptionalArray of redaction zones
AI Analyze
POST/api/glamzn/documents/upload

Response: 202 Accepted — async, poll /documents/{documentId}/status

Upload a PDF and automatically start AI analysis. Accepts files up to 32 MB.

ParameterTypeRequiredDescription
fileFile (PDF)RequiredPDF file to upload and analyze (max 32 MB)
document_typestringOptionalHint for analysis (e.g. "contract", "invoice", "report")

// 202 Accepted

{
  "success": true,
  "document_id": 123,
  "name": "contract.pdf",
  "size": 204800,
  "analysis_status": "pending",
  "status_url": "/api/glamzn/documents/123/status"
}

// 422 Errors

// PDF_LOCKED
{ "success": false, "error_code": "PDF_LOCKED" }

// PAGE_LIMIT_EXCEEDED
{
  "success": false,
  "error_code": "PAGE_LIMIT_EXCEEDED",
  "details": { "page_count": 250, "page_limit": 100 }
}
GET/api/glamzn/documents/{documentId}/status

Response: 200 OK

Poll the analysis status. When analysis_status is completed, the full analysis object is included.

analysis_statusMeaning
pendingQueued, not started yet
processingAnalysis in progress — keep polling
completedDone — analysis field contains full results
failedAnalysis failed — check error_message

// Processing

{
  "document_id": 123,
  "analysis_status": "processing",
  "progress_step": "Extracting text",
  "progress_step_detail": "Page 12 / 45",
  "total_pages": 45,
  "analysis": null
}

// Completed

{
  "document_id": 123,
  "analysis_status": "completed",
  "total_pages": 45,
  "analysis": {
    "summary": "...",
    "key_points": [...]
  }
}
GET/api/glamzn/documents/{documentId}/summary

Response: 200 OK — requires analysis_status = completed

Returns the AI-generated summary and suggested questions. Questions can be passed directly to the chat endpoint.

// 200 Success

{
  "document_id": 36,
  "summary": "Ce document est un contrat...",
  "suggested_questions": [
    "Quelles sont les obligations ?",
    "Quelle est la durée du contrat ?"
  ],
  "chat_url": "/api/glamzn/documents/36/chat"
}

// 422 Not Ready

{
  "success": false,
  "code": "ANALYSIS_NOT_READY",
  "analysis_status": "processing",
  "poll_url": "/api/glamzn/documents/36/status"
}
POST/api/glamzn/documents/{documentId}/chat

Response: 200 OK — synchronous, requires analysis_status = completed

Send a question to the AI about the analyzed PDF. Conversation history maintained per document — no session ID needed.

ParameterTypeRequiredDescription
messagestringRequiredYour question (1–2000 chars)
languagestringOptionalForce response language: fr or en

// 200 OK

{
  "success": true,
  "answer": "According to section 3...",
  "document_id": 36
}

// 422 Not Ready

{
  "success": false,
  "code": "ANALYSIS_NOT_READY",
  "analysis_status": "processing"
}
POST/api/glamzn/documents/{documentId}/generate

Response: 200 OK — starts async generation, poll /documents/content/{contentId}/status

Generate a structured document (book, report, or flashcard set) from an analyzed PDF.

ParameterTypeRequiredDescription
typestringRequiredbook | report | flashcard
titlestringRequiredTitle of the generated content (max 255 chars)
templatestringRequiredTemplate identifier to use
languagestringRequiredfr | en
audiencestringRequiredTarget audience description
custom_instructionsstringOptionalAdditional instructions for the AI (max 2000 chars)
flashcard_configobjectOptionalOnly for type=flashcard: card_count, difficulty_level, include_explanations, question_types, focus_topics
GET/api/glamzn/documents/content/{contentId}/status

Response: 200 OK

Poll the generation status. When status is completed, includes download_url (book/report) or flashcard_data JSON.

// In progress

{
  "content_id": 42,
  "status": "generating",
  "progress": 65,
  "current_step": "Writing section 3/5"
}

// Completed

{
  "content_id": 42,
  "status": "completed",
  "progress": 100,
  "download_url": "/api/glamzn/documents/content/42/download"
}
GET/api/glamzn/documents/content/{contentId}/download

Response: 200 OK

Get a temporary pre-signed S3 URL (valid 1 hour) to download a completed book or report. Not applicable for flashcards — use the /status endpoint instead.

// Response 200

{
  "success": true,
  "download_url": "https://s3.amazonaws.com/.../report_42.pdf?X-Amz-Expires=3600&...",
  "filename": "Executive_Summary.pdf",
  "expires_at": "2025-01-01T11:30:00Z"
}
POST/api/glamzn/documents/{documentId}/analyze

Response: 202 Accepted — async, poll /documents/{documentId}/status

Re-trigger AI analysis without re-uploading. Resets analysis_status to pending and clears the previous summary.

⚠ The previous summary and suggested questions are cleared immediately. The document file on S3 is not modified.

// Response 202

{
  "success": true,
  "document_id": 36,
  "analysis_status": "pending",
  "poll_url": "/api/glamzn/documents/36/status",
  "message": "Re-analysis started."
}
GET/api/glamzn/documents

Response: 200 OK

List all documents belonging to the authenticated user, ordered by most recent.

// Response

{
  "success": true,
  "count": 2,
  "documents": [{
    "id": 123,
    "name": "contract.pdf",
    "analysis_status": "completed",
    "created_at": "2025-01-01T10:00:00Z"
  }]
}
DELETE/api/glamzn/documents/{documentId}

Response: 200 OK

Permanently delete a document and its file from storage. This action is irreversible.

// Response

{ "success": true, "message": "Document deleted successfully" }
Studio
POST/api/glamzn/studio/text-to-image

Response: 200 OK — synchronous

Generate an image from a text prompt using FAL.ai.

ParameterTypeRequiredDescription
promptstringRequiredImage description (max 1000 chars)
stylestringRequiredcinematic, realistic, anime, 3d, abstract…
aspect_ratiostringRequired16:9, 9:16 or 1:1
modelstringOptionalFAL model ID
negative_promptstringOptionalElements to exclude (max 500 chars)
POST/api/glamzn/studio/text-to-video

Response: 200 OK — synchronous (may take several minutes)

Generate a short video from a text prompt.

ParameterTypeRequiredDescription
promptstringRequiredVideo description (max 500 chars)
stylestringRequiredcinematic, realistic, anime, 3d, abstract, vintage…
durationstringRequired5, 10 or 15 (seconds)
aspect_ratiostringRequired16:9, 9:16 or 1:1
qualitystringRequired720p or 1080p
negative_promptstringOptionalElements to avoid (max 500 chars)
image_0, image_1File (image)OptionalReference images (max 10 MB each)
POST/api/glamzn/studio/film-maker

Response: 202 Accepted — async, poll /studio/film-maker/status/{jobId}

Generate a cinematic film from a script or prompt.

ParameterTypeRequiredDescription
prompt / scriptstringRequiredFilm script or creative brief

// Response 202

{
  "success": true,
  "job_id": "vmax_abc123",
  "poll_url": "/api/glamzn/studio/film-maker/status/vmax_abc123",
  "status": "queued"
}
GET/api/glamzn/studio/film-maker/status/{jobId}

Response: 200 OK

// In progress

{ "status": "processing", "progress": 45 }

// Completed

{
  "status": "completed",
  "video_url": "https://s3.amazonaws.com/..."
}
POST/api/glamzn/studio/long-to-shorts

Response: 202 Accepted — async, poll /studio/long-to-shorts/status/{jobId}

Convert a long video (YouTube URL or direct upload) into short-form clips.

ParameterTypeRequiredDescription
video_urlstringOne ofYouTube, S3 or direct video URL
video_fileFile (mp4/mov)One ofVideo file upload (max 500 MB)
aspect_ratiostringOptional9:16, 1:1 or 16:9 (default: 9:16)
crop_strategystringOptionalfit, smart_crop or center (default: fit)
generate_subtitlesbooleanOptionalAdd auto-generated subtitles (default: true)
subtitle_languagestringOptionalfr or en (default: fr)
add_summary_textbooleanOptionalOverlay summary text (default: true)
add_part_numberingbooleanOptionalShow "Part X/Y" overlay (default: true)
GET/api/glamzn/studio/long-to-shorts/status/{jobId}

Response: 200 OK

// In progress

{
  "status": "processing", "progress": 60,
  "current_step": "Generating subtitles"
}

// Completed

{
  "status": "completed", "shorts_count": 4,
  "shorts": [{ "id": 1, "video_url": "...", "duration": 58 }]
}
POST/api/glamzn/studio/generate-thread

Response: 200 OK — synchronous

Generate a Twitter/X thread or LinkedIn post from a topic.

ParameterTypeRequiredDescription
platformstringRequiredtwitter or linkedin
topicstringRequiredSubject of the thread (10–1000 chars)
tonestringRequiredinformative, engaging, storytelling, educational, controversial, humorous, professional, inspirational
include_hookbooleanRequiredAdd a strong opening hook
include_ctabooleanRequiredAdd a call-to-action at the end
include_hashtagsbooleanRequiredAdd relevant hashtags
posts_countintegerOptionalNumber of tweets (1–5, Twitter only, default: 3)
use_web_searchbooleanOptionalEnrich with live web data (default: false)
POST/api/glamzn/studio/thumbnail-generator

Response: 200 OK — synchronous (30–60s typical)

Generate a high-impact thumbnail using FAL.ai. Optionally insert up to 2 face images.

ParameterTypeRequiredDescription
titlestringRequiredVideo or content title (max 100 chars)
descriptionstringRequiredVisual description of the thumbnail (max 300 chars)
stylestringRequiredyoutube, gaming, vlog, tutorial, podcast, news, cinematic, minimalist, retro, neon, comic, corporate
face_image_0File (image)OptionalFirst face reference photo (max 5 MB)
face_image_1File (image)OptionalSecond face reference photo (max 5 MB)

// Response

{
  "success": true,
  "url": "https://s3.amazonaws.com/.../thumbnail_42.png",
  "media_id": 87,
  "message": "Thumbnail generated successfully"
}