/api/v1/meCurrent key, workspace and limits
Yanıtlar
- 200Me · The key and its workspace.
- 401Missing, unknown or revoked API key.
- 429Too many requests; wait
Retry-Afterseconds.
GeliştiricilerBeta
postyay REST API’si ve MCP sunucusu uygulamanın yaptığını yapar: medyayı yükler, aynı ön kontrolleri çalıştırır, TikTok ve Bluesky’a planlar ve her gönderiyi yayına girene kadar takip eder. Tek ihtiyacınız bir API anahtarı.
BetaAPI ve MCP sunucusu beta aşamasında ve beta sürdükçe her plana dahil. v1 sözleşmesi yalnızca büyür: alanlar eklenir, adı değişmez ve kaldırılmaz.
Sıfırdan yayındaki bir gönderiye beş adım. Örneklerin hepsi curl ile; anahtarınızı bir kez tanımlayın: export POSTYAY_API_KEY=pyk_live_….
Ayarlar → API anahtarları bölümüne gidin, anahtara bir ad verin (ör. “Zapier” ya da “Claude”) ve kopyalayın. Anahtarı yalnızca bir kez görürsünüz; biz sadece özetini (hash) saklarız.
Önce uygulamada TikTok ya da Bluesky hesabınızı bağlayın. Her hesabın id değeri, gönderinin gideceği yerdir; health hesabın yeniden bağlanması gerekip gerekmediğini söyler.
curl https://postyay.com/api/v1/accounts \
-H "Authorization: Bearer $POSTYAY_API_KEY"Dosyayı multipart olarak gönderin ya da herkese açık bir URL verin, biz indirelim. Dönen id değerini saklayın. Biçimi her platform için yayın sırasında biz dönüştürürüz.
curl https://postyay.com/api/v1/media \
-H "Authorization: Bearer $POSTYAY_API_KEY" \
-F [email protected]
# or let postyay download it
curl https://postyay.com/api/v1/media \
-H "Authorization: Bearer $POSTYAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://example.com/clip.mp4" }'Tek gönderi, birden çok hesap. TikTok için settings.privacyLevel zorunlu. schedule; "now", ISO 8601 bir zaman ya da "draft" olabilir. Önce uygulamadaki ön kontrollerin aynısı çalışır; sorun çıkaracak her şey violations olarak döner.
curl https://postyay.com/api/v1/posts \
-H "Authorization: Bearer $POSTYAY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"text": "Behind the scenes of the shoot #bts",
"mediaIds": ["MEDIA_ID"],
"targets": [
{ "accountId": "TIKTOK_ACCOUNT_ID",
"settings": { "privacyLevel": "PUBLIC_TO_EVERYONE", "allowComment": true } },
{ "accountId": "BLUESKY_ACCOUNT_ID",
"settings": { "altText": { "MEDIA_ID": "A camera crew on set" } } }
],
"schedule": "now"
}'
# "schedule": "2026-10-01T09:00:00+03:00" schedules it, "draft" only saves it.Gönderiyi birkaç saniyede bir sorgulayın. status değeri published olduğunda her hedefin canlı url adresi gelir. TikTok videolarının işlenmesi birkaç dakika sürebilir.
while :; do
status=$(curl -s https://postyay.com/api/v1/posts/POST_ID \
-H "Authorization: Bearer $POSTYAY_API_KEY" | jq -r .status)
echo "$status"
case "$status" in published|failed|needs_action|canceled) break ;; esac
sleep 5
done{
"id": "5b0e…",
"status": "published",
"source": "api",
"targets": [
{ "platform": "tiktok", "status": "published",
"url": "https://www.tiktok.com/@you/video/7431…" },
{ "platform": "bluesky", "status": "published",
"url": "https://bsky.app/profile/you.bsky.social/post/3l…" }
]
}Anahtarı her isteğin Authorization başlığında gönderin: Bearer pyk_live_….
Her hata aynı biçimdedir. requestId ayrıca x-trace-id başlığında da gelir; destekle iletişime geçerken bu değeri paylaşın.
{
"code": "PREFLIGHT",
"message": "TikTok allows 2,200 characters — you're 100 over.",
"requestId": "3f0c9d2e-…",
"violations": [
{ "accountId": "…", "platform": "tiktok", "code": "text_too_long",
"message": "TikTok allows 2,200 characters — you're 100 over.",
"params": { "max": 2200, "over": 100 },
"fix": { "mode": "manual", "action": "shorten_text" } }
]
}VALIDATION_ERROR hatasına details (hatalı alanlar) eklenir. PREFLIGHT hatasına violations eklenir: her sorun için bir kayıt; hesap, platform ve text_too_long ya da media_required gibi sabit bir code ile.
Sınırlar anahtar başınadır ve bir dakikalık pencerelerle sayılır: dakikada 60 istek, bunların en fazla 10 tanesi gönderi oluşturabilir. MCP araç çağrıları da aynı bütçeden düşer.
Her yanıt nerede olduğunuzu söyler: RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset (saniye) ve RateLimit-Policy. Sınırı aşınca Retry-After ile birlikte 429 RATE_LIMITED alırsınız.
RateLimit-Policy: 60;w=60, 10;w=60;comment="posts"
RateLimit-Limit: 60
RateLimit-Remaining: 0
RateLimit-Reset: 23
Retry-After: 23Gönderiler, uygulamada oluşturulanlar gibi planınızın aylık gönderi sınırına da sayılır. Kullanımınızı GET /api/v1/me gösterir.
Listeler en yeniden eskiye { data, nextCursor } döner. limit (1–100, varsayılan 25) gönderin; sonraki sayfa için cursor=nextCursor ekleyin. Son sayfada nextCursor değeri null olur. GET /api/v1/posts ayrıca status, accountId, from ve to ile süzülebilir.
curl "https://postyay.com/api/v1/posts?status=scheduled&limit=50" \
-H "Authorization: Bearer $POSTYAY_API_KEY"
# next page
curl "https://postyay.com/api/v1/posts?status=scheduled&limit=50&cursor=NEXT_CURSOR" \
-H "Authorization: Bearer $POSTYAY_API_KEY"Ağ aksaklıkları olur. POST /api/v1/posts isteğine bir Idempotency-Key başlığı (ör. bir UUID) ekleyin ve gönül rahatlığıyla yeniden deneyin: 24 saat boyunca aynı anahtar ve aynı gövde, ikinci bir gönderi oluşturmak yerine ilk sonucu Idempotent-Replayed: true ile döndürür. Aynı anahtar farklı bir gövdeyle gelirse reddedilir.
Bir gönderi bir ya da daha çok hesaba gider; her biri kendi durumu olan bir hedeftir. Gönderinin status değeri, hedeflerinin en acil olanıdır.
postyay Model Context Protocol’ü destekler; yapay zekâ asistanları gönderilerinizi sizin için planlayabilir: “bu videoyu yarın saat 9’da TikTok ve Bluesky’a gönder”. REST API ile aynı anahtarı, sınırları ve kontrolleri kullanır.
Uç nokta
https://postyay.com/mcp
Streamable HTTP (durumsuz, JSON yanıtlar). Kimlik doğrulama: Authorization: Bearer pyk_live_….
Tek komut sunucuyu anahtarınızla ekler:
claude mcp add --transport http postyay https://postyay.com/mcp \
--header "Authorization: Bearer pyk_live_…"Şunu claude_desktop_config.json dosyasına ekleyin (Ayarlar → Geliştirici → Yapılandırmayı düzenle) ve Claude’u yeniden başlatın. mcp-remote uzak sunucuya köprü kurar ve anahtarınızı başlık olarak gönderir.
{
"mcpServers": {
"postyay": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://postyay.com/mcp",
"--header", "Authorization:${POSTYAY_API_KEY}"],
"env": { "POSTYAY_API_KEY": "Bearer pyk_live_…" }
}
}
}Uzak bir MCP sunucusu için HTTP başlığı tanımlamanıza izin veren her istemci, URL ve başlıkla çalışır:
{
"mcpServers": {
"postyay": {
"url": "https://postyay.com/mcp",
"headers": { "Authorization": "Bearer pyk_live_…" }
}
}
}Bu bağlayıcılar OAuth ile oturum açar (ya da kimlik doğrulamasız bağlanır) ve API anahtarı gönderemez. postyay’in MCP sunucusu şimdilik yalnızca API anahtarıyla çalıştığı için bu bağlayıcılar henüz desteklenmiyor. OAuth ile oturum açma planlarımızda var. O zamana kadar Claude Desktop, Claude Code ya da başlık gönderebilen başka bir istemci kullanın.
API’nin doğrulamada kullandığı şemaların aynısından üretilir. Temel URL: https://postyay.com/api/v1. OpenAPI belgesini Postman’e, Insomnia’ya ya da kod üreticinize aktarabilirsiniz.
/api/v1/meRetry-After seconds./api/v1/accountsEvery connected account with its health. Use the id as a post target.
Retry-After seconds./api/v1/mediaSend the file as multipart/form-data (one file part), or JSON { "url": "https://…" } and we download it. Videos (MP4, MOV, WebM), photos (JPEG, PNG, WebP, GIF, HEIC, AVIF) and PDFs. Conversion for each platform happens at publish time.
VALIDATION_ERROR (see details), PREFLIGHT (see violations), or another request problem.Retry-After seconds./api/v1/media/uploadsFor big videos: returns a presigned URL; PUT the file there with the given headers, then call POST /media/{id}/complete. Available when postyay stores media in object storage; otherwise 409 DIRECT_UPLOAD_UNAVAILABLE (use POST /media).
VALIDATION_ERROR (see details), PREFLIGHT (see violations), or another request problem.Retry-After seconds./api/v1/media/{id}/completeChecks what arrived, reads the file’s details and marks it ready. Safe to call again.
VALIDATION_ERROR (see details), PREFLIGHT (see violations), or another request problem.Retry-After seconds./api/v1/media/{id}Retry-After seconds./api/v1/postsNewest first, paginated with cursor.
nextCursor from the previous page.VALIDATION_ERROR (see details), PREFLIGHT (see violations), or another request problem.Retry-After seconds./api/v1/postsValidates accounts, media and per-platform settings, runs pre-flight (text length, media type, duration, aspect…) for every target, and schedules it. Problems come back as 400 PREFLIGHT with violations. Send an Idempotency-Key header to retry safely: the same key and body within 24 hours returns the first result (Idempotent-Replayed: true).
VALIDATION_ERROR (see details), PREFLIGHT (see violations), or another request problem.PLAN_LIMIT_POSTS).Retry-After seconds./api/v1/posts/{id}Each target’s status, timeline and, once published, its live url.
Retry-After seconds./api/v1/posts/{id}Send only what changes, e.g. { "schedule": "2026-10-01T09:00:00Z" }. Pre-flight runs again. 409 NOT_EDITABLE once a target is publishing or published.
VALIDATION_ERROR (see details), PREFLIGHT (see violations), or another request problem.PLAN_LIMIT_POSTS).Retry-After seconds./api/v1/posts/{id}Cancels every target that hasn’t published. Already-published posts stay on the platform. 409 IN_FLIGHT while it is publishing.
Retry-After seconds.http(s) URL of a video, photo or PDF. Redirects are followed; private addresses are refused.video/mp4.yourBrand and/or brandedContent. Default: false.SELF_ONLY. Default: false.GET /v1/accounts.TikTokSettings (TikTok needs privacyLevel) and BlueskySettings. Default: {}.POST /v1/media, in order. Default: []."now" publishes within seconds, an ISO 8601 time schedules it, "draft" saves it without scheduling (drafts may be incomplete).null removes it."now" publishes within seconds, an ISO 8601 time schedules it, "draft" saves it without scheduling (drafts may be incomplete).text_too_long, video_too_long, media_required.manual: change the content. confirm: we can fix it in the app (crop, trim) once you agree.VALIDATION_ERROR, PREFLIGHT, RATE_LIMITED, NOT_FOUND.x-trace-id header.VALIDATION_ERROR.@username on TikTok and Bluesky.reconnect_required: posts to it can’t publish until it is reconnected in the app.ready media can be attached to a post.draft → scheduled → queued → preparing → publishing → processing → published; or needs_action / failed / canceled.needs_action beats published).cursor for the next page; null on the last one.cursor for the next page; null on the last one.null: unlimited.