API Documentation

Programmatically transform content using the PrimePost API. Requires a Business plan and an API key.

Authentication

All API requests require a valid API key sent via the Authorization header using the Bearer scheme.

Header
Authorization: Bearer pp_live_your_key_here

Generate API keys from your Business Settings page. Keys are prefixed with pp_live_.

Base URL

URL
https://www.primepost.app/api/v1

POST /transform

Transform long-form content into multiple platform-optimized formats.

Request Body

ParameterTypeRequiredDescription
contentstringYesThe original content to transform (min 50 chars, max 10,000)
formatsstring[]YesArray of output format IDs (see Available Formats)
brand_voicebooleanNoIf true, applies your configured brand voice to the output

Response

JSON
{
  "results": [
    {
      "format": "twitter",
      "content": "1/ Your AI-generated Twitter thread...\n\n2/ Each tweet optimized..."
    },
    {
      "format": "linkedin",
      "content": "Your AI-generated LinkedIn post..."
    },
    {
      "format": "email",
      "content": "Subject: Your compelling subject line\n\nHi there,..."
    }
  ]
}

Available Formats

twitterX / Twitter

Thread with 5-8 tweets, hooks, and hashtags

linkedinLinkedIn

Professional post with hooks and engagement

emailEmail Newsletter

Newsletter segment with subject line and CTA

instagramInstagram

Caption with storytelling and hashtags

blog_summaryBlog Summary

TL;DR, key takeaways, and audience

youtubeYouTube

Video description with timestamps and tags

facebookFacebook

Conversational post with engagement hooks

Brand Voice

When brand_voice: true is set in your request, the API will load your active brand voice configuration and apply it to all generated content. Configure your brand voice in Business Settings.

Brand voice settings include tone, style, target audience, keywords to include/avoid, and custom instructions.

Rate Limits

LimitValue
Requests per key per day100
Max API keys per account5
Max content length10,000 characters

Rate limit counters reset daily at midnight UTC.

Error Handling

The API returns standard HTTP status codes with JSON error messages.

StatusMeaning
200Success
400Bad request (invalid body, missing fields)
401Invalid or missing API key
403Not on Business tier
429Rate limit exceeded (100/day per key)
500Internal server error
Error Response
{
  "error": "Rate limit exceeded. Maximum 100 requests per day per key."
}

Code Examples

cURL

bash
curl -X POST https://www.primepost.app/api/v1/transform \
  -H "Authorization: Bearer pp_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Your long-form content goes here...",
    "formats": ["twitter", "linkedin", "email"],
    "brand_voice": true
  }'

JavaScript (fetch)

javascript
const response = await fetch("https://www.primepost.app/api/v1/transform", {
  method: "POST",
  headers: {
    "Authorization": "Bearer pp_live_your_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    content: "Your long-form content goes here...",
    formats: ["twitter", "linkedin", "email"],
    brand_voice: true,
  }),
});

const data = await response.json();
// data.results = [{ format: "twitter", content: "..." }, ...]

Python (requests)

python
import requests

response = requests.post(
    "https://www.primepost.app/api/v1/transform",
    headers={
        "Authorization": "Bearer pp_live_your_key_here",
        "Content-Type": "application/json",
    },
    json={
        "content": "Your long-form content goes here...",
        "formats": ["twitter", "linkedin", "email"],
        "brand_voice": True,
    },
)

data = response.json()
# data["results"] = [{"format": "twitter", "content": "..."}, ...]