HomeDocsREST API Reference

Developer reference

REST API Reference

Schedule and publish social posts, manage connections, media, and webhooks with a standard Bearer-token API. One key, cursor pagination, a single error envelope.

https://sharetopus.com/api/v1interactive exploreropenapi.json
The OpenAPI 3.1 document at /api/v1/openapi.json is generated from the same zod schemas that validate requests at runtime; use it for codegen and the interactive explorer at /docs/api to try calls.

Authentication

Every endpoint requires a Bearer API key. Keys are scoped to your account and require an active subscription.

  1. 1
    Create a key.

    In the web app, open /integrations and click Create REST API Key. The key starts with stp_rest_ and is shown once; store it like a password.

  2. 2
    Send it on every request.

    Authorization: Bearer stp_rest_... . Keys are validated against a SHA-256 hash, checked for expiry, and require an active subscription.

  3. 3
    Handle 401 as terminal.

    A 401 unauthorized means the key is missing, malformed, expired, or the subscription lapsed. Rotating the key or fixing billing are the only remedies; retrying does not help.

Quickstart · cURL
# Every request carries the API key as a Bearer token
curl "https://sharetopus.com/api/v1/posts" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"
Response · 401
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or expired API key"
  },
  "request_id": "8f0a3c52-7c1e-4b8e-9f21-d4a0c0b6e7aa"
}
Every response carries an x-request-id header (echoed as request_id in error bodies). Include it when contacting support.

Pagination

List endpoints use cursor pagination on the resource creation date, newest first. The cursor is opaque: always pass back next_cursor exactly as received.

  1. 1
    Request a page.

    limit accepts 1 to 100 and defaults to 20 on every list endpoint.

  2. 2
    Follow next_cursor.

    The response envelope is { data, next_cursor }. A null next_cursor means the last page. Pass the value back as ?cursor= to fetch the next page.

Example · Two pages
# First page
curl "https://sharetopus.com/api/v1/posts?limit=20" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"

# Next page: pass next_cursor from the previous response
curl "https://sharetopus.com/api/v1/posts?limit=20&cursor=2026-07-01T09:30:00.000Z" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"
Response · Envelope
{
  "data": [ { "...": "resource objects, newest first" } ],
  "next_cursor": "2026-07-01T09:30:00.000Z"
}

Error codes

Every error response uses one envelope: { error: { code, message, details? }, request_id }. details appears only on validation errors and rate limits.

StatusCodeMeaning
400validation_errorThe body or query failed schema validation, or the JSON is malformed. details carries the field-level issues.
401unauthorizedMissing, malformed, or expired API key, or no active subscription.
403forbiddenKey lacks the required scope, quota exhausted, or file access denied.
404not_foundThe resource does not exist or is not owned by your account. Unowned resources return 404, never 403.
429rate_limitedPer-key rate limit exceeded. See Rate limits.
500internal_errorServer-side failure. Retry with backoff; include request_id when reporting.

Rate limits

Limits are enforced per API key and per action (for example rest.posts.create). A 429 carries retry_after_seconds in the error details when the window is known.

Response · 429
{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests",
    "details": { "retry_after_seconds": 42 }
  },
  "request_id": "8f0a3c52-7c1e-4b8e-9f21-d4a0c0b6e7aa"
}

Posts

Create, list, inspect, reschedule, and cancel posts. Omitting scheduled_at publishes immediately; providing it schedules for that time.

POST

Create a post

/api/v1/posts

Schedules a post (scheduled_at in the future) or publishes immediately (scheduled_at omitted). Validation is platform-aware: unsupported media types and missing Pinterest boards are rejected with 400 validation_error.

Request Body
ParameterTypeRequiredDescription
social_account_idstring (uuid)RequiredConnected account to post from (see Connections).
platformstringRequiredlinkedin, tiktok, pinterest, instagram, youtube, x, or facebook. Must match the account.
post_typestringRequiredtext, image, or video. Media-type support is validated per platform (for example youtube accepts video only).
descriptionstring | nullRequiredPost body text, max 10000 characters. The key is required; the value may be null.
titlestringOptionalMax 500 characters, where the platform supports one.
media_storage_pathstringOptionalRequired for image and video posts. The storage_path returned by the Media endpoints; format {principal_id}/filename.
scheduled_atstringOptionalFuture ISO 8601 timestamp with offset. Omit to publish immediately.
idempotency_keystringOptional1 to 200 characters. Client-supplied key to dedupe retries.
batch_idstringOptionalRequest-level grouping id.
pinterest_board_idstringOptionalRequired when platform is pinterest.
pinterest_board_namestringOptionalBoard name, informational.
pinterest_linkstring (url)OptionalOutbound link for the pin, max 2048 characters.
Response Fields (PostDTO)
ParameterTypeRequiredDescription
idstring (uuid)RequiredPost id.
statusstringRequiredscheduled, queued, processing, posted, failed, or cancelled.
platformstringRequiredlinkedin, tiktok, pinterest, instagram, youtube, x, or facebook.
post_typestringRequiredtext, image, or video.
titlestring | nullRequiredTitle, when set.
descriptionstring | nullRequiredBody text, when set.
scheduled_atstringRequiredPublish time, ISO 8601.
posted_atstring | nullRequiredSet once the post is published.
social_account_idstring (uuid)RequiredAccount the post targets.
media_storage_pathstringRequiredStorage path of the attached media; empty for text posts.
batch_idstring | nullRequiredBatch the post belongs to, when created in one.
created_atstringRequiredRecord creation time, ISO 8601.
Example Request
curl -X POST "https://sharetopus.com/api/v1/posts" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "social_account_id": "5b1f0c4e-3d2a-4f6b-8c9d-0e1f2a3b4c5d",
    "platform": "tiktok",
    "post_type": "video",
    "description": "Launch day.",
    "media_storage_path": "user_2f6a1c0e.../launch.mp4",
    "scheduled_at": "2026-07-12T16:00:00.000Z"
  }'
Response · 200
{
  "id": "c9d8e7f6-a5b4-4c3d-2e1f-0a9b8c7d6e5f",
  "status": "scheduled",
  "platform": "tiktok",
  "post_type": "video",
  "title": null,
  "description": "Launch day.",
  "scheduled_at": "2026-07-12T16:00:00.000Z",
  "posted_at": null,
  "social_account_id": "5b1f0c4e-3d2a-4f6b-8c9d-0e1f2a3b4c5d",
  "media_storage_path": "user_2f6a1c0e.../launch.mp4",
  "batch_id": null,
  "created_at": "2026-07-04T18:00:00.000Z"
}
GET

List posts

/api/v1/posts

Cursor-paginated list, newest first.

Query Parameters
ParameterTypeRequiredDescription
statusstringOptionalscheduled, queued, processing, posted, failed, or cancelled.
platformstringOptionalFilter by posting platform.
batch_idstringOptionalFilter by batch.
limitnumberOptional1 to 100. Default 20.
cursorstringOptionalnext_cursor from the previous page.
Example Request
curl "https://sharetopus.com/api/v1/posts?status=scheduled&limit=20" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"
POST

Bulk schedule posts

/api/v1/posts/bulk

Schedules 1 to 30 posts in one request; every item takes the same fields as Create a post. All posts share one server-generated batch_id, and each gets the idempotency key batch_id:index unless one is provided. Partial success is possible: rejected items are listed, inserted ones are returned.

Request Body
ParameterTypeRequiredDescription
postsobject[]Required1 to 30 items, each with the Create a post body fields.
Response Fields
ParameterTypeRequiredDescription
successbooleanRequiredTrue when the batch was processed.
batch_idstring (uuid)RequiredShared batch id for every post in the call.
totalnumberRequiredItems received.
insertednumberRequiredPosts stored.
duplicatesnumberRequiredItems skipped by idempotency key.
rejectedobject[]RequiredItems that failed validation, with reasons.
postsPostDTO[]RequiredThe inserted posts.
Example Request
curl -X POST "https://sharetopus.com/api/v1/posts/bulk" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "posts": [
      { "social_account_id": "5b1f0c4e-...", "platform": "x", "post_type": "text", "description": "Thread 1/3", "scheduled_at": "2026-07-12T16:00:00.000Z" },
      { "social_account_id": "5b1f0c4e-...", "platform": "x", "post_type": "text", "description": "Thread 2/3", "scheduled_at": "2026-07-12T16:05:00.000Z" }
    ]
  }'
GET

Get a post

/api/v1/posts/{id}

Returns one post by id. Posts owned by another account return 404.

Path Parameters
ParameterTypeRequiredDescription
idstring (uuid)RequiredPost id.
Example Request
curl "https://sharetopus.com/api/v1/posts/c9d8e7f6-a5b4-4c3d-2e1f-0a9b8c7d6e5f" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"
PATCH

Reschedule a post

/api/v1/posts/{id}

Moves a pending post to a new future time. Cancelled posts are automatically resumed by the move. Returns the updated PostDTO.

Request Body
ParameterTypeRequiredDescription
scheduled_atstringRequiredFuture ISO 8601 timestamp with offset.
Example Request
curl -X PATCH "https://sharetopus.com/api/v1/posts/c9d8e7f6-a5b4-4c3d-2e1f-0a9b8c7d6e5f" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "scheduled_at": "2026-07-13T09:00:00.000Z" }'
DELETE

Cancel or delete a post

/api/v1/posts/{id}

Default is a soft cancel: the post keeps its row and media, status becomes cancelled. hard=true permanently deletes the post and cleans up its media.

Query Parameters
ParameterTypeRequiredDescription
hardbooleanOptionaltrue for permanent deletion. Default false (cancel).
Response Fields
ParameterTypeRequiredDescription
idstring (uuid)RequiredThe post acted on.
actionstringRequiredcancelled or deleted.
detailsobject | nullRequiredBatch-operation details, when available.
hard=true is not reversible and removes stored media that no other post references.
Example Request
curl -X DELETE "https://sharetopus.com/api/v1/posts/c9d8e7f6-a5b4-4c3d-2e1f-0a9b8c7d6e5f?hard=true" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"
GET

Get post analytics

/api/v1/posts/{id}/analytics

Returns the metric rows recorded for a published post. 404 when the post does not exist or has no published content yet.

Response Fields
ParameterTypeRequiredDescription
post_idstring (uuid)RequiredThe post.
content_idstringRequiredPlatform-side content identifier.
metricsobject[]RequiredMetric rows: metric_date, views, likes, comments, shares, subscribers.
Example Request
curl "https://sharetopus.com/api/v1/posts/c9d8e7f6-a5b4-4c3d-2e1f-0a9b8c7d6e5f/analytics" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"

Connections

Connected social accounts. OAuth flows are browser-based: the API returns an authorization URL, the user finishes in the browser, and the account appears in the list. Platform tokens are never returned.

GET

List connections

/api/v1/connections

Cursor-paginated list of connected accounts. By default only available accounts are returned; include_unavailable=true adds accounts whose platform token expired (candidates for reauth).

Query Parameters
ParameterTypeRequiredDescription
platformstringOptionalAny of linkedin, tiktok, pinterest, instagram, facebook, threads, youtube, x.
include_unavailablebooleanOptionaltrue to include expired accounts. Default false.
limitnumberOptional1 to 100. Default 20.
cursorstringOptionalnext_cursor from the previous page.
Response Fields (ConnectionDTO)
ParameterTypeRequiredDescription
idstring (uuid)RequiredAccount id, used as social_account_id when posting.
platformstringRequiredlinkedin, tiktok, pinterest, instagram, facebook, threads, youtube, or x.
account_identifierstringRequiredPlatform-side account identifier.
display_namestring | nullRequiredProfile display name.
usernamestring | nullRequiredProfile handle.
avatar_urlstring | nullRequiredProfile image URL.
is_verifiedboolean | nullRequiredPlatform verification badge, when known.
follower_countnumber | nullRequiredFollower count at last sync.
is_availablebooleanRequiredFalse when the platform token expired; use reauth.
token_expires_atstring | nullRequiredPlatform token expiry, when the platform reports one.
created_atstringRequiredWhen the account was connected.
Example Request
curl "https://sharetopus.com/api/v1/connections?include_unavailable=true" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"
POST

Initiate an OAuth connection

/api/v1/connections/initiate

Starts an OAuth flow for a new account. Open connect_url in a browser; after the user authorizes, the provider redirects to the Sharetopus callback and the account becomes visible in List connections. The state expires after 15 minutes.

Request Body
ParameterTypeRequiredDescription
platformstringRequiredlinkedin, tiktok, pinterest, instagram, youtube, x, or facebook.
redirect_urlstring (url)OptionalCustom OAuth redirect URI. Defaults to the Sharetopus callback.
Response Fields
ParameterTypeRequiredDescription
connect_urlstringRequiredAuthorization URL to open in a browser.
statestringRequiredOAuth state token bound to this attempt.
expires_atstringRequired15 minutes after creation.
connection_idstring (uuid)RequiredId of the pending connection row.
Example Request
curl -X POST "https://sharetopus.com/api/v1/connections/initiate" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "platform": "youtube" }'
GET

Get a connection

/api/v1/connections/{id}

Returns one connected account by id. Accounts owned by another principal return 404.

Path Parameters
ParameterTypeRequiredDescription
idstring (uuid)RequiredConnection id.
Example Request
curl "https://sharetopus.com/api/v1/connections/5b1f0c4e-3d2a-4f6b-8c9d-0e1f2a3b4c5d" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"
POST

Reauthorize a connection

/api/v1/connections/{id}/reauth

For an account whose platform token expired (is_available false). Returns a fresh authorization URL to open in a browser, plus the current account snapshot.

Response Fields
ParameterTypeRequiredDescription
reauth_urlstringRequiredAuthorization URL to open in a browser.
accountConnectionDTORequiredThe account being reauthorized.
Example Request
curl -X POST "https://sharetopus.com/api/v1/connections/5b1f0c4e-3d2a-4f6b-8c9d-0e1f2a3b4c5d/reauth" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"
GET

List Pinterest boards

/api/v1/connections/{id}/boards

Boards of a connected Pinterest account, for the pinterest_board_id field when posting. 400 when the account is not Pinterest; 401 with a reauth_url when the Pinterest token expired and could not be refreshed.

Query Parameters
ParameterTypeRequiredDescription
page_sizenumberOptional1 to 100. Default 25.
bookmarkstringOptionalPinterest pagination bookmark from the previous response.
Response Fields (data[])
ParameterTypeRequiredDescription
idstringRequiredBoard id, used as pinterest_board_id.
namestringRequiredBoard name.
descriptionstring | nullRequiredBoard description.
privacystring | nullRequiredBoard privacy setting.
pin_countnumber | nullRequiredPins on the board.
Example Request
curl "https://sharetopus.com/api/v1/connections/5b1f0c4e-3d2a-4f6b-8c9d-0e1f2a3b4c5d/boards?page_size=25" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"

Media

Upload media before creating image or video posts, either by direct upload (signed URL) or by importing from a public URL. Storage paths are account-scoped: every path starts with your principal id.

POST

Create an upload URL

/api/v1/media/upload-url

Returns a signed URL for a direct upload. PUT the file bytes to upload_url, then use storage_path as media_storage_path when creating posts. Content type and size are validated against your plan limits; 403 when the storage quota would be exceeded.

Request Body
ParameterTypeRequiredDescription
filenamestringRequired1 to 255 characters.
content_typestringRequiredMIME type of the file, for example video/mp4.
size_bytesnumberRequiredPositive integer.
Response Fields
ParameterTypeRequiredDescription
upload_urlstringRequiredSigned upload URL.
storage_pathstringRequiredPath to use as media_storage_path when posting.
tokenstringRequiredUpload token bound to the signed URL.
expires_in_secondsnumberRequiredSigned URL lifetime: 7200 (2 hours).
Example Request
curl -X POST "https://sharetopus.com/api/v1/media/upload-url" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "filename": "launch.mp4", "content_type": "video/mp4", "size_bytes": 10485760 }'
POST

Attach media from a URL

/api/v1/media/attach-from-url

Downloads media from a public URL into Sharetopus storage server-side. SSRF-protected (private address ranges are blocked) and restricted to image and video content types. The filename is inferred from the URL when omitted.

Request Body
ParameterTypeRequiredDescription
urlstring (url)RequiredPublic URL of the media file.
filenamestringOptional1 to 255 characters. Inferred from the URL when omitted.
Response Fields
ParameterTypeRequiredDescription
successbooleanRequiredTrue when the file was stored.
storage_pathstringRequiredPath to use as media_storage_path when posting.
content_typestringRequiredDetected MIME type.
size_bytesnumberRequiredStored file size.
Example Request
curl -X POST "https://sharetopus.com/api/v1/media/attach-from-url" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com/assets/launch.mp4" }'
GET

Get a view URL

/api/v1/media/{path}

Returns a short-lived signed URL to view or download a stored file. The path is the full storage path ({principal_id}/filename); paths outside your account return 403.

Query Parameters
ParameterTypeRequiredDescription
expires_in_secondsnumberOptional1 to 3600. Default 300.
Response Fields
ParameterTypeRequiredDescription
view_urlstringRequiredSigned view URL.
expires_in_secondsnumberRequiredLifetime of the returned URL.
Example Request
curl "https://sharetopus.com/api/v1/media/user_2f6a1c0e.../launch.mp4?expires_in_seconds=600" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"
DELETE

Delete a media file

/api/v1/media/{path}

Reference-aware delete: when the file is still referenced by a scheduled or pending post, it is preserved and the response carries deleted false. Unreferenced files are removed.

Response Fields
ParameterTypeRequiredDescription
storage_pathstringRequiredThe path acted on.
deletedbooleanRequiredFalse when the file is still referenced by a post.
Example Request
curl -X DELETE "https://sharetopus.com/api/v1/media/user_2f6a1c0e.../launch.mp4" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"

Webhooks

HTTPS event notifications instead of polling. Each delivery is HMAC-SHA256 signed with the subscription secret, which is returned exactly once at creation.

EventFires when
post.scheduledA post is successfully scheduled.
post.publishedA post is published to a social platform.
post.failedPublishing a post fails.
connection.connectedAn OAuth flow completes and the account is connected.
connection.expiredAn account token expires and cannot be refreshed.

Verify every delivery: compute HMAC-SHA256 of the raw request body with your subscription secret and compare it to the X-Sharetopus-Signature header (sha256=<hex> format).

POST

Create a subscription

/api/v1/webhooks

Subscribes an HTTPS endpoint to 1 to 20 event types. The response is the subscription plus the signing secret; the secret is never returned again.

Request Body
ParameterTypeRequiredDescription
urlstring (url)RequiredHTTPS endpoint, max 2048 characters. Private addresses are rejected.
eventsstring[]Required1 to 20 event types from the table above.
Response Fields (WebhookSubscriptionDTO)
ParameterTypeRequiredDescription
idstring (uuid)RequiredSubscription id.
urlstringRequiredDestination HTTPS endpoint.
eventsstring[]RequiredSubscribed event types.
activebooleanRequiredFalse after repeated delivery failures disable the subscription.
failure_countnumberRequiredConsecutive failed deliveries.
last_delivery_atstring | nullRequiredLast delivery attempt.
last_disabled_atstring | nullRequiredWhen the subscription was auto-disabled, if ever.
created_atstringRequiredCreation time.
updated_atstringRequiredLast update time.
The secret field appears only in this response. Store it immediately; recovering it later requires creating a new subscription.
Example Request
curl -X POST "https://sharetopus.com/api/v1/webhooks" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com/hooks/sharetopus", "events": ["post.published", "post.failed"] }'
GET

List subscriptions

/api/v1/webhooks

All subscriptions for the account, newest first. Not paginated.

Example Request
curl "https://sharetopus.com/api/v1/webhooks" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"
GET

Get a subscription

/api/v1/webhooks/{id}

One subscription by id, without the secret.

Example Request
curl "https://sharetopus.com/api/v1/webhooks/9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"
PATCH

Update a subscription

/api/v1/webhooks/{id}

Changes the URL, the event list, or the active flag. At least one field is required. Setting active true resets failure_count and clears last_disabled_at, re-enabling a subscription that repeated failures disabled.

Request Body
ParameterTypeRequiredDescription
urlstring (url)OptionalNew HTTPS endpoint, max 2048 characters.
eventsstring[]OptionalReplacement event list, 1 to 20 types.
activebooleanOptionaltrue re-enables a disabled subscription.
Example Request
curl -X PATCH "https://sharetopus.com/api/v1/webhooks/9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "active": true }'
DELETE

Delete a subscription

/api/v1/webhooks/{id}

Deletes the subscription and its delivery history. Not reversible.

Response Fields
ParameterTypeRequiredDescription
idstring (uuid)RequiredThe deleted subscription.
deletedbooleanRequiredAlways true on success.
Example Request
curl -X DELETE "https://sharetopus.com/api/v1/webhooks/9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"
POST

Send a test event

/api/v1/webhooks/{id}/test

Delivers a synthetic event synchronously (10 second timeout) and returns the actual delivery result, so you can debug the receiving endpoint without waiting for real traffic.

Request Body
ParameterTypeRequiredDescription
event_typestringOptionalEvent type to simulate. Defaults to a webhook.test payload.
Response Fields
ParameterTypeRequiredDescription
delivery_idstring (uuid)RequiredRecorded delivery.
subscription_idstring (uuid)RequiredThe subscription tested.
status_codenumber | nullRequiredHTTP status your endpoint returned.
latency_msnumberRequiredRound-trip latency.
delivered_atstring | nullRequiredSet when the delivery succeeded.
error_messagestring | nullRequiredSet when the delivery failed.
Example Request
curl -X POST "https://sharetopus.com/api/v1/webhooks/9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d/test" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "event_type": "post.published" }'
GET

List deliveries

/api/v1/webhooks/{id}/deliveries

Cursor-paginated delivery log for one subscription: status codes, latency, attempts, and errors.

Query Parameters
ParameterTypeRequiredDescription
limitnumberOptional1 to 100. Default 20.
cursorstringOptionalnext_cursor from the previous page.
Response Fields (data[])
ParameterTypeRequiredDescription
idstring (uuid)RequiredDelivery id.
event_typestringRequiredDelivered event type.
event_idstringRequiredEvent the delivery belongs to.
status_codenumber | nullRequiredHTTP status returned by the endpoint.
attemptnumberRequiredAttempt counter for the event.
latency_msnumber | nullRequiredRound-trip latency.
delivered_atstring | nullRequiredSet on success.
failed_atstring | nullRequiredSet on failure.
error_messagestring | nullRequiredFailure detail.
created_atstringRequiredRecord creation time.
Example Request
curl "https://sharetopus.com/api/v1/webhooks/9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d/deliveries?limit=20" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"
POST

Replay a delivery

/api/v1/webhooks/{id}/deliveries/{delivery_id}/replay

Re-dispatches a past event through the same delivery pipeline as live events. The subscription must be active; disabled subscriptions return 403.

Response Fields
ParameterTypeRequiredDescription
subscription_idstring (uuid)RequiredThe subscription targeted.
original_delivery_idstring (uuid)RequiredThe delivery replayed.
event_typestringRequiredEvent type re-dispatched.
messagestringRequiredConfirmation; a new delivery appears shortly.
Example Request
curl -X POST "https://sharetopus.com/api/v1/webhooks/9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d/deliveries/7d6c5b4a-3e2f-4d1c-8b9a-0f1e2d3c4b5a/replay" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"
Delivery · Headers
Content-Type: application/json
X-Sharetopus-Event: post.published
X-Sharetopus-Delivery: 7d6c5b4a-3e2f-4d1c-8b9a-0f1e2d3c4b5a
X-Sharetopus-Signature: sha256=<hex(HMAC-SHA256(secret, raw_body))>
User-Agent: Sharetopus-Webhook/1.0
Delivery · Payload
{
  "event_type": "post.published",
  "event_id": "b2a1c0d9-8e7f-4a6b-5c4d-3e2f1a0b9c8d",
  "delivery_id": "7d6c5b4a-3e2f-4d1c-8b9a-0f1e2d3c4b5a",
  "created_at": "2026-07-04T18:02:11.000Z",
  "data": { "...": "event-specific fields" }
}

Analytics, history, and usage

Account-wide reads: performance metrics, the published-content log, and the current billing period's quotas and storage.

GET

List analytics

/api/v1/analytics

Account-wide metric rows, cursor-paginated on metric date. Metrics are collected after publication and may lag the platform by up to a day.

Query Parameters
ParameterTypeRequiredDescription
platformstringOptionallinkedin, tiktok, pinterest, instagram, youtube, x, or facebook.
content_idstringOptionalFilter by platform-side content id.
daysnumberOptionalLookback window, 1 to 90. Default 30.
limitnumberOptional1 to 100. Default 20.
cursorstringOptionalnext_cursor from the previous page.
Response Fields (data[])
ParameterTypeRequiredDescription
idstring (uuid)RequiredMetric row id.
platformstringRequiredPlatform the metric belongs to.
content_idstring | nullRequiredPlatform-side content id.
metric_datestringRequiredDay the metrics were sampled.
viewsnumberRequiredViews at sample time.
likesnumberRequiredLikes at sample time.
commentsnumberRequiredComments at sample time.
sharesnumberRequiredShares at sample time.
subscribersnumberRequiredAccount followers or subscribers at sample time.
created_atstringRequiredRecord creation time.
Example Request
curl "https://sharetopus.com/api/v1/analytics?platform=tiktok&days=30" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"
GET

List content history

/api/v1/content-history

Published content records, cursor-paginated, newest first. This is the confirmation surface after immediate publishing.

Query Parameters
ParameterTypeRequiredDescription
platformstringOptionalAny of linkedin, tiktok, pinterest, instagram, facebook, threads, youtube, x.
limitnumberOptional1 to 100. Default 20.
cursorstringOptionalnext_cursor from the previous page.
Response Fields (data[])
ParameterTypeRequiredDescription
idstring (uuid)RequiredHistory record id.
platformstringRequiredPlatform the content went to.
content_idstringRequiredPlatform-side content identifier.
scheduled_post_idstring | nullRequiredOriginating post, when scheduled.
titlestring | nullRequiredTitle, when set.
descriptionstring | nullRequiredBody text, when set.
media_urlstring | nullRequiredPublic media URL, when available.
media_typestring | nullRequiredtext, image, or video.
statusstring | nullRequiredPlatform-side publish status.
batch_idstring | nullRequiredBatch the content came from.
created_viastringRequiredSurface that created the content (rest, mcp, x402, web).
created_atstringRequiredRecord creation time.
Example Request
curl "https://sharetopus.com/api/v1/content-history?platform=x&limit=10" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"
GET

Get usage

/api/v1/usage

Current plan, billing period, per-action usage counters, and storage consumption against the cap.

Response Fields
ParameterTypeRequiredDescription
planstring | nullRequiredActive plan name.
statusstringRequiredactive, inactive, or past_due.
current_period_endstring | nullRequiredEnd of the current billing period.
periodstringRequiredQuota period type (month).
actionsobjectRequiredPer-action usage counters for the period.
storageobjectRequiredused_bytes, cap_bytes, and human-readable equivalents.
Example Request
curl "https://sharetopus.com/api/v1/usage" \
  -H "Authorization: Bearer stp_rest_YOUR_KEY"
Response · 200
{
  "plan": "creator",
  "status": "active",
  "current_period_end": "2026-07-28T00:00:00.000Z",
  "period": "month",
  "actions": { "rest.posts.create": 42, "rest.media.upload_url": 17 },
  "storage": {
    "used_bytes": 734003200,
    "cap_bytes": 5368709120,
    "used_human": "700 MB",
    "cap_human": "5 GB"
  }
}