Skip to content
← Documentation

API Reference

One consistent API for Instagram and Facebook publishing today, with the same interface designed for future platform coverage. Base URL: https://api.apionics.com

Authentication

All endpoints require a Bearer token in the Authorization header. Generate API keys in your workspace settings.

Authorization: Bearer apionics_live_...

For mutating requests, send an Idempotency-Key header so retries do not create duplicate publish jobs.

Platform availability

PlatformStatusNotes
InstagramLivePublishing, scheduling, connected accounts
FacebookLivePublishing, scheduling, connected accounts
LinkedInComing soonPlanned platform rollout
TikTokComing soonPlanned platform rollout
YouTubeComing soonPlanned platform rollout
WhatsAppComing soonPlanned platform rollout
Google BusinessComing soonPlanned platform rollout

Endpoints

POST/v1/publish

Queue content for one or more connected Instagram or Facebook accounts.

Request body

{
  "content": "string (required)",
  "platforms": ["instagram", "facebook"],
  "accounts": ["acc_123"],
  "schedule": "2026-06-01T09:00:00Z | "now"",
  "media": ["media_456"]
}

Response

{
  "id": "post_789",
  "status": "queued",
  "scheduled_at": "2026-06-01T09:00:00Z",
  "platforms": ["instagram", "facebook"],
  "tasks": [
    { "account_id": "acc_123", "platform": "instagram", "status": "queued" }
  ]
}
GET/v1/posts

List all posts in the workspace with status, schedule, and platform breakdown.

Response

{
  "posts": [
    {
      "id": "post_789",
      "content": "Hello from Apionics",
      "status": "published",
      "platforms": ["instagram", "facebook"],
      "created_at": "2026-05-31T10:00:00Z"
    }
  ],
  "total": 42
}
GET/v1/posts/{post_id}

Get detailed status of a single post, including per-account task results.

Response

{
  "id": "post_789",
  "content": "Hello from Apionics",
  "status": "published",
  "tasks": [
    { "account_id": "acc_123", "platform": "instagram", "status": "published", "published_at": "2026-05-31T10:00:05Z" }
  ]
}
DELETE/v1/posts/{post_id}

Cancel a scheduled post. Cannot delete already-published content.

Response

{ "success": true }
GET/v1/accounts

List connected social accounts with platform, status, and token health.

Response

{
  "accounts": [
    {
      "id": "acc_123",
      "platform": "instagram",
      "username": "apionics",
      "status": "active",
      "token_expires_at": "2026-08-01T00:00:00Z"
    }
  ]
}
POST/v1/webhooks

Register a webhook endpoint for post status and approval events.

Request body

{
  "url": "https://your-app.com/webhooks/apionics",
  "events": ["publish.completed", "publish.failed", "approval.requested"],
  "secret": "whsec_..."
}

Response

{
  "id": "wh_123",
  "url": "https://your-app.com/webhooks/apionics",
  "active": true
}

Webhooks

Apionics sends signed webhook events when platform tasks complete, fail, or require approval. Treat webhooks as the source of truth for asynchronous publishing state.

EventDescription
publish.completedA publish task completed successfully for a platform/account pair.
publish.failedA publish task failed after platform validation or retry handling.
approval.requestedA post requires workspace approval before it can be published.

Errors

Error responses use a stable envelope. Retry transient failures with the same Idempotency-Key; do not retry validation or authorization errors without changing the request.

CodeNameDescription
400Bad RequestInvalid request body or missing required field.
401UnauthorizedAPI key missing, invalid, or expired.
403ForbiddenAPI key lacks required scope for this endpoint.
404Not FoundPost, account, or webhook does not exist in this workspace.
409ConflictDuplicate request or conflicting state (e.g. post already published).
429Rate LimitedToo many requests. Retry after the seconds specified in Retry-After header.
500Internal ErrorPlatform API error or transient failure. Retry with exponential backoff.

Error examples

401

Missing or invalid API key

{
  "error": {
    "code": "unauthorized",
    "message": "API key missing, invalid, or expired."
  }
}
409

Duplicate idempotency key

{
  "error": {
    "code": "idempotency_conflict",
    "message": "This Idempotency-Key was already used with a different request body."
  }
}
422

Validation error

{
  "error": {
    "code": "validation_error",
    "message": "accounts must contain at least one connected account id.",
    "field": "accounts"
  }
}
429

Rate limited

{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests. Retry after 30 seconds."
  }
}
500

Transient platform failure

{
  "error": {
    "code": "platform_error",
    "message": "The platform API returned a transient error. Retry with the same Idempotency-Key."
  }
}