CD

ContentDrips

API Docs

v1.0.0

ContentDrips API

Generate stunning social media graphics and carousels programmatically

Base URL: https://generate.contentdrips.com

Setup & Installation

Get started with the ContentDrips API in just a few steps.

1

Sign up for a ContentDrips Account

Visit ContentDrips to create your account. You'll need this to access templates and the API.

Go to ContentDrips
2

Create or Select a Template

Design your template using the ContentDrips editor or select one from the Template Gallery. Templates are the blueprints for your graphics.

Make sure to add editable layers (text, images) that you'll update via the API. Note down your Template ID for later.

3

Get Your API Key

Navigate to your API Management dashboard to retrieve your API key. This key is required for all API requests.

Go to API Management

Your API key will look like:

cd_live_abc123xyz789_1234567890abcdef
4

Store Your API Key Securely

Keep your API key secret. Add it to your environment variables:

# .env.local
CONTENTDRIPS_API_KEY=cd_live_your_key_here

⚠️ Never commit API keys to version control. Use environment variables instead.

5

Make Your First API Request

Test the API with a simple request to generate your first graphic:

javascript
const apiKey = process.env.CONTENTDRIPS_API_KEY;
const templateId = 'YOUR_TEMPLATE_ID';

const response = await fetch("https://generate.contentdrips.com/render", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": `Bearer ${apiKey}`
  },
  body: JSON.stringify({
    template_id: templateId,
    output: "png",
    content_update: [
      {
        type: "textbox",
        label: "title",
        value: "Your First Generated Graphic!",
        fontSize: "48",
        fontColor: "#2C3E50"
      }
    ]
  })
})

const data = await response.json();
console.log("Job ID:", data.job_id);

Setup Tutorial Video

Watch this complete setup guide to get started:

Getting Started

The ContentDrips API provides asynchronous image and PDF generation from templates. The workflow is simple:

1

Submit Job

Submit your template with content updates

2

Get Job ID

Receive a unique job ID for tracking

3

Poll Status

Check status until processing completes

4

Download Result

Retrieve your generated files

Authentication

All endpoints require Bearer token authentication in the Authorization header.

EXAMPLE HEADER

Authorization: Bearer YOUR_API_KEY_HERE

Content-Type: All requests must include application/json

Endpoints

MethodEndpointDescription
POST/renderSubmit single graphic job
POST/render?tool=carousel-makerSubmit carousel job
GET/job/:jobId/statusCheck job status
GET/job/:jobId/resultGet completed result
GET/queue/statsGet queue statistics

Single Graphics API

Generate individual graphics from templates with dynamic content updates.

1. Submit Job

POST /render

202 Accepted

Submit your graphic request with template ID and content updates.

Request Example:

javascript
const response = await fetch("https://generate.contentdrips.com/render", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_TOKEN_HERE"
  },
  body: JSON.stringify({
    template_id: "123456",
    output: "png",
    content_update: [
      {
        type: "textbox",
        label: "quote",
        value: "Your inspiring quote goes here",
        fontSize: "48",
        fontColor: "#333333",
        textboxMaxHeight: 300
      },
      {
        type: "image",
        label: "background",
        value: "https://example.com/image.jpg",
        opacity: 0.8
      }
    ]
  })
})

const data = await response.json()

Success Response:

json
{
  "job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "queued",
  "message": "Job has been queued for processing",
  "check_status_url": "/job/a1b2c3d4-e5f6-7890-abcd-ef1234567890/status"
}

Text Content Parameters

PropertyTypeRequiredDescription
typeStringYesMust be "textbox"
labelStringYesMatches template meta_labels
valueStringYesText content
fontSizeString/NumberNoFont size in pixels
fontColorStringNoColor (CSS format)
textboxMaxHeightString/NumberNoMax height or "auto"

2. Check Job Status

GET /job/:jobId/status

COMPLETED

{
  "job_id": "...",
  "status": "completed",
  "completedAt": "2024-01-15..."
}

FAILED

{
  "job_id": "...",
  "status": "failed",
  "error": "Template not found"
}

3. Get Job Result

GET /job/:jobId/result

Returns the generated PNG file (for single graphic) or PDF file URL:

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

Returns array of file urls when carousel is in PNG format:

{
  "date": "2024-01-15T10:35:00.000Z",
  "type": "normal",
  "export_url": ["https://bucket.s3.amazonaws.com/.../image1.png", "https://bucket.s3.amazonaws.com/.../image2.png","https://bucket.s3.amazonaws.com/.../image3.png"]
}

Response Codes

202

Accepted

Job queued successfully

400

Bad Request

Validation error in request

401

Unauthorized

Invalid or missing token

404

Not Found

Job or template not found

500

Server Error

Internal server error

Error Handling

All errors follow a consistent format:

{
  "error": "Error Type",
  "message": "Detailed error description"
}

Template Not Found

Ensure template_id exists and belongs to your account

Invalid Content Labels

Content update labels must match template meta_labels exactly

Rate Limited

Check queue stats and retry after a brief delay

Best Practices

Polling Recommendations

Poll status every 5 seconds and set a maximum timeout of 5 minutes to avoid excessive API calls

Template Labels

Content update labels must exactly match your template's meta_labels. Mismatches will result in a 400 error

Output Formats: PNG vs PDF

PNG Output

Raster format, best for social media and web. Smaller file sizes, easy to share. Use for Instagram, Twitter, LinkedIn posts. Returns as export_url array with individual frame URLs.

PDF Output

Vector format, best for presentations, printing, and documents. Maintains quality at any size. Use for slide decks, printable materials, archival. Returns as export_url with a single PDF file.

How to Specify Output Format

In your API request, set the "output" parameter:

For PNG: "output": "png"

For PDF: "output": "pdf"

Error Handling

Always check response status codes and store job IDs for debugging and reference

Image URLs

Use publicly accessible image URLs. Ensure images are properly formatted and not behind authentication