Developers
Post from your system. The account owner approves.
By invitation: API v1 already runs in the Pasla environment and is opening to a few customers. Keys come with access.
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 keyNo 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 firstPreview · 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 firstPreview · 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. Apsl_test_key is the sandbox: everything works without touching the network. - Accounts:
POST /v1/connect-linkscreates a link; the account owner signs in through the network's official login (OAuth). The API never receives the password. - Media:
POST /v1/mediaby upload or https URL. JPEG or PNG up to 50 MB; no video yet. - Posts:
POST /v1/postsreturnsawaiting_approvalwith anapproval_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-Keyto 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).
| Code | Status | What happened | What to do |
|---|---|---|---|
invalid_json | 400 | The body is not valid JSON. | Fix the JSON and send it again. |
invalid_request | 400 | In MCP, the body is not a valid JSON-RPC message. | Send one JSON-RPC message per request. |
unauthorized | 401 | The request has no key. | Send Authorization: Bearer with your key. |
invalid_api_key | 401 | Invalid or revoked key. | Check the key or create a new one in the dashboard. |
forbidden | 403 | The key is not allowed to do this. | Check the key permissions. |
insufficient_scope | 403 | The key lacks a scope (see required_scope). | Use a key that has that scope. |
organization_inactive | 403 | The organization is suspended or closed. | Contact the Pasla team. |
origin_not_allowed | 403 | In MCP, the request origin is not allowed. | Call MCP from an MCP client, not from a page on another domain. |
not_found | 404 | Missing route or resource, malformed id, or another organization’s. | Check the URL and the id. |
account_not_found | 404 | The account does not exist in your organization. | List your accounts and use one of their account_id values. |
post_not_found | 404 | The post does not exist in your organization. | Check the post id. |
method_not_allowed | 405 | Wrong method for this route. | Use one of the methods in the Allow header. |
request_timeout | 408 | The request body did not arrive in time. | Send it again on a stable connection or with a smaller file. |
idempotency_key_reuse | 409 | The Idempotency-Key was used by another request. | Use a new key for a new request. |
idempotency_in_progress | 409 | The first request with this key is still running. | Wait for Retry-After and repeat with the same key and body. |
account_limit_reached | 409 | The organization reached its connected account limit. | Disconnect an account or ask for a higher limit. |
account_not_active | 409 | The account is not active. | Check the account status and reconnect it if needed. |
account_blocked | 409 | Pasla does not publish to this account. | Use another account or contact the Pasla team. |
reauthorization_required | 409 | The account lost its authorization on the network. | Create a new connect link for the account owner. |
duplicate_content | 409 | The same content was sent to another X account in the last 24 hours. | Change the content or wait. |
media_not_ready | 409 | One 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_expired | 409 | The 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_found | 409 | The uploaded file has not arrived yet. | PUT the file to the signed URL and call again; the same Idempotency-Key works. |
upload_expired | 409 | The upload window expired. | Create a new upload and send the file again. |
post_not_cancelable | 409 | The post is being sent or has finished. | Read the post to see its status; it can no longer be canceled. |
creator_cannot_post | 409 | TikTok does not let this account post right now. | Try again later. |
webhook_limit_reached | 409 | The organization reached its webhook endpoint limit. | Remove an endpoint before creating another. |
payload_too_large | 413 | The request body is too large. | Send a smaller body. |
media_too_large | 413 / 422 | The image or video is over the size limit. | Reduce the file size or dimensions; for video, stay within the format limit. |
media_quota_exceeded | 413 | The organization ran out of media quota. | Contact the Pasla team to free up space. |
validation_error | 422 | A field or parameter is invalid (see errors). | Fix the listed fields. |
redirect_url_not_allowed | 422 | The redirect_url is not in the organization’s allowed list. | Add the URL in the dashboard or use an allowed one. |
network_unavailable | 422 | Connecting this network is not available in this environment. | Use another network or contact the Pasla team. |
unsupported_network | 422 | This route does not support the account’s network. | Use an account on a network the route supports. |
unsupported_media_type | 422 | Unsupported 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_media | 422 | Empty, animated or unreadable file. | Send a valid static image. |
media_url_not_allowed | 422 | The media URL is not allowed. | Use a public https URL on port 443. |
media_fetch_failed | 422 | The image could not be downloaded from the URL. | Check that the URL responds without redirecting, or upload the file. |
media_required | 422 | The post has no media. | Send at least one media_id. |
too_many_media | 422 | More media than the format accepts. | Shorten the media_ids list. |
caption_too_long | 422 | The caption is over the network limit. | Shorten the caption. |
media_aspect_ratio_unsupported | 422 | The 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_format | 422 | The requested format does not exist on this network. | Use one of the options.<network>.format values listed in the reference. |
format_not_available | 422 | The format, or video upload, is not available yet. | Use a format that is already available. |
media_processing_failed | 422 | One of the media was rejected during verification. | See the reason on GET /media/{id}, fix the file and upload another. |
media_sandbox_only | 422 | Media 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_unsupported | 422 | The video duration is outside what the format accepts. | Trim or extend the video to the range in the error message. |
video_codec_unsupported | 422 | The video or audio codec is not accepted. | Convert the file to a codec named in the error message. |
video_frame_rate_unsupported | 422 | The video frame rate is not accepted. | Export the video within the fps range in the error message. |
video_resolution_unsupported | 422 | The video resolution is not accepted. | Resize to the limits in the error message. |
draft_not_supported | 422 | The network has no drafts through the API. | Use mode "direct". |
scheduled_in_past | 422 | scheduled_at is in the past. | Send a future date. |
scheduled_too_far | 422 | scheduled_at is more than 1 year away. | Pick a closer date. |
approval_expiry_invalid | 422 | approval.expires_at is outside the accepted range. | Use a date between now and 30 days. |
url_not_allowed | 422 | The webhook URL is not allowed. | Use a public https URL on port 443. |
invalid_events | 422 | The webhook event list is invalid. | Use the API event types or "*". |
rate_limited | 429 | The 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_limit | 429 | The organization reached its daily post limit. | Wait for Retry-After and repeat the same request with the same Idempotency-Key. |
network_rate_limited | 429 | The 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_error | 500 | Something went wrong on Pasla’s side. | Retry with the same Idempotency-Key. |