Contentdrips API Documentation

Base URL

  https://generate.contentdrips.com

Authentication

All endpoints (except /queue/stats) require Bearer token authentication.

Headers:
Authorization: Bearer {your_token}
Content-Type: application/json

Endpoints Overview

Method Endpoint Type Description
POST /render Async Submit job to queue for processing
GET /job/:jobId/status Async Check job processing status
GET /job/:jobId/result Async Get completed job result
GET /queue/stats Info Get queue statistics
POST /generate Sync Original synchronous processing

1. `POST /render` (Async Processing)

Request Example

Submit a job to the processing queue for asynchronous handling.

  POST /render
Authorization: Bearer {token}
Content-Type: application/json
{
  "template_id": "123",
  "output": "png",
  "tool": "carousel-maker",
  "branding": {
    "name": "John Doe",
    "handle": "@johndoe",
    "bio": "Software Developer",
    "website_url": "https://johndoe.com",
    "avatar_image_url": "https://example.com/avatar.jpg"
  },
  "content_update": [
    { "type": "textbox", "label": "title", "value": "New Title Text" },
    { "type": "image", "label": "main_image", "value": "https://example.com/image.jpg" }
  ],
  "carousel": [
    {
      "content_fields": [
        { "type": "textbox", "label": "slide_title", "value": "Slide 1 Title" }
      ]
    }
  ]
}

Response Examples

Success Response (202 Accepted)

{
 "job_id": "5844c4b4-dd6d-4b60-8d0f-e3818043fb11",
 "status": "queued",
 "message": "Job has been queued for processing",
 "estimated_time": "2-5 minutes",
 "check_status_url": "/job/5844c4b4-dd6d-4b60-8d0f-e3818043fb11/status"
}

400 Bad Request

{
 "error": "Validation error",
 "message": "template_id is required"
}

401 Unauthorized

{
 "error": "Unauthorized",
 "message": "Invalid or missing Bearer token"
}

500 Internal Server Error

{
 "error": "Failed to queue job",
 "message": "Redis connection failed"
}

2. `GET /job/:jobId/status`

Request Example

Check the current status of a queued job

  GET /job/a1b2c3d4-e5f6-7890-abcd-ef1234567890/status

Response Examples

Queued

{
 "job_id": "5844c4b4-dd6d-4b60-8d0f-e3818043fb11",
 "status": "queued",
 "updated_at": "2024-01-15T10:30:00.000Z",
 "startedAt": null,
 "progress": "Job is waiting in queue"
}

Processing

{
 "job_id": "5844c4b4-dd6d-4b60-8d0f-e3818043fb11",
 "status": "queued",
 "updated_at": "2024-01-15T10:30:00.000Z",
 "startedAt": null,
 "progress": "Job is waiting in queue"
}

Completed

{
 "job_id": "5844c4b4-dd6d-4b60-8d0f-e3818043fb11",
 "status": "completed",
 "updated_at": "2024-01-15T10:35:00.000Z",
 "startedAt": "2024-01-15T10:32:00.000Z",
 "progress": "Job completed successfully"
}

Failed

 

{
 "job_id": "5844c4b4-dd6d-4b60-8d0f-e3818043fb11",
 "status": "failed",
 "updated_at": "2024-01-15T10:33:00.000Z",
 "startedAt": "2024-01-15T10:32:00.000Z",
 "progress": "Error: Template not found",
 "error_details": "Invalid template ID provided"
}

404 Not Found

{
  "error": "Job not found",
  "job_id": "invalid-job-id"
}

3. `GET /job/:jobId/result`

Request Example

Retrieve the result of a completed job.
  GET /job/a1b2c3d4-e5f6-7890-abcd-ef1234567890/result

Response Examples

Job Result When Pending 

{
 "job_id": "5844c4b4-dd6d-4b60-8d0f-e3818043fb11",
 "status": "processing",
 "message": "Job not yet completed",
 "check_again_in": "30 seconds"
}

Carousel PNG Array 

{
 "date": "2024-01-15T10:35:00.000Z",
 "type": "carousel",
 "export_url": [
   "https://your-bucket.s3.amazonaws.com/.../frame-0.png",
   "https://your-bucket.s3.amazonaws.com/.../frame-1.png",
   "https://your-bucket.s3.amazonaws.com/.../frame-2.png"
 ]
}

Carousel PDF Array

{
 "date": "2024-01-15T10:35:00.000Z",
 "type": "carousel",
 "export_url": "https://your-bucket.s3.amazonaws.com/.../carousel.pdf"
}

Single Image

{
  "date": "2024-01-15T10:35:00.000Z",
  "type": "normal",
  "export_url": "https://your-bucket.s3.amazonaws.com/.../template.png"
}

Job Failed

{
 "job_id": "5844c4b4-dd6d-4b60-8d0f-e3818043fb11",
 "status": "failed",
 "message": "Template not found or processing error occurred",
 "error_details": "Invalid template ID provided"
}

4. `POST /generate` (Synchronous)

Request Example

Direct synchronous image/PDF generation.

  POST /generate
Authorization: Bearer {token}
Content-Type: application/json

{
  "template_id": "123",
  "output": "png"
}

5. `GET /queue/stats`

Request Examples

Get real-time statistics on the job queue.

  GET /queue/stats

Request parameters

Parameter Type Description
template_id string Required. Unique identifier for the template
output string Optional. "png" (default) or "pdf"
tool string Optional. "carousel-maker" or blank
branding object Optional. Branding information (name, handle, etc)
content_update array Optional. Content updates (textbox/image)
carousel array Optional. Carousel slides, each with content_fields

Error Handling

All errors follow this format:

{
  "error": "Error Type",
  "message": "Detailed error description",
  "type": "ErrorClassName" // optional
}
Code Description
200 Success (synchronous)
202 Accepted (async job queued)
400 Bad Request (validation error)
401 Unauthorized (invalid token)
404 Not Found (job/template)
408 Request Timeout
500 Internal Server Error

Rate Limiting & Concurrency

  • Asynchronous `/render` endpoint uses job queue; no direct client-side rate limit.
  • Multiple workers can process jobs in parallel.

File Upload & Storage

  • Generated images/PDFs are uploaded to AWS S3.
  • URLs are returned in responses.
  • Files are organized by profile ID: `server/{profile_id}/uploads/`.
  • File names include random prefixes for uniqueness.

Example Usage Workflows

Async Processing

1. Submit Job

curl -X POST https://generate.contentdrips.com/render \
  -H "Authorization: Bearer your-token" \
  -H "Content-Type: application/json" \
  -d '{"template_id": "123", "output": "png"}'

2. Check Status

curl https://generate.contentdrips.com/job/{job_id}/status

3. Get Result

curl https://generate.contentdrips.com/job/{job_id}/result

Sync Processing

1. Direct Processing

curl -X POST https://generate.contentdrips.com/generate \
  -H "Authorization: Bearer your-token" \
  -H "Content-Type: application/json" \
  -d '{"template_id": "123", "output": "png"}'

Monitoring & Debugging

  • Check queue status with `GET /queue/stats`
  • Memory usage is logged on the server console
  • Job statuses tracked in Redis
  • Failed jobs include error details for debugging

Frequently Asked Questions

In AWS S3, organized by profile ID.

Poll /job/:jobId/status until you get "completed".

Error details are returned in responses. See “Error Handling” above.