Documentation

API Reference

Last updated: March 5, 2026

Back to home

post2all API Documentation

Base URL: https://api.post2all.com/api/v1 Authentication: API key via x-api-key header


Authentication

All requests require an API key passed in the x-api-key header.

curl -H "x-api-key: amp_your_key_here" https://api.post2all.com/api/v1/accounts

API keys are created in Settings → API Keys within your workspace. Each key is scoped to a specific organization and user.


Endpoints

GET /api/v1/accounts

List connected social accounts for your organization.

Response

{
  "accounts": [
    {
      "id": "acc_123",
      "platform": "twitter",
      "platformAccountId": "123456",
      "username": "@post2all",
      "displayName": "post2all",
      "avatarUrl": "https://...",
      "status": "active",
      "supportedPostTypes": {
        "text": true,
        "image": true,
        "video": true
      },
      "createdAt": "2026-01-15T10:00:00.000Z"
    }
  ]
}

curl

curl -H "x-api-key: amp_xxx" https://api.post2all.com/api/v1/accounts

POST /api/v1/posts

Create and schedule/publish a post. Uses multipart/form-data to support inline media upload.

Form Fields

FieldTypeRequiredDescription
type"text" | "image" | "video"Post type
contentstring✅ for textPost text content
socialAccountIdsJSON array["acc_id1", "acc_id2"]
status"draft" | "scheduled"Default: "scheduled"
scheduledAtISO 8601 dateWhen to publish. Omit or use now for immediate
accountSettingsJSON objectPer-account overrides (see below)
mediaFile(s)For image/videoOne or more image/* or video/* files

Account Settings Schema

{
  "acc_id1": {
    "caption": "Custom caption for this account",
    "title": "Video title",
    "description": "Video description",
    "tags": ["tag1", "tag2"],
    "privacyStatus": "public",
    "categoryId": "22",
    "topicTag": "topic"
  }
}

Response (201)

{
  "post": {
    "id": "post_abc",
    "type": "text",
    "content": "Hello from API",
    "status": "scheduled",
    "scheduledAt": "2026-03-01T00:00:00.000Z",
    "createdAt": "2026-02-28T10:00:00.000Z",
    "mediaCount": 0,
    "accountCount": 2
  }
}

curl Examples

Text post (publish immediately):

curl -X POST -H "x-api-key: amp_xxx" \
  -F 'type=text' \
  -F 'content=Hello from the post2all API! 🚀' \
  -F 'socialAccountIds=["acc_id1","acc_id2"]' \
  https://api.post2all.com/api/v1/posts

Image post with media:

curl -X POST -H "x-api-key: amp_xxx" \
  -F 'type=image' \
  -F 'content=Check out this photo' \
  -F 'socialAccountIds=["acc_id1"]' \
  -F 'media=@./photo.jpg' \
  https://api.post2all.com/api/v1/posts

Video post with scheduled time:

curl -X POST -H "x-api-key: amp_xxx" \
  -F 'type=video' \
  -F 'content=New video!' \
  -F 'socialAccountIds=["acc_id1"]' \
  -F 'media=@./video.mp4' \
  -F 'scheduledAt=2026-03-01T12:00:00Z' \
  -F 'accountSettings={"acc_id1":{"title":"My Video","privacyStatus":"public"}}' \
  https://api.post2all.com/api/v1/posts

Multiple images:

curl -X POST -H "x-api-key: amp_xxx" \
  -F 'type=image' \
  -F 'content=Photo dump' \
  -F 'socialAccountIds=["acc_id1"]' \
  -F 'media=@./photo1.jpg' \
  -F 'media=@./photo2.jpg' \
  -F 'media=@./photo3.jpg' \
  https://api.post2all.com/api/v1/posts

Save as draft:

curl -X POST -H "x-api-key: amp_xxx" \
  -F 'type=text' \
  -F 'content=Work in progress' \
  -F 'socialAccountIds=["acc_id1"]' \
  -F 'status=draft' \
  https://api.post2all.com/api/v1/posts

GET /api/v1/posts

List posts for your organization with pagination.

Query Parameters

ParamTypeDefaultDescription
pagenumber1Page number
limitnumber20Items per page (max 100)
statusstringFilter by status: draft, scheduled, published, partially_failed, failed
typestringFilter by type: text, image, video

Response

{
  "posts": [
    {
      "id": "post_abc",
      "type": "text",
      "content": "Hello world",
      "status": "published",
      "scheduledAt": "2026-02-28T10:00:00.000Z",
      "publishedAt": "2026-02-28T10:00:05.000Z",
      "createdAt": "2026-02-28T09:00:00.000Z",
      "accounts": [
        {
          "id": "acc_id1",
          "platform": "twitter",
          "username": "@post2all",
          "displayName": "post2all",
          "status": "published",
          "platformPostUrl": "https://x.com/post2all/status/123",
          "error": null
        }
      ]
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "hasMore": false
  }
}

curl

curl -H "x-api-key: amp_xxx" \
  "https://api.post2all.com/api/v1/posts?status=published&limit=10"

GET /api/v1/posts/:id

Get detailed information about a specific post.

Response

{
  "post": {
    "id": "post_abc",
    "type": "image",
    "content": "Photo caption",
    "media": [
      { "type": "image", "path": "org/user/abc-photo.jpg" }
    ],
    "status": "published",
    "scheduledAt": "2026-02-28T10:00:00.000Z",
    "publishedAt": "2026-02-28T10:00:05.000Z",
    "createdAt": "2026-02-28T09:00:00.000Z",
    "updatedAt": "2026-02-28T10:00:05.000Z",
    "accounts": [
      {
        "id": "acc_id1",
        "platform": "twitter",
        "platformAccountId": "123456",
        "username": "@post2all",
        "displayName": "post2all",
        "avatarUrl": "https://...",
        "status": "published",
        "platformPostId": "123456789",
        "platformPostUrl": "https://x.com/post2all/status/123456789",
        "error": null,
        "publishedAt": "2026-02-28T10:00:05.000Z"
      }
    ]
  }
}

curl

curl -H "x-api-key: amp_xxx" https://api.post2all.com/api/v1/posts/post_abc

Typical Agent Workflow

  1. Get accountsGET /api/v1/accounts to discover connected platforms
  2. Create postPOST /api/v1/posts with content, media, and target account IDs
  3. Check statusGET /api/v1/posts/:id to monitor publish results per platform

Supported Platforms

PlatformTextImageVideo
Twitter / X
LinkedIn
YouTube
Instagram
Pinterest
Threads
Bluesky
Facebook

Error Codes

All errors return this shape:

{ "error": { "code": "ERROR_CODE", "message": "Human-readable message" } }
CodeHTTPDescription
INVALID_API_KEY401Missing or invalid API key
EXPIRED_API_KEY401API key has expired
RATE_LIMITED429Too many requests
FORBIDDEN403Key doesn't have org access
INVALID_REQUEST400Malformed body or missing required fields
INVALID_ACCOUNTS400One or more socialAccountIds don't belong to your org
UNSUPPORTED_MEDIA400File type not image/* or video/*
POST_NOT_FOUND404Post ID not found
INTERNAL_ERROR500Server error