Developers

Post from your system. The account owner approves.

One post, two calls

Upload the photo, create the post and hand the approval link to the account owner. Nothing is published without their go-ahead, confirmed through the network itself.

Request a key

No SDK: plain HTTP, from any language.

cURL

# 1. Upload the photo
MEDIA=$(curl -s -X POST https://pasla.com.br/api/v1/media \
  -H "Authorization: Bearer $PASLA_API_KEY" \
  -F "file=@foto.jpg" | jq -r .id)

# 2. Create the post: it waits for the account owner's approval
curl -s -X POST https://pasla.com.br/api/v1/posts \
  -H "Authorization: Bearer $PASLA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d "{\"account_id\":\"$PASLA_ACCOUNT_ID\",\"media_ids\":[\"$MEDIA\"],\"caption\":\"Summer collection\"}" \
  | jq '{status, approval_url}'

Node.js

import { readFile } from "node:fs/promises";

const API = "https://pasla.com.br/api/v1";
const auth = { Authorization: `Bearer ${process.env.PASLA_API_KEY}` };

// 1. Upload the photo
const form = new FormData();
form.append("file", new Blob([await readFile("foto.jpg")], { type: "image/jpeg" }), "foto.jpg");
const media = await (await fetch(`${API}/media`, { method: "POST", headers: auth, body: form })).json();

// 2. Create the post: it waits for the account owner's approval
const res = await fetch(`${API}/posts`, {
  method: "POST",
  headers: { ...auth, "Content-Type": "application/json", "Idempotency-Key": crypto.randomUUID() },
  body: JSON.stringify({
    account_id: process.env.PASLA_ACCOUNT_ID,
    media_ids: [media.id],
    caption: "Summer collection",
  }),
});
const post = await res.json();
console.log(post.status, post.approval_url); // awaiting_approval https://…

Python

import os, uuid
import requests  # pip install requests

API = "https://pasla.com.br/api/v1"
auth = {"Authorization": f"Bearer {os.environ['PASLA_API_KEY']}"}

# 1. Upload the photo
with open("foto.jpg", "rb") as f:
    media = requests.post(f"{API}/media", headers=auth,
                          files={"file": ("foto.jpg", f, "image/jpeg")}).json()

# 2. Create the post: it waits for the account owner's approval
post = requests.post(
    f"{API}/posts",
    headers={**auth, "Idempotency-Key": str(uuid.uuid4())},
    json={
        "account_id": os.environ["PASLA_ACCOUNT_ID"],
        "media_ids": [media["id"]],
        "caption": "Summer collection",
    },
).json()
print(post["status"], post["approval_url"])  # awaiting_approval https://…

Your agent drafts. You approve.

A Pasla MCP server for Claude Code, Cursor, Codex and other MCP clients. The agent creates and schedules posts through the API, and none goes out without the account owner's approval.

I want to try it first

Preview · in progress

› claude
› build the summer collection carousel for the shop's TikTok, Friday 6pm
✓ pasla · found the shop's account (@shop.example)
✓ 3 photos uploaded
✓ post created · tiktok · Friday, 18:00
→ waiting for the account owner to approve via the link
  • Claude Code
  • Cursor
  • Codex
  • MCP

From terminal to post

A small CLI for scripts and CI: the same flow as the API, with JSON output when you need it.

I want to try it first

Preview · in progress

$ pasla posts create --account acc_8Kq2 --media foto.jpg --caption "Summer collection"
✓ foto.jpg uploaded · med_3Fz9
✓ post_7Lw1 · awaiting approval
  https://pasla.com.br/aprovar/apr_…
  • posts
  • media
  • accounts
  • connect-link
  • usage

How it works

  • API key per organization, created in the dashboard (Organization → API keys) and sent as Authorization: Bearer. It is shown once and stored only as a hash. A psl_test_ key is the sandbox: everything works without touching the network.
  • Accounts: POST /v1/connect-links creates a link; the account owner signs in through the network's official login (OAuth). The API never receives the password.
  • Media: POST /v1/media by upload or https URL. JPEG or PNG up to 50 MB; no video yet.
  • Posts: POST /v1/posts returns awaiting_approval with an approval_url. The owner confirms through the network itself and approves; on TikTok they choose privacy, comments, commercial disclosure and music, with nothing pre-selected.
  • Signed webhooks (HMAC-SHA256) on every status change, retried for 24 hours.
  • No surprises: Idempotency-Key to avoid duplicate posts, RFC 9457 errors and per-organization limits.
  • Networks in the API: Instagram, TikTok and X.

Rules for API users

  • You need the owner's consent for every post on every account. Pasla shows the preview and asks for their approval.
  • On TikTok, privacy and commercial disclosure are chosen by the account owner, with no default.
  • Using the API for spam, the same content across many accounts or accounts you are not authorized to manage is forbidden.

API errors

Every error is application/problem+json (RFC 9457): branch on the code field. After fixing a 4xx error, repeat the POST with a new Idempotency-Key. Repeat with the same key for 429 (after Retry-After), 5xx, idempotency_in_progress and upload_not_found (after uploading the file).

CodeStatusWhat happenedWhat to do
invalid_json400The body is not valid JSON.Fix the JSON and send it again.
invalid_request400In MCP, the body is not a valid JSON-RPC message.Send one JSON-RPC message per request.
unauthorized401The request has no key.Send Authorization: Bearer with your key.
invalid_api_key401Invalid or revoked key.Check the key or create a new one in the dashboard.
forbidden403The key is not allowed to do this.Check the key permissions.
insufficient_scope403The key lacks a scope (see required_scope).Use a key that has that scope.
organization_inactive403The organization is suspended or closed.Contact the Pasla team.
origin_not_allowed403In MCP, the request origin is not allowed.Call MCP from an MCP client, not from a page on another domain.
not_found404Missing route or resource, malformed id, or another organization’s.Check the URL and the id.
account_not_found404The account does not exist in your organization.List your accounts and use one of their account_id values.
post_not_found404The post does not exist in your organization.Check the post id.
method_not_allowed405Wrong method for this route.Use one of the methods in the Allow header.
request_timeout408The request body did not arrive in time.Send it again on a stable connection or with a smaller file.
idempotency_key_reuse409The Idempotency-Key was used by another request.Use a new key for a new request.
idempotency_in_progress409The first request with this key is still running.Wait for Retry-After and repeat with the same key and body.
account_limit_reached409The organization reached its connected account limit.Disconnect an account or ask for a higher limit.
account_not_active409The account is not active.Check the account status and reconnect it if needed.
account_blocked409Pasla does not publish to this account.Use another account or contact the Pasla team.
reauthorization_required409The account lost its authorization on the network.Create a new connect link for the account owner.
duplicate_content409The same content was sent to another X account in the last 24 hours.Change the content or wait.
media_not_ready409One of the post media is not ready yet.Wait for status ready on GET /media/{id}, then create the post with a new Idempotency-Key.
media_expired409The file of one of the media was already deleted by retention.Upload the media again and create the post with the new media_id and a new Idempotency-Key.
upload_not_found409The uploaded file has not arrived yet.PUT the file to the signed URL and call again; the same Idempotency-Key works.
upload_expired409The upload window expired.Create a new upload and send the file again.
post_not_cancelable409The post is being sent or has finished.Read the post to see its status; it can no longer be canceled.
creator_cannot_post409TikTok does not let this account post right now.Try again later.
webhook_limit_reached409The organization reached its webhook endpoint limit.Remove an endpoint before creating another.
payload_too_large413The request body is too large.Send a smaller body.
media_too_large413 / 422The image or video is over the size limit.Reduce the file size or dimensions; for video, stay within the format limit.
media_quota_exceeded413The organization ran out of media quota.Contact the Pasla team to free up space.
validation_error422A field or parameter is invalid (see errors).Fix the listed fields.
redirect_url_not_allowed422The redirect_url is not in the organization’s allowed list.Add the URL in the dashboard or use an allowed one.
network_unavailable422Connecting this network is not available in this environment.Use another network or contact the Pasla team.
unsupported_network422This route does not support the account’s network.Use an account on a network the route supports.
unsupported_media_type422Unsupported file type: an image that is not JPEG or PNG, a video that is not MP4 or MOV, or media that does not fit the post format.Send JPEG or PNG (image) or MP4 or MOV (video), matching what the format needs.
invalid_media422Empty, animated or unreadable file.Send a valid static image.
media_url_not_allowed422The media URL is not allowed.Use a public https URL on port 443.
media_fetch_failed422The image could not be downloaded from the URL.Check that the URL responds without redirecting, or upload the file.
media_required422The post has no media.Send at least one media_id.
too_many_media422More media than the format accepts.Shorten the media_ids list.
caption_too_long422The caption is over the network limit.Shorten the caption.
media_aspect_ratio_unsupported422The photo or video aspect ratio is not accepted.Instagram photos: between 4:5 and 1.91:1. Video: see the ratio in the error message.
unsupported_format422The requested format does not exist on this network.Use one of the options.<network>.format values listed in the reference.
format_not_available422The format, or video upload, is not available yet.Use a format that is already available.
media_processing_failed422One of the media was rejected during verification.See the reason on GET /media/{id}, fix the file and upload another.
media_sandbox_only422Media uploaded with a test key used in a live post.Upload the media with a live key, or create the post with the test key.
video_duration_unsupported422The video duration is outside what the format accepts.Trim or extend the video to the range in the error message.
video_codec_unsupported422The video or audio codec is not accepted.Convert the file to a codec named in the error message.
video_frame_rate_unsupported422The video frame rate is not accepted.Export the video within the fps range in the error message.
video_resolution_unsupported422The video resolution is not accepted.Resize to the limits in the error message.
draft_not_supported422The network has no drafts through the API.Use mode "direct".
scheduled_in_past422scheduled_at is in the past.Send a future date.
scheduled_too_far422scheduled_at is more than 1 year away.Pick a closer date.
approval_expiry_invalid422approval.expires_at is outside the accepted range.Use a date between now and 30 days.
url_not_allowed422The webhook URL is not allowed.Use a public https URL on port 443.
invalid_events422The webhook event list is invalid.Use the API event types or "*".
rate_limited429The key went over the requests per minute limit.Wait for Retry-After and repeat the same request; for a POST, with the same Idempotency-Key.
daily_post_limit429The organization reached its daily post limit.Wait for Retry-After and repeat the same request with the same Idempotency-Key.
network_rate_limited429The social network blocked the request because of its quota.Wait for Retry-After and repeat the same request; for a POST, with the same Idempotency-Key.
internal_error500Something went wrong on Pasla’s side.Retry with the same Idempotency-Key.