Launch offer: service fee 10% 4% until 31 Dec, just enough to cover card processing. See pricing

← REST API reference

Upload your own video or photo to post

Get a one-time upload link for a video (MP4 or MOV, up to 300 MB) or photo (JPG) to post on one of the brand's accounts. The file goes to uploadUrl with the given method and headers, and the returned upload object is what schedule_post takes. Only for clients that can send files.

View as Markdown
POSThttps://yapfactory.com/api/v1/posts/uploads
Who can use itBrands
Tierwrite: Changes your own things only. Nobody else is told.
Scopeposts:write, or write
Idempotency-KeyOptional, and recommended
Rate limitWrites: 20 a minute
MCP toolprepare_post_upload

Parameters

accountId
bodyrequired
uuid

The account the file is for.

filename
bodyrequired
string

The file's name, with its extension. 1 to 200 characters.

contentType
bodyrequired
string

video/mp4, video/quicktime or image/jpeg.

sizeBytes
bodyrequired
integer

The file's size in bytes. Up to 9007199254740991.

Example request

curl -X POST "https://yapfactory.com/api/v1/posts/uploads" \
  -H "Authorization: Bearer $YAP_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "accountId": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
    "filename": "launch.mp4",
    "contentType": "video/mp4",
    "sizeBytes": 18400000
  }'

Response

201 with the result in data: the same object the MCP tool returns.

{
  "data": {
    "uploadUrl": "https://uploads.yapfactory.com/posts/…?X-Amz-Signature=…",
    "method": "PUT",
    "headers": {
      "Content-Type": "video/mp4"
    },
    "upload": {
      "key": "posts/…/launch.mp4",
      "url": "https://uploads.yapfactory.com/posts/…/launch.mp4",
      "filename": "launch.mp4",
      "sizeBytes": 18400000
    },
    "next": "Send the file to uploadUrl, then pass `upload` in schedule_post's media."
  }
}

An example: fields that don't apply are null, and new fields can be added at any time, so ignore ones you don't know. Every response carries Request-Id and the RateLimit-* headers.

Errors

CodeStatusWhen
invalid_request400A field failed validation (see meta.issues), or an unknown query parameter.
unauthorized401No token, or it's wrong, expired, revoked or from the other environment.
insufficient_scope403The token doesn't have posts:write (or write).
forbidden403Only for brands, or the account can't do this yet (email not confirmed, paused).
conflict409Its current state doesn't allow this. message says why, in words you can show.
idempotency_conflict409The same Idempotency-Key came with a different body.
rate_limited429Over the limit. Wait for Retry-After seconds.
internal500Our fault. Retry later, and send us the requestId if it keeps happening.

Every error has the same shape. See Errors for what to do about each one.