Developer API Documentation

Manage your Repostra brand programmatically. Create social accounts, configure posting schedules, manage content, and handle approvals via a REST API.

Base URL: https://repostra.app/api/v1

Authentication

All API requests require a valid API key passed in the X-API-Key header. Generate your API key from the Integrations page in your Repostra dashboard.

Each API key is scoped to a single brand. All resources returned are filtered to that brand.

curl https://repostra.app/api/v1/social-accounts \
  -H "X-API-Key: your_api_key_here" \
  -H "Accept: application/json"

Keep your API key secret. Do not expose it in client-side code. If you suspect your key has been compromised, rotate it immediately from the Integrations page.

Error Handling

The API uses standard HTTP status codes:

Code Meaning
200Success
201Created
401Unauthorized — missing or invalid API key
404Resource not found
409Conflict — e.g. deleting an account with schedules
422Validation error
429Rate limited

Error responses include an error key and a human-readable message:

{
  "error": "unauthorized",
  "message": "Invalid API key"
}

Rate Limiting

The API allows 60 requests per minute per API key. If you exceed this limit, you will receive a 429 response. Retry after the number of seconds indicated in the Retry-After header.

Social Accounts

Manage the social media accounts connected to your brand.

List accounts

GET /api/v1/social-accounts

Response:

{
  "data": [
    {
      "id": 1,
      "platform": "website",
      "account_name": "My Blog",
      "account_identifier": null,
      "posting_method": "webhook",
      "webhook_url": "https://example.com/webhook/blog",
      "is_active": true,
      "created_at": "2026-01-15T10:30:00+00:00",
      "updated_at": "2026-01-15T10:30:00+00:00"
    }
  ]
}

Create account

POST /api/v1/social-accounts
Field Type Required Description
platformstringYeswebsite, facebook, twitter, instagram, linkedin, tiktok, youtube
account_namestringNoDisplay name for the account
account_identifierstringNoExternal identifier (e.g. username, page ID)
posting_methodstringNomanual, wordpress, webhook, auto, zapier
webhook_urlstringNoWebhook endpoint URL
wordpress_api_keystringNoAPI key for WordPress plugin
signing_secretstringNoHMAC signing secret for webhooks
is_activebooleanNoDefaults to true

Get account

GET /api/v1/social-accounts/{id}

Update account

PUT /api/v1/social-accounts/{id}

Accepts the same fields as create (all optional). Only provided fields are updated.

Delete account

DELETE /api/v1/social-accounts/{id}

Returns 409 if the account has posting schedules. Remove the schedules first.

Posting Schedules

Configure when and how content is posted to each account.

List schedules

GET /api/v1/posting-schedules

Response:

{
  "data": [
    {
      "id": 1,
      "account_id": 1,
      "account": {
        "id": 1,
        "platform": "website",
        "account_name": "My Blog"
      },
      "platform": "website",
      "day_of_week": "monday",
      "time": "09:00",
      "content_type": null,
      "blog_column_index": 1,
      "is_active": true,
      "created_at": "2026-01-15T10:30:00+00:00",
      "updated_at": "2026-01-15T10:30:00+00:00"
    }
  ]
}

Create schedule

POST /api/v1/posting-schedules
Field Type Required Description
account_idintegerYesSocial account ID (must belong to your brand)
platformstringYesSame values as social accounts
day_of_weekstringYesmonday through sunday
timestringYesTime in HH:MM format (24-hour)
content_typestringNotext, image, video, evergreen (for social platforms)
blog_column_indexintegerNoColumn index for website/blog schedules (1+)
is_activebooleanNoDefaults to true

Update schedule

PUT /api/v1/posting-schedules/{id}

Accepts day_of_week, time, content_type, blog_column_index, and is_active.

Delete schedule

DELETE /api/v1/posting-schedules/{id}

Content

Manage blog content — create topics, review AI-generated drafts, update, approve, and publish.

List content

GET /api/v1/content

Query parameters:

Param Description
statusFilter by status: planned, generating, draft, scheduled, published, failed
per_pageItems per page (default 25)

Response:

{
  "data": [
    {
      "id": 42,
      "title": "10 Tips for Better SEO",
      "slug": "10-tips-for-better-seo",
      "description": "A comprehensive guide...",
      "keyword": "seo tips",
      "status": "draft",
      "posting_schedule_id": 1,
      "scheduled_for": "2026-04-07T09:00:00+00:00",
      "approved_at": null,
      "published_at": null,
      "published_url": null,
      "ai_generated_at": "2026-04-01T08:00:00+00:00",
      "created_at": "2026-04-01T07:00:00+00:00",
      "updated_at": "2026-04-01T08:00:00+00:00"
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 3,
    "per_page": 25,
    "total": 72
  }
}

Get content

GET /api/v1/content/{id}

Returns the full content object including the content body (EditorJS JSON).

Create content

POST /api/v1/content
Field Type Required Description
titlestringYesBlog post title / topic
descriptionstringNoTopic brief / description for AI generation
keywordstringNoSEO target keyword
posting_schedule_idintegerNoLink to a posting schedule
scheduled_fordatetimeNoISO 8601 date for scheduled publishing

Creates content with status planned. AI content generation will be triggered automatically based on your schedule.

Update content

PUT /api/v1/content/{id}

Accepts title, description, keyword, content (EditorJS JSON string), and scheduled_for. Cannot update published content.

Delete content

DELETE /api/v1/content/{id}

Approve content

POST /api/v1/content/{id}/approve

Approves the content for publishing. If a WordPress or webhook account is configured, the system will attempt to publish immediately and return the published_url. Otherwise, the content enters the draft state and will be published on schedule.

Approvals

View and act on pending approvals for both blog content and social posts.

List pending approvals

GET /api/v1/approvals

Response:

{
  "data": {
    "pending_blog": [
      {
        "type": "blog_content",
        "id": 42,
        "title": "10 Tips for Better SEO",
        "status": "generating",
        "scheduled_for": "2026-04-07T09:00:00+00:00",
        "ai_generated_at": "2026-04-01T08:00:00+00:00",
        "created_at": "2026-04-01T07:00:00+00:00"
      }
    ],
    "pending_social": [
      {
        "type": "social_post",
        "id": 105,
        "topic": "SEO tips for small businesses",
        "content": null,
        "platform": "linkedin",
        "content_type": "text",
        "status": "pending_approval",
        "blog_content_id": 42,
        "scheduled_for": "2026-04-08T14:00:00+00:00",
        "created_at": "2026-04-01T08:30:00+00:00"
      }
    ]
  },
  "meta": {
    "pending_blog_count": 1,
    "pending_social_count": 1
  }
}

Approve blog content

POST /api/v1/approvals/blog/{id}/approve
Field Type Required Description
titlestringNoOptionally update the title before approving

Approve social post topic

POST /api/v1/approvals/social/{id}/approve-topic
Field Type Required Description
topicstringYesThe approved topic text (can be modified before approving)

Approving a topic triggers AI content generation for the social post.

Approve social post content

POST /api/v1/approvals/social/{id}/approve-content
Field Type Required Description
contentstringYesThe approved content text (can be edited before approving)

If the post is in manual_posting status, approving marks it as published. Otherwise it enters the ready state for automatic publishing.

Example: Full Workflow

Here is a typical workflow using the API:

# 1. Create a social account
curl -X POST https://repostra.app/api/v1/social-accounts \
  -H "X-API-Key: your_key" \
  -H "Content-Type: application/json" \
  -d '{"platform": "website", "account_name": "My Blog", "posting_method": "webhook", "webhook_url": "https://example.com/webhook/blog"}'

# 2. Create a posting schedule
curl -X POST https://repostra.app/api/v1/posting-schedules \
  -H "X-API-Key: your_key" \
  -H "Content-Type: application/json" \
  -d '{"account_id": 1, "platform": "website", "day_of_week": "monday", "time": "09:00", "blog_column_index": 1}'

# 3. Create content (topic)
curl -X POST https://repostra.app/api/v1/content \
  -H "X-API-Key: your_key" \
  -H "Content-Type: application/json" \
  -d '{"title": "10 SEO Tips", "description": "Practical tips for improving search rankings", "posting_schedule_id": 1, "scheduled_for": "2026-04-07T09:00:00Z"}'

# 4. Check pending approvals
curl https://repostra.app/api/v1/approvals \
  -H "X-API-Key: your_key"

# 5. Approve blog content (triggers publish)
curl -X POST https://repostra.app/api/v1/content/42/approve \
  -H "X-API-Key: your_key"

# 6. Approve social post topic
curl -X POST https://repostra.app/api/v1/approvals/social/105/approve-topic \
  -H "X-API-Key: your_key" \
  -H "Content-Type: application/json" \
  -d '{"topic": "SEO tips for small businesses"}'

# 7. Approve social post content
curl -X POST https://repostra.app/api/v1/approvals/social/105/approve-content \
  -H "X-API-Key: your_key" \
  -H "Content-Type: application/json" \
  -d '{"content": "Here are 10 SEO tips that actually work..."}'

Need help?

If you have questions about the API, check our other integration guides: Webhook, WordPress, Zapier.