Skip to content

This document describes the RESTful API for TendSocial AI backend services.

Table of Contents ​


Overview ​

The TendSocial API uses standard HTTP verbs and JSON for data exchange. All protected endpoints require a valid JWT in the Authorization header (Bearer <token>).

Company & Brand ​

Get Company Details ​

GET /api/company

Response: 200 OK

json
{
  "id": "uuid",
  "name": "Acme Corp",
  "defaultSocialPlatforms": ["linkedin", "twitter"]
}

Get Brand Profile ​

GET /api/brand-profile

Returns the singleton brand profile for the tenant.

Response: 200 OK

json
{
  "companyName": "Acme Corp",
  "websiteUrl": "https://acme.com",
  "tagline": "Innovation for all",
  "missionStatement": "To empower...",
  "keyThemes": "AI, Marketing, Growth",
  "colors": { ... },
  "typography": { ... }
}

Update Brand Profile ​

PUT /api/brand-profile

Request Body:

json
{
  "companyName": "Acme Corp",
  "websiteUrl": "https://acme.com",
  "tagline": "New Tagline",
  "brandVoice": "Professional",
  "colors": { "primary": "#3B82F6" }
}

Analyze Brand from Website ​

POST /api/analyze-brand

Trigger AI analysis of a website to auto-populate brand details.

Request Body:

json
{
  "url": "https://acme.com",
  "mode": "company" // 'company' or 'inspiration'
}

Chat with Brand Consultant ​

POST /api/chat-brand

Request Body:

json
{
  "profile": { ... }, // Current profile state
  "field": "missionStatement",
  "message": "Help me refine this",
  "history": []
}

Campaigns ​

List Campaigns ​

GET /api/campaigns

Query Parameters:

  • status: DRAFT, ACTIVE, PAUSED, COMPLETED
  • type: ONE_TIME, RECURRING, EVERGREEN
  • limit, offset, search

Create Campaign ​

POST /api/campaigns

Request Body:

json
{
  "name": "Q1 Launch",
  "brief": "Launch of new product X",
  "goal": "Increase awareness",
  "type": "ONE_TIME",
  "startsAt": "2025-01-01T00:00:00Z"
}

Get Campaign Content ​

GET /api/campaigns/:id/content

Returns an aggregated list of social posts, blogs, and video scripts associated with the campaign.

Response:

json
[
  { "id": "uuid", "type": "social", "platform": "linkedin", "content": "..." },
  { "id": "uuid", "type": "blog", "title": "..." },
  { "id": "uuid", "type": "script", "title": "..." }
]

Planning Chat ​

POST /api/campaigns/chat

Chat with AI to plan a campaign strategy.

Generate Plan ​

POST /api/campaigns/:id/generate-plan

Extract structured plan from chat history and update the campaign.

Generate Content ​

POST /api/campaigns/:id/generate-content

Generate social posts, blog ideas, and video scripts based on the campaign plan.


Blogs ​

List Blog Posts ​

GET /api/blog/posts

Query Parameters: status, limit, offset

Create Blog Post ​

POST /api/blog/posts

Generate Full Blog Post ​

POST /api/generate-blog-post

Generate full markdown content for a blog idea.

Request Body:

json
{
  "idea": { "title": "...", "description": "..." },
  "profile": { ... },
  "frontmatterSettings": { ... }
}

Refine Blog Content ​

POST /api/refine-blog-content

Request Body:

json
{
  "content": "Markdown content...",
  "instruction": "expand", // 'expand', 'shorten', 'fix_grammar', etc.
  "profile": { ... }
}

Publish Blog Post ​

POST /api/blog/posts/:id/publish

Publish to configured destinations (WordPress, HubSpot, etc.).


Social Posts ​

List Social Posts ​

GET /api/social-posts

Query Parameters:

  • campaignId (optional)

Generate Social Posts (from Blog) ​

POST /api/generate-posts

Generate multi-platform social posts from a blog URL or content.

Request Body:

json
{
  "blogUrl": "https://example.com/post",
  "selectedProfiles": ["linkedin-company", "twitter-personal"],
  "includeCta": true
}

AI Assist for Post ​

POST /api/ai/assist-post

Helper for writing/fixing single posts.

Request Body:

json
{
  "action": "generate", // 'generate', 'expand', 'condense', 'fix', 'hashtags'
  "content": "Draft text...",
  "platforms": ["twitter"]
}

Schedule Post ​

POST /api/social-posts/schedule

Schedule a single post.

Batch Schedule ​

POST /api/social-posts/batch-schedule

Schedule same content across multiple platforms.


Social Connectivity ​

Get Auth URL ​

POST /api/social/:platform/auth/url

Get OAuth URL to connect a platform (linkedin, twitter, facebook, etc.).

Disconnect ​

DELETE /api/social/:platform/disconnect

List Accounts ​

GET /api/social/accounts

Publish to Platform ​

POST /api/social/:platform/publish

Direct publish to a platform.

Post Analytics ​

GET /api/social/:platform/analytics/:postId

Get live metrics (views, likes, etc.) for a specific post.

Dashboard Analytics ​

GET /api/social/analytics/dashboard

Aggregated performance metrics across all connected accounts.


AI Generation ​

Generate Image ​

POST /api/generate-image

Generate an image using DALL-E (or configured provider).

Request Body:

json
{
  "prompt": "A futuristic city...",
  "platform": "linkedin"
}

Generate Video Script ​

POST /api/generate-video-script

  • Body: { idea: VideoIdea, profile: BrandProfile, campaignId?: string }
  • Returns: { script: string, videoScriptId: string }
  • Description: Generates a video script based on idea and optional campaign context.

Request Body:

json
{
  "idea": { "title": "...", "format": "Short" },
  "profile": { ... }
}

Generate Content Calendar ​

POST /api/generate-content-calendar

Generate a list of campaign ideas for a time period.


List Pages ​

GET /api/link-in-bio

Get Page ​

GET /api/link-in-bio/:slug

Create/Update Page ​

POST /api/link-in-bioPUT /api/link-in-bio/:slug

GET /api/link-in-bio/:slug/linksPOST /api/link-in-bio/:slug/linksPUT /api/link-in-bio/:slug/links/:idPOST /api/link-in-bio/:slug/links/reorder


Entitlements ​

Get Usage Summary ​

GET /api/entitlements

Returns current usage counts and limits for AI features.

Check Action ​

GET /api/entitlements/check/:action

Check if a specific action (e.g., WEBSITE_ANALYSIS, CHAT_MESSAGE) is allowed.

TendSocial Documentation