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

← REST API reference

Ask for changes to a draft

Send a draft back with notes, once the person has agreed them. Uses one of the included revision rounds (get_deal says how many are left). Once they're used, another round is paid and can only be asked for on the deal page: this returns the link instead. Approving a draft pays the creator, so that happens on the deal page too.

View as Markdown
POSThttps://yapfactory.com/api/v1/deals/{dealId}/revisions
Who can use itBrands
Tieroutbound: Reaches other people: an email, a notification or a public post.
Scopedeals:write, or write
Idempotency-KeyRequired
Rate limitWrites: 20 a minute, of which outbound: 10 a minute
MCP toolrequest_revision

This reaches other people or the public. If an agent makes the call, it should confirm the details with the person first.

Parameters

dealId
pathrequired
uuid

The deal's id.

notes
bodyrequired
string

What to change, specifically. 10 to 4000 characters.

Example request

curl -X POST "https://yapfactory.com/api/v1/deals/8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f/revisions" \
  -H "Authorization: Bearer $YAP_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "notes": "Open on the alarm going off, then show the app within the first 3 seconds."
  }'

Response

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

{
  "data": {
    "dealId": "3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19",
    "sentBack": true,
    "url": "https://yapfactory.com/deals/3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19"
  }
}

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), an unknown query parameter, or no Idempotency-Key.
unauthorized401No token, or it's wrong, expired, revoked or from the other environment.
insufficient_scope403The token doesn't have deals:write (or write).
forbidden403Only for brands, or the account can't do this yet (email not confirmed, paused).
not_found404No such deal, or it isn't yours.
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.