Acclaira REST API v1 is Live · Full CORS Enabled for External Frontends
REST API v1

Acclaira API Reference

The Acclaira API provides a powerful, multi-modal backend for generating viral social media posts, 350-word SEO WordPress articles, and Urdu voice-over video scripts. It is organized around standard RESTful HTTP principles, accepts JSON-encoded request bodies, returns standard JSON responses, and supports Bearer & X-API-Key token authentication with full Cross-Origin Resource Sharing (CORS).

Base URL

https://acclaira.com/api/v1

CORS Support

Enabled (Any Origin / Domain)

Response Format

application/json

Authentication

Authenticate all API requests by including your secret API key in the request headers. You can pass the key either as a standard Authorization: Bearer <API_KEY> header or via the x-api-key header.

Header Authentication Format

Authorization: Bearer acc_live_YOUR_API_KEY

// Or alternatively:

x-api-key: acc_live_YOUR_API_KEY

Keep your API keys confidential

Your API key grants full access to consume credits and trigger content publishing on your account. Never commit it to public GitHub repositories.

CORS & Custom Frontends

All Acclaira /api/* and /api/v1/* endpoints have automatic Cross-Origin Resource Sharing (CORS) preflight support enabled.

You can call this API directly from any client-side JavaScript environment (React, Next.js, Vue, Svelte, Vite, Angular, React Native, Flutter, Electron, or mobile apps) without needing a proxy server.

Credit Rates & HTTP Status Codes

Credit Cost Per Call

  • Module 1 · Social Post1 Credit
  • Module 2 · SEO News Article2 Credits
  • Module 3 · Urdu Video Script3 Credits
  • Publishing (WP / Meta)0 Credits (Free)
  • RSS News Fetch & Account APIs0 Credits (Free)

Standard HTTP Status Codes

  • 200 OKSuccessful execution
  • 201 CreatedResource created
  • 400 Bad RequestMissing required parameters
  • 401 UnauthorizedMissing or invalid API key
  • 402 Payment RequiredInsufficient credit balance
  • 500 / 502 ErrorUpstream provider or network error
POST/api/v1/generate/caption

Generate Social Media Post (Module 1)

1 Credit

Generates an engaging, viral social media caption crafted in Roman Urdu and English mix, 8-10 trending hashtags, and SEO keywords for any news headline.

Request Parameters (JSON Body)

FieldTypeRequirementDescription
headlinestringrequiredThe breaking news headline or update text.
languagestringoptional · default: "mixed"Optionally specify "mixed" (Roman Urdu + English), "urdu" (Nastaliq), or "english".
curl -X POST "https://acclaira.com/api/v1/generate/caption" \
  -H "Authorization: Bearer acc_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"headline": "Pakistan IT exports reach record high in 2026", "language": "mixed"}'
Response 200 OKapplication/json
{
  "success": true,
  "headline": "Pakistan IT exports reach record high in 2026",
  "caption": "🚀 Big News for Pakistan! 🇵🇰 Humaray IT sector ne 2026 mein history create kardi hai! Pakistan ki IT exports ab tak ke record high par pohanch chuki hain...\n\nFreelancers aur tech startups ki continuous mehnat rang le aayi hai. Kya aapko lagta hai ke Pakistan region ka next biggest tech hub ban sakta hai? Apni raye comments mein zaroor share karein! 👇",
  "hashtags": "#PakistanTech #ITExports #DigitalPakistan #TechNews #FreelancersPakistan",
  "keywords": "Pakistan IT exports, record IT exports 2026, Pakistan tech industry, Digital Pakistan",
  "cost": 1,
  "remaining": 14
}
POST/api/v1/generate/article

Generate SEO News Article (Module 2)

2 Credits

Generates a full 350-word SEO news article in publication-ready English with headline, readable paragraphs, bulleted takeaways, and a 150-character search meta description.

Request Parameters (JSON Body)

FieldTypeRequirementDescription
topicstringrequiredThe news topic, headline, or summary source to write about.
curl -X POST "https://acclaira.com/api/v1/generate/article" \
  -H "Authorization: Bearer acc_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"topic": "State Bank of Pakistan announces new monetary policy"}'
Response 200 OKapplication/json
{
  "success": true,
  "topic": "State Bank of Pakistan announces new monetary policy",
  "title": "State Bank of Pakistan Unveils Landmark Monetary Policy Update",
  "article": "In a pivotal economic briefing today, the State Bank of Pakistan announced key updates to its monetary policy framework, aiming to balance inflation targets while fostering sustained industrial growth...\n\nKey takeaways:\n• Strategic policy adjustment to stimulate economic momentum\n• Enhanced credit accessibility for small and medium enterprises\n• Stability measures targeted for foreign exchange markets",
  "full_text": "State Bank of Pakistan Unveils Landmark Monetary Policy Update...",
  "meta": "State Bank of Pakistan announces key updates to its monetary policy framework to foster industrial growth and maintain currency stability.",
  "cost": 2,
  "remaining": 12
}
POST/api/v1/generate/urdu-script

Generate Urdu Video Script (Module 3)

3 Credits

Generates a viral 60-second video script in fluent Urdu (Nastaliq script) tailored for short-form video (TikTok, Instagram Reels, YouTube Shorts).

Request Parameters (JSON Body)

FieldTypeRequirementDescription
topicstringrequiredThe news topic or headline to create an Urdu script for.
curl -X POST "https://acclaira.com/api/v1/generate/urdu-script" \
  -H "Authorization: Bearer acc_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"topic": "Petrol prices reduced tonight across Pakistan"}'
Response 200 OKapplication/json
{
  "success": true,
  "topic": "Petrol prices reduced tonight across Pakistan",
  "script": "ناظرین، اس وقت کی بڑی خبر... حکومت نے پیٹرولیم مصنوعات کی قیمتوں میں بڑی کمی کا اعلان کر دیا ہے۔ عوام کے لیے ریلیف کا یہ فیصلہ آج رات بارہ بجے سے نافذ العمل ہوگا۔ آپ کی اس بارے میں کیا رائے ہے؟ کمنٹس میں بتائیے۔",
  "language": "ur",
  "cost": 3,
  "remaining": 9
}
POST/api/v1/publish/wordpress

Publish Article to WordPress

0 Credits (Free)

Publishes an article directly to your connected WordPress site using WordPress REST API and Application Passwords. Optionally uploads and sets a feature image.

Request Parameters (JSON Body)

FieldTypeRequirementDescription
titlestringrequiredTitle of the WordPress post.
contentstringrequiredHTML or plain text body of the article.
imageBase64stringoptional Base64 encoded PNG or JPEG image data for featured media.
statusstringoptional · default: "publish""publish" or "draft".
curl -X POST "https://acclaira.com/api/v1/publish/wordpress" \
  -H "Authorization: Bearer acc_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title": "Economic Growth Accelerates in Q3", "content": "Full story details...", "status": "publish"}'
Response 200 OKapplication/json
{
  "success": true,
  "post_id": 1420,
  "link": "https://yoursite.com/economic-growth-accelerates-in-q3/",
  "status": "publish",
  "title": "Economic Growth Accelerates in Q3"
}
POST/api/v1/publish/meta

Publish Post to Facebook / Instagram

0 Credits (Free)

Publishes an image post and caption directly to your connected Meta Facebook Page and creates an optional automated first comment.

Request Parameters (JSON Body)

FieldTypeRequirementDescription
captionstringrequiredThe post copy and hashtags.
imageBase64stringrequiredBase64 encoded PNG or JPEG image data.
firstCommentstringoptional Optional URL or comment to automatically post as the first comment.
curl -X POST "https://acclaira.com/api/v1/publish/meta" \
  -H "Authorization: Bearer acc_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"caption": "Breaking news update 🔥 #Breaking", "imageBase64": "data:image/png;base64,iVBORw..."}'
Response 200 OKapplication/json
{
  "success": true,
  "post_id": "104928374928172_93849182739182",
  "url": "https://facebook.com/104928374928172_93849182739182"
}
GET/api/v1/sources/fetch

Fetch Live News Headlines

0 Credits (Free)

Fetches and parses real-time news headlines from your configured RSS sources or an ad-hoc feed URL.

Request Parameters (JSON Body)

FieldTypeRequirementDescription
urlstringoptional Optional specific RSS feed URL to parse on the fly.
curl -X GET "https://acclaira.com/api/v1/sources/fetch" \
  -H "Authorization: Bearer acc_live_YOUR_API_KEY" \
  -H "Accept: application/json"
Response 200 OKapplication/json
{
  "count": 3,
  "items": [
    {
      "title": "Pakistan tech exports increase by 28% in latest quarterly review",
      "link": "https://example-news.com/tech-exports-surge",
      "pubDate": "Mon, 17 Aug 2026 21:00:00 GMT",
      "description": "The Ministry of IT reports steady acceleration across freelance and corporate sectors.",
      "sourceUrl": "https://example-news.com/feed.xml"
    }
  ]
}
GET/api/v1/me

Account Profile & Quota Balance

0 Credits (Free)

Returns authenticated account info, remaining credit balance, active subscription plan, per-module credit costs, and channel connection statuses.

curl -X GET "https://acclaira.com/api/v1/me" \
  -H "Authorization: Bearer acc_live_YOUR_API_KEY" \
  -H "Accept: application/json"
Response 200 OKapplication/json
{
  "user": {
    "id": 1,
    "email": "user@domain.com",
    "name": "Alex",
    "role": "user",
    "plan": "pro",
    "credits": 250,
    "status": "active"
  },
  "costs": {
    "caption_post": 1,
    "article": 2,
    "urdu_video": 3
  },
  "integrations": {
    "wordpress": {
      "configured": true,
      "live": true,
      "url": "https://yoursite.com"
    },
    "meta": {
      "configured": true,
      "live": true,
      "page_id": "104928374928172"
    },
    "ai_engine": {
      "configured": true
    }
  },
  "auth": {
    "type": "api_key",
    "key_name": "My Custom Frontend"
  }
}
GET/api/v1/health

API Health Check

0 Credits (Free)

Returns service availability, active API version, server timestamp, and an index of all available endpoints.

curl -X GET "https://acclaira.com/api/v1/health"
Response 200 OKapplication/json
{
  "status": "healthy",
  "version": "v1",
  "service": "Acclaira REST API",
  "timestamp": "2026-08-18T00:00:00.000Z",
  "endpoints": {
    "auth_check": "GET /api/v1/me",
    "generate_caption": "POST /api/v1/generate/caption",
    "generate_article": "POST /api/v1/generate/article",
    "generate_urdu_script": "POST /api/v1/generate/urdu-script",
    "publish_wordpress": "POST /api/v1/publish/wordpress",
    "publish_meta": "POST /api/v1/publish/meta",
    "sources_fetch": "GET /api/v1/sources/fetch",
    "docs": "GET /api/v1/docs"
  }
}