API Documentation

The Ampost REST API lets you publish, schedule, and manage social media content across 5 platforms from a single integration. All requests use Bearer token authentication and return clean JSON.

AI / LLM ready. This documentation is also available as a machine-readable /llm.txt file, designed for LLMs and AI agents that want to understand the Ampost API.

Overview

Ampost provides a unified social media API. Instead of integrating each platform individually, you connect to Ampost once and get access to instagram, facebook, linkedin, tiktok, threads through a single REST API.

Base URL

api.ampost.io

Protocol

HTTPS only

Content Type

application/json

Auth

Bearer token

Rate Limit

Tier-based

Quickstart

Make your first API call in under a minute:

Public REST and MCP traffic is hosted on https://api.ampost.io. The dashboard, OAuth callbacks, and billing/session flows stay on https://ampost.io. Public API paths on https://ampost.io still respond temporarily for backwards compatibility, but new integrations should use the API host.

1

Get your API key

Sign up at ampost.io, go to Dashboard → Settings → API Keys, and create a new key. Save the raw key — it is shown only once.

2

Connect a social account

Create a browser-assisted connection through POST /api/v1/accounts/connect or use the dashboard. Create a platform set to group your connections, then reference that platformSetId when creating posts. Use the Accounts endpoints if you need to inspect which active connections are inside a set.

3

Create a post

terminal
curl -X POST https://api.ampost.io/api/v1/posts \
  -H "Authorization: Bearer amp_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": {
      "text": "Hello from the Ampost API!",
      "media": [],
      "linkUrl": null,
      "platformOverrides": {}
    },
    "platforms": ["threads"],
    "scheduledFor": null,
    "platformSetId": "set_uuid"
  }'

Authentication

All API requests require a valid API key passed as a Bearer token in the Authorization header. API keys are created and managed through the Ampost dashboard. Dashboard-only management routes such as /api/keys, billing, reconnect, refresh, and disconnect do not accept Bearer API keys. New account connections can be initiated with a Bearer key through the hosted connect endpoints below; social consent still happens in the user's browser.

Key format

API keys use the prefix amp_live_ followed by a base64url-encoded random secret. The raw key is shown only once at creation time.

Any valid API key can access the public Ampost API and MCP endpoints that your plan allows. Route-level access is determined by whether an endpoint is part of the public API surface, not by key-level permissions. Ampost API keys are scope-free: the key identifies the owning user, and the endpoint decides whether Bearer-key access is allowed.

Posts

The Posts API is the core of Ampost. Create, retrieve, and manage social media posts across all connected platforms.

GET/api/v1/posts

List posts for the authenticated user. Supports filtering by status and platform, with pagination.

Auth:Bearer token

Parameters

NameTypeRequiredDescription
statusstringNoFilter by post status: draft, scheduled, queued, posting, published, partial, failed, discarded.
platformstringNoFilter by platform: instagram, facebook, linkedin, tiktok, threads.
limitintegerNoMaximum number of posts to return (default: 20, max: 100).
offsetintegerNoNumber of posts to skip for pagination (default: 0).
200Returns paginated list of post summaries.
{
  "posts": [
    {
      "id": "post_uuid",
      "status": "published",
      "textPreview": "Building in public...",
                      "platforms": ["threads", "instagram"],
      "mediaCount": 1,
      "publishedCount": 2,
      "failedCount": 0,
      "scheduledFor": null,
      "createdAt": "2026-04-30T10:00:00Z",
      "updatedAt": "2026-04-30T10:00:00Z",
      "platformSetId": "set_uuid"
    }
  ],
  "total": 42
}
401Missing or invalid API key.
429Rate limit exceeded. Check X-RateLimit-* headers.
POST/api/v1/posts

Create a draft or scheduled post with JSON or multipart inline media upload. Publish later with the scheduler or immediately through the versioned publish endpoint.

Auth:Bearer token

Parameters

NameTypeRequiredDescription
content.textstringYesThe post text content.
content.mediaPostMedia[]NoArray of already-hosted media attachments, or omit it and send files inline with multipart/form-data. TikTok requires explicit media objects with type, MIME type, sizeBytes, and video durationSeconds when relevant.
content.linkUrlstring | nullNoURL to include in the post.
content.platformOverridesobjectNoPer-platform overrides (text, settings). Settings supports Instagram/Facebook placement selection, LinkedIn member-post options such as visibility, article metadata, video title, and alt text, and TikTok creator controls.
platformsPlatform[]YesArray of platforms to publish to.
scheduledForstring | nullNoISO 8601 timestamp for scheduled posting. null creates a draft. Scheduling is currently supported for Instagram, Facebook, Threads, and TikTok.
platformSetIdstringYesPlatform set UUID. The post must be scoped to a platform set.
201Post created successfully. Returns the full post object.
{
  "post": {
    "id": "post_uuid",
    "userId": "user_xyz",
    "content": { ... },
    "platformPosts": [
      {
        "id": "pp_uuid",
        "platform": "threads",
        "status": "published",
        "publishedUrl": "https://threads.net/user/post/123",
        ...
      }
    ],
    "status": "draft",
    "scheduledFor": null,
    "createdAt": "2026-04-30T10:00:00Z",
    "updatedAt": "2026-04-30T10:00:00Z",
    "platformSetId": "set_uuid"
  }
}
400Validation failed. Check the error message for details.
GET/api/v1/posts/:id

Get a single post by ID. Only returns posts belonging to the authenticated user.

Auth:Bearer token
200Returns the full post object with all platform posts.
404Post not found (either does not exist or belongs to a different user).
POST/api/v1/posts/:id/cancel

Cancel a draft, scheduled, queued, partial, or failed post. Published and actively posting posts cannot be cancelled.

Auth:Bearer token
200Post cancelled successfully. Returns the updated post with status discarded.
404Post not found.
409Invalid status transition (e.g., trying to cancel an already-published post).
PATCH/api/v1/posts/:id

Update a draft or scheduled post. Provide any subset of content, platforms, scheduledFor, or platformSetId.

Auth:Bearer token
200Post updated successfully.
404Post not found.
409Invalid status transition for an immutable post.
DELETE/api/v1/posts/:id

Discard a post through the primary resource endpoint.

Auth:Bearer token
200Post discarded successfully.
POST/api/v1/posts/:id/publish

Publish a draft or scheduled post immediately to all target platforms.

Auth:Bearer token
200Publish started and returns the latest post state.
409Invalid status transition for publish.
POST/api/v1/posts/:id/retry

Retry failed platform publishes. Optionally pass a JSON body with a platforms array.

Auth:Bearer token
200Retry started and returns the latest post state.
409Retry is only valid for partial or failed posts.

MCP Server

Ampost provides a Model Context Protocol (MCP) server for AI agents and LLMs. The MCP documentation lives on its own page with endpoint details, available tools, and configuration examples.

View MCP Documentation →

Platforms

Ampost supports 5 social media platforms through a single integration. Connect your accounts in the dashboard, then reference them by platform name in API requests.

Instagram

instagram

Images, video, carousels

Facebook

facebook

Posts, pages, groups

LinkedIn

linkedin

Member posts only; org posting gated

TikTok

tiktok

Scheduled photo and video posts; audit-sensitive visibility

Threads

threads

Posts, replies

Placement

Instagram and Facebook support placement selection to control how content appears. Placements are set via platformOverrides.{platform}.settings.placement and are validated against the media configuration.

Instagram Placements

feedstoryreelcarousel

Carousel requires 2+ images. Reel requires exactly one video. Story supports single image or video. Feed supports single image only.

Facebook Placements

feedstoryreel

Reel requires exactly one video and Meta currently expects 9:16 media between 4 and 60 seconds. Feed and story support images or video. If Facebook returns identity-confirmation errors, complete the Page authorization flow in the Facebook mobile app before retrying.

Platform Sets

Platform sets group your connected social accounts into named collections. Every post must be scoped to a platform set via platformSetId. Each user can create up to 20 sets.

The public REST surface exposes versioned platform-set endpoints for Bearer API keys. Use them to list sets, create new ones, rename any set, or delete a set when at least one other set remains. Deleting a set revokes its active platform connections. Dashboard cookie-auth routes remain available separately for the web app.

The canonical public endpoints are /api/v1/platform-sets and /api/v1/platform-sets/:id. The older /api/platforms/sets routes also accept Bearer API keys and dashboard session auth for the same list, create, rename, and delete operations. The public hosted-connect API can create and poll new browser-assisted connections. Existing dashboard reconnect, refresh, disconnect, and dashboard Facebook Page-selection routes remain session-only.

GET/api/v1/platform-sets

List all platform sets for the authenticated user. Each set includes a connection count of active platform connections.

Auth:Bearer token
200Returns the list of platform sets with connection counts.
{
  "sets": [
    {
      "id": "set_uuid",
      "userId": "user_xyz",
      "name": "My Brand Accounts",
      "isDefault": true,
      "createdAt": "2026-04-30T10:00:00Z",
      "updatedAt": "2026-04-30T10:00:00Z",
      "connectionCount": 3
    }
  ]
}
401Missing or invalid API key.
POST/api/v1/platform-sets

Create a new platform set. Max 20 sets per user.

Auth:Bearer token

Parameters

NameTypeRequiredDescription
namestringYesDisplay name for the platform set (max 50 characters).
200Platform set created successfully.
{
  "set": {
    "id": "set_uuid",
    "userId": "user_xyz",
    "name": "My Brand Accounts",
    "isDefault": false,
    "createdAt": "2026-04-30T10:00:00Z",
    "updatedAt": "2026-04-30T10:00:00Z",
    "connectionCount": 0
  }
}
400Validation failed (name missing, too long, or max sets exceeded).
PATCH/api/v1/platform-sets/:id

Rename an existing platform set owned by the authenticated user.

Auth:Bearer token

Parameters

NameTypeRequiredDescription
namestringYesNew display name for the platform set (max 50 characters).
200Platform set renamed successfully.
{
  "set": {
    "id": "set_uuid",
    "userId": "user_xyz",
    "name": "Renamed Set",
    "isDefault": false,
    "createdAt": "2026-04-30T10:00:00Z",
    "updatedAt": "2026-05-01T12:00:00Z"
  }
}
400Validation failed (name missing or too long).
404Platform set not found.
DELETE/api/v1/platform-sets/:id

Delete a platform set. All active connections in the set are revoked. The last remaining set cannot be deleted.

Auth:Bearer token
200Platform set deleted. All connections in the set were revoked.
{
  "success": true
}
400Cannot delete the last platform set.
404Platform set not found.

Accounts

Use the versioned account endpoints to start a browser-assisted connection or discover connected publishing accounts before creating and debugging posts.

Account responses include scopes, platform set membership, token expiry, derived tokenHealth, and non-secret platformMetadata. For TikTok this metadata includes creator publish options such as available privacy levels, disabled comment/duet/stitch flags, and max video duration. For LinkedIn it includes the member's subject identifier, basic OIDC profile snapshot, granted scopes, auth-flow marker, and the organization-posting gate state captured at connect time.

Browser-assisted hosted flow

Create a short-lived request, show its one-time connectUrlto the user, and ask them to open it in a browser. The hosted Ampost page handles confirmation, provider consent, and Facebook Page selection. Poll the status resource every 2–5 seconds until it becomes connected, failed, or expired.

Show the complete URL once, but never log, analyze, transform, or repeat its fragment after that handoff. Do not ask users to paste the fragment back, or ask for access tokens, OAuth codes, passwords, state values, or Facebook Page tokens. The create response is the only API response containing the URL; status responses contain only safe state and error information.

MVP exclusions: profiles, customer callbacks, webhooks, headless authorization, public reconnect, public disconnect, and public token refresh. Those existing account-lifecycle operations remain dashboard-authenticated. Creation is unavailable while the operator-controlled PLATFORM_CONNECT_ENABLED rollout flag is false; status reads remain available for incident recovery.

POST/api/v1/accounts/connect

Create a ten-minute hosted connection request for one of the five supported platforms. Omit platformSetId to use the API-key owner's default set.

Auth:Bearer token

Parameters

NameTypeRequiredDescription
platformstringYesOne of: instagram, facebook, linkedin, tiktok, threads.
platformSetIdUUIDNoOwned target set; omission resolves the default set.
201Returns the pending request and one-time app-host URL. Uses the connectPlatform rate limit and Cache-Control: no-store.
{
  "connectRequest": {
    "id": "11111111-1111-4111-8111-111111111111",
    "platform": "instagram",
    "platformSetId": "22222222-2222-4222-8222-222222222222",
    "status": "pending",
    "connectUrl": "https://ampost.io/connect/11111111-1111-4111-8111-111111111111#token=<one-time-token>",
    "createdAt": "2026-07-14T12:00:00.000Z",
    "expiresAt": "2026-07-14T12:10:00.000Z"
  }
}
409The platform is already connected or a started request owns the target slot.
503Hosted connections are not enabled or the provider is not configured.
GET/api/v1/accounts/connect/:connectRequestId

Read the owner-scoped safe status. Another active key for the same owner may poll it; other owners receive 404.

Auth:Bearer token
200Returns pending, awaiting_selection, connected, failed, or expired. connectionId is non-null only for connected. Uses the apiRead rate limit.
{
  "connectRequest": {
    "id": "11111111-1111-4111-8111-111111111111",
    "platform": "instagram",
    "platformSetId": "22222222-2222-4222-8222-222222222222",
    "status": "connected",
    "connectionId": "33333333-3333-4333-8333-333333333333",
    "error": null,
    "createdAt": "2026-07-14T12:00:00.000Z",
    "expiresAt": "2026-07-14T12:10:00.000Z",
    "completedAt": "2026-07-14T12:02:14.000Z",
    "updatedAt": "2026-07-14T12:02:14.000Z"
  }
}
404Request not found, purged, or owned by another user.
GET/api/v1/accounts

List connected social accounts. Supports platform and platformSetId filters.

Auth:Bearer token
200Returns the connected accounts visible to the API key owner.
GET/api/v1/accounts/:id

Get details for a single connected account.

Auth:Bearer token
200Returns the requested connected account.
404Account not found.

Media Upload

Media files are uploaded inline through the public versioned post creation endpoint. Send a multipart/form-data request to /api/v1/posts with a data field (the same JSON body documented for post creation) and one or more files fields (media files). The legacy /api/posts route remains compatible for existing integrations.

POST/api/v1/posts

Accepted MIME types: image/jpeg, image/png, image/webp, video/mp4, video/quicktime. Max file size: 200 MB per file.

terminal
curl -X POST https://api.ampost.io/api/v1/posts \
  -H "Authorization: Bearer amp_live_YOUR_KEY" \
  -F 'data={
    "content":{
      "text":"TikTok launch post",
      "media":[{
        "url":"https://cdn.example.com/launch.mp4",
        "type":"video",
        "filename":"launch.mp4",
        "mimeType":"video/mp4",
        "sizeBytes":18432000,
        "width":1080,
        "height":1920,
        "durationSeconds":24
      }],
      "linkUrl":null,
      "platformOverrides":{
        "tiktok":{"settings":{"privacyLevel":"SELF_ONLY","disableComment":true}}
      }
    },
    "platforms":["tiktok"],
    "scheduledFor":null,
    "platformSetId":"set_uuid"
  }' \
  -F "files=@launch.mp4"

Scheduled Instagram, Facebook, Threads, TikTok, and LinkedIn media posts use the same endpoint. For JSON requests, TikTok should always be sent as explicit content.media objects. LinkedIn strongly prefers explicit media objects as well and requires them for video. TikTok creator visibility is also launch-state sensitive: if the connected TikTok app is limited to private-only posting during audit or Direct Post review, Ampost exposes only the allowed privacy levels and surfaces provider errors instead of assuming public delivery.

LinkedIn Contract

LinkedIn supports member-auth text-only posts, image posts, article posts, and single-video posts. Use platformOverrides.linkedin.text for a LinkedIn-specific text override and platformOverrides.linkedin.settings for visibility, reshare controls, article metadata, and video title metadata. Organization posting remains intentionally gated, and analytics and comment-management APIs are not part of this launch.

Typed content.media objects are recommended for all LinkedIn media and required for video. Bare mediaUrls stay available only for legacy image posts; video-like legacy URLs are rejected because LinkedIn image and video upload flows differ.

linkedin text-only JSON
{
  "content": {
    "text": "Shipping the new LinkedIn contract today.",
    "media": [],
    "linkUrl": null,
    "platformOverrides": {
      "linkedin": {
        "settings": {
          "visibility": "PUBLIC",
          "isReshareDisabledByAuthor": true
        }
      }
    }
  },
  "platforms": ["linkedin"],
  "scheduledFor": null,
  "platformSetId": "set_uuid"
}
linkedin image JSON
{
  "content": {
    "text": "LinkedIn image post",
    "media": [
      {
        "id": "media-1",
        "url": "https://cdn.example.com/product-shot.png",
        "type": "image",
        "filename": "product-shot.png",
        "mimeType": "image/png",
        "sizeBytes": 248120,
        "width": 1600,
        "height": 900,
        "altText": "Product dashboard with the LinkedIn publish flow open."
      }
    ],
    "linkUrl": null,
    "platformOverrides": {
      "linkedin": {
        "settings": {
          "visibility": "CONNECTIONS"
        }
      }
    }
  },
  "platforms": ["linkedin"],
  "scheduledFor": null,
  "platformSetId": "set_uuid"
}
linkedin video JSON
{
  "content": {
    "text": "LinkedIn demo clip",
    "media": [
      {
        "id": "media-1",
        "url": "https://cdn.example.com/demo.mp4",
        "type": "video",
        "filename": "demo.mp4",
        "mimeType": "video/mp4",
        "sizeBytes": 18432000,
        "width": 1920,
        "height": 1080,
        "durationSeconds": 38,
        "thumbnailUrl": "https://cdn.example.com/demo-thumb.jpg"
      }
    ],
    "linkUrl": null,
    "platformOverrides": {
      "linkedin": {
        "settings": {
          "visibility": "PUBLIC",
          "videoTitle": "Ampost LinkedIn demo"
        }
      }
    }
  },
  "platforms": ["linkedin"],
  "scheduledFor": null,
  "platformSetId": "set_uuid"
}
invalid legacy /api/posts linkedin video JSON
{
  "text": "This will be rejected",
  "platforms": ["linkedin"],
  "scheduledFor": null,
  "platformSetId": "set_uuid",
  "mediaUrls": ["https://cdn.example.com/demo.mp4"]
}

The invalid legacy example returns a 400 validation error because LinkedIn video posts must use explicit media metadata.

Rate Limits

Ampost enforces tier-based rate limiting to ensure fair usage. Rate limits vary by operation and plan. Exceeding a rate limit returns a 429 Too Many Requests response.

Rate limit operations

OperationDescription
createPostCreating new posts
publishPostPublishing scheduled posts
connectPlatformAdding new platform connections
mediaUploadUploading media attachments
apiReadReading posts and account data

Quota types

In addition to rate limits, Ampost enforces monthly quotas depending on your plan:

postsPerMonthmediaUploadsPerMonthapiRequestsPerMonthmaxScheduledPostsmaxStorageBytes

Error Codes

The API returns standard HTTP status codes with JSON error bodies. Post-engine errors include a machine-readable code.

CodeHTTPDescription
VALIDATION_FAILED400Request body failed validation.
NO_PLATFORMS_SELECTED400No platforms specified in the request.
PLATFORM_NOT_CONNECTED400Requested platform has no connected account.
CONTENT_TOO_LONG400Post text exceeds platform character limits.
UNSUPPORTED_MEDIA_TYPE400Media file format is not supported.
UNSUPPORTED_MEDIA_CONFIG400Media configuration is not supported by the platform.
INVALID_PLACEMENT400Selected placement is invalid for the current media configuration.
MIXED_MEDIA_NOT_SUPPORTED400Platform does not support mixing image and video media in a single post.
PAGE_IDENTITY_CONFIRMATION_REQUIRED403Facebook requires the Page manager to complete identity confirmation in the Facebook mobile app before publishing can continue.
POST_NOT_FOUND404The requested post does not exist.
INVALID_STATUS_TRANSITION409Cannot transition the post to the requested status.
RATE_LIMITED429Rate limit exceeded. Retry after the window resets.
MEDIA_UPLOAD_FAILED502Media upload to platform failed.
BROKER_ERROR502Platform broker encountered an internal error.

Continue browsing

Related implementation paths

Use these nearby pages when you want product context, MCP-specific setup, or plan details alongside the raw API reference.