Developers
Testing safely
A public sandbox with test data is on the way. Until then you build against yapfactory.com, and these rules keep testing from reaching anyone.
View as MarkdownStart read-only
- Make a key in Settings → AI agents → Make an API key and leave Let it act for me off. A read-only key can list and read everything you can see, and can't change anything.
- Explore with
GETcalls:/me,/campaigns,/creators,/deals. Nothing you read tells anyone. - When you're ready to act, make a second key that can. Revoke either one at any time.
What stays private
- Campaign drafts.
POST /campaignsmakes a draft that only you can see, and you can change the brief as often as you like. Nobody is told until you publish it. - Uploads. A file from
POST /posts/uploadssits unused until you schedule it. - Money never moves through the API. Starting a deal and approving a draft return a link to the deal page, where the person finishes the step.
What reaches other people
These calls tell someone straight away. They need an Idempotency-Key, and agents should get a clear yes from the person first:
- Publishing, pausing or closing a campaign, and inviting creators.
- Passing on a creator, asking for changes to a draft, and messaging on a deal.
- Asking to join a campaign and answering an invite (creators).
- Scheduling a post: it goes out publicly on your account at its time. Cancel it before then with
POST /posts/{postId}/cancel.
Want to try webhooks? Send test event in Settings → Webhooks delivers a signed ping to your endpoint without anything else happening.
Sandbox: coming soon
A separate sandbox with demo brands, creators and campaigns, where nothing reaches anyone and payments use Stripe test mode. Its keys will start with yf_test_. It will be listed in the changelog when it opens.
Before you go live
- Use the base URL
https://yapfactory.com/api/v1. - Make a
yf_live_key on yapfactory.com, with only the access you need (read-only if you never act). Keep it in a secret store, never in code. - OAuth apps: point your redirect URIs at your production app. Loopback addresses are for development.
- Send an
Idempotency-Keyon everyPOST,PATCHandDELETE, and reuse it when you retry. - Branch on
error.code, never onmessage. Log therequestId. - Handle
429: waitRetry-Afterseconds. Stay under 20 changes a minute per connection. - Page through lists with
cursoruntilhasMoreis false. - Add your production webhook endpoint in Settings → Webhooks. Each endpoint has its own
whsec_secret. Check signatures, and dedupe onYap-Event-Id. - Show people the handoff link for starting a deal and approving a draft. Never try to take payment yourself.
- Confirm with the person before anything that reaches other people: publishing, pausing or closing a campaign, inviting or passing on a creator, asking for changes to a draft, asking to join a campaign, answering an invite, sending a message and scheduling a post.