{
  "openapi": "3.1.0",
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "info": {
    "title": "Yap Factory API",
    "version": "1.0.0",
    "summary": "The UGC marketplace for brands: campaigns, creators, deals and scheduled posts.",
    "description": "REST API v1. The same operations as the MCP server at /mcp, with the same tokens.\n\n- Success: `{ \"data\": … }`. Lists: `{ \"data\": [ … ], \"nextCursor\", \"hasMore\" }`. Errors: `{ \"error\": { \"code\", \"message\", \"requestId\", \"meta\"? } }`.\n- Money is `{ minor, currency, formatted }` in integer minor units. Times are ISO 8601 UTC. Ids are UUIDs.\n- Send `Idempotency-Key` on POST, PATCH and DELETE; it's required on outbound operations. Only a success is stored and replayed.\n- Rate limits per minute: 120 reads, 20 writes and 10 outbound per connection; 300, 40 and 15 per person across connections.\n- A field the operation doesn't know returns `400 invalid_request`.\n- Money never moves through the API: `money` operations return a handoff link to yapfactory.com.\n\nDocs: https://yapfactory.com/developers",
    "contact": {
      "name": "Yap Factory support",
      "email": "support@yapfactory.com",
      "url": "https://yapfactory.com/developers"
    },
    "termsOfService": "https://yapfactory.com/terms"
  },
  "servers": [
    {
      "url": "https://yapfactory.com/api/v1",
      "description": "Production (yf_live_ keys)"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    },
    {
      "oauth2": []
    }
  ],
  "tags": [
    {
      "name": "Account",
      "description": "Who is signed in and what this connection can do."
    },
    {
      "name": "Deals",
      "description": "A deal is one creator making the videos for one campaign. Both sides can read and message."
    },
    {
      "name": "Campaigns",
      "description": "A brand's campaigns: the brief, the shortlist and the invites."
    },
    {
      "name": "Creators",
      "description": "Creators a brand can invite, as brands see them."
    },
    {
      "name": "Marketplace",
      "description": "Live campaigns, as creators see them."
    },
    {
      "name": "Posts",
      "description": "Schedule videos and photos to the brand's own TikTok and Instagram accounts. On TikTok the person always chooses the audience; there's no default, and comments, Duet and Stitch start off."
    },
    {
      "name": "Webhooks",
      "description": "Signed events we send to your endpoint."
    }
  ],
  "paths": {
    "/me": {
      "get": {
        "operationId": "get_account",
        "summary": "Your Yap Factory account",
        "description": "Who is signed in: brand and/or creator, country and currency, what this connection is allowed to do, and the one next thing worth doing (gettingStarted). Shows which tools apply to this account.\n\nTier `read`: changes nothing. For: Everyone. MCP tool: `get_account`.\n\nDocs: https://yapfactory.com/developers/api/get_account",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "account:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "name": "Dana Lee",
                    "email": "dana@sleepwell.app",
                    "country": "US",
                    "currency": "USD",
                    "sides": [
                      "brand"
                    ],
                    "brand": {
                      "company": "Sleepwell",
                      "country": "US",
                      "paused": false,
                      "home": "https://yapfactory.com/brand"
                    },
                    "creator": null,
                    "canAct": true,
                    "gettingStarted": {
                      "step": "review_draft",
                      "say": "Maya R.'s draft is ready to review.",
                      "url": "https://yapfactory.com/deals/3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19"
                    },
                    "environment": "live",
                    "connection": {
                      "app": "API key",
                      "kind": "api_key",
                      "scopes": [
                        "read",
                        "write"
                      ],
                      "manage": "https://yapfactory.com/brand/settings#agents"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "read",
        "x-yap-side": "account",
        "x-yap-scope": "account:read",
        "x-yap-mcp-tool": "get_account"
      }
    },
    "/deals": {
      "get": {
        "operationId": "list_deals",
        "summary": "List deals",
        "description": "Deals you're part of, newest activity first, with each one's status and what happens next. A deal is one creator making videos for one campaign.\n\nTier `read`: changes nothing. For: Everyone. MCP tool: `list_deals`.\n\nDocs: https://yapfactory.com/developers/api/list_deals",
        "tags": [
          "Deals"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "deals:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "open: still in progress (default). closed: finished, declined or cancelled.",
            "schema": {
              "default": "open",
              "type": "string",
              "enum": [
                "open",
                "closed",
                "all"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of deals.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListEnvelope"
                },
                "example": {
                  "data": [
                    {
                      "id": "3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19",
                      "side": "brand",
                      "status": "draft_submitted",
                      "open": true,
                      "campaign": "Morning routine with Sleepwell",
                      "with": "Maya R.",
                      "brandPays": {
                        "minor": 2750,
                        "currency": "USD",
                        "formatted": "$27.50"
                      },
                      "updatedAt": "2026-12-08T16:12:04.000Z",
                      "url": "https://yapfactory.com/deals/3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19"
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false,
                  "meta": {
                    "total": 3
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "read",
        "x-yap-side": "account",
        "x-yap-scope": "deals:read",
        "x-yap-mcp-tool": "list_deals"
      }
    },
    "/deals/{dealId}": {
      "get": {
        "operationId": "get_deal",
        "summary": "Get a deal",
        "description": "One deal in full: the offer, status, whose move it is, the latest draft's review state, recent messages and the link to the deal page. Paying, approving a draft and cancelling happen on that page.\n\nTier `read`: changes nothing. For: Everyone. MCP tool: `get_deal`.\n\nDocs: https://yapfactory.com/developers/api/get_deal",
        "tags": [
          "Deals"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "deals:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "dealId",
            "in": "path",
            "required": true,
            "description": "The deal's id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "messages",
            "in": "query",
            "required": false,
            "description": "How many recent messages to include",
            "schema": {
              "default": 10,
              "type": "integer",
              "minimum": 0,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "id": "3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19",
                    "you": "brand",
                    "status": "draft_submitted",
                    "nextStep": "Review the draft by 11 Dec",
                    "outcome": null,
                    "campaign": {
                      "id": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
                      "title": "Morning routine with Sleepwell",
                      "product": "Sleepwell"
                    },
                    "with": "Maya R.",
                    "offer": {
                      "brandPays": {
                        "minor": 2750,
                        "currency": "USD",
                        "formatted": "$27.50"
                      },
                      "serviceFee": {
                        "minor": 250,
                        "currency": "USD",
                        "formatted": "$2.50"
                      },
                      "creatorEarns": {
                        "minor": 2500,
                        "currency": "USD",
                        "formatted": "$25.00"
                      },
                      "lines": [
                        {
                          "label": "1 × 30s video creation fee",
                          "amount": {
                            "minor": 2500,
                            "currency": "USD",
                            "formatted": "$25.00"
                          }
                        },
                        {
                          "label": "Licence: Brand's channels, no ads",
                          "amount": {
                            "minor": 0,
                            "currency": "USD",
                            "formatted": "$0.00"
                          }
                        }
                      ],
                      "adRights": "Brand's channels, no ads",
                      "deadline": "2026-12-16T12:00:00.000Z",
                      "accessBy": "2026-12-04T12:00:00.000Z",
                      "lengthSeconds": 30,
                      "revisionRoundsIncluded": 3,
                      "revisionsUsed": 0
                    },
                    "dates": {
                      "invited": "2026-12-02T09:39:13.000Z",
                      "inviteExpires": "2026-12-05T09:39:13.000Z",
                      "accepted": "2026-12-02T14:46:04.000Z",
                      "paymentDue": null,
                      "funded": "2026-12-03T10:02:10.000Z",
                      "draftDue": "2026-12-10T10:02:10.000Z",
                      "reviewDue": "2026-12-11T16:12:04.000Z",
                      "closed": null
                    },
                    "paymentSecured": true,
                    "latestDraft": {
                      "version": 1,
                      "submittedAt": "2026-12-08T16:12:04.000Z",
                      "review": "pending",
                      "notes": null,
                      "creatorNote": "Went with the 2am hook.",
                      "previewReady": true
                    },
                    "messages": [
                      {
                        "from": "Maya",
                        "at": "2026-12-08T16:13:20.000Z",
                        "text": "Draft is up. Happy to reshoot the opening if you'd like it brighter."
                      }
                    ],
                    "canMessage": true,
                    "url": "https://yapfactory.com/deals/3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19",
                    "onSiteOnly": "Starting the deal (charges the brand's card), approving a draft (pays the creator), uploading drafts, cancelling and disputes happen on the deal page."
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "read",
        "x-yap-side": "account",
        "x-yap-scope": "deals:read",
        "x-yap-mcp-tool": "get_deal"
      }
    },
    "/deals/{dealId}/messages": {
      "post": {
        "operationId": "send_deal_message",
        "summary": "Message the other side of a deal",
        "description": "Send a message in a deal's chat. The other side gets it in the app (and by email if they allow it). Contact details and off-platform payment talk are blocked. Feedback on a draft goes through request_revision, which gives the creator the notes to work from. For use once the person has agreed the words.\n\nTier `outbound`: other people are told (an email, a notification or a public post). Idempotency-Key is required. For: Everyone. MCP tool: `send_deal_message`.\n\nDocs: https://yapfactory.com/developers/api/send_deal_message",
        "tags": [
          "Deals"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "deals:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "dealId",
            "in": "path",
            "required": true,
            "description": "The deal's id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "description": "The message, in plain words. No contact details or payment talk"
                  }
                },
                "required": [
                  "body"
                ],
                "additionalProperties": false
              },
              "example": {
                "body": "Hi Maya, the login for the app is in the brief. Shout if anything is unclear."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "sent": true,
                    "dealId": "3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19",
                    "url": "https://yapfactory.com/deals/3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`conflict`: The state doesn't allow it. `message` is written for people. `idempotency_conflict`: Same Idempotency-Key with a different body.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "outbound",
        "x-yap-side": "account",
        "x-yap-scope": "deals:write",
        "x-yap-mcp-tool": "send_deal_message"
      }
    },
    "/creators": {
      "get": {
        "operationId": "search_creators",
        "summary": "Search creators",
        "description": "Browse UGC creators you can invite: niches, rating, delivery record, rate per video and sample videos (each with a link that plays it on Yap Factory). With campaignId, results are ranked by fit for that campaign. A live campaign's ranked shortlist is already in get_campaign; search finds more or different creators.\n\nTier `read`: changes nothing. For: Brands. MCP tool: `search_creators`.\n\nDocs: https://yapfactory.com/developers/api/search_creators",
        "tags": [
          "Creators"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "creators:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Words to match in names, summaries and niches",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "niches",
            "in": "query",
            "required": false,
            "description": "Only creators in these niches, e.g. skincare, fitness, pets",
            "schema": {
              "maxItems": 10,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 40
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "ISO country code such as US or GB",
            "schema": {
              "type": "string",
              "maxLength": 10
            }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "Only creators with this platform linked",
            "schema": {
              "type": "string",
              "enum": [
                "tiktok",
                "instagram",
                "youtube"
              ]
            }
          },
          {
            "name": "priceBand",
            "in": "query",
            "required": false,
            "description": "Rate per video: new (lowest), intermediate (rising creators) or specialist (established creators)",
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "intermediate",
                "specialist"
              ]
            }
          },
          {
            "name": "verifiedOnly",
            "in": "query",
            "required": false,
            "description": "Only creators who passed an ID check",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "minRating",
            "in": "query",
            "required": false,
            "description": "Only creators rated at least this, out of 5",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 5
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "required": false,
            "description": "One of your live campaigns, to rank and show fit for it",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "relevance: best fit first (default). price: lowest rate first. rating: best rated first",
            "schema": {
              "type": "string",
              "enum": [
                "relevance",
                "price",
                "rating"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of creators.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListEnvelope"
                },
                "example": {
                  "data": [
                    {
                      "id": "c9f0f895-fb98-4ab3-8e3c-1d2f3a4b5c6d",
                      "name": "Maya R.",
                      "summary": "Sleep, wellness and slow mornings. I film in one take.",
                      "niches": [
                        "wellness",
                        "lifestyle"
                      ],
                      "country": "US",
                      "languages": [
                        "en"
                      ],
                      "platforms": [
                        "tiktok"
                      ],
                      "rate": {
                        "minor": 2500,
                        "currency": "USD",
                        "formatted": "$25.00"
                      },
                      "rating": 4.9,
                      "reviews": 12,
                      "idVerified": true,
                      "completedDeals": 14,
                      "onTimeRate": 0.93,
                      "brandVideos": 9,
                      "medianViews": 23049,
                      "reasons": [
                        "9 prior brand videos averaging 23k views"
                      ],
                      "fit": "Makes wellness content",
                      "videos": [
                        {
                          "id": "5d0c9a7e-2b41-4f6a-8c3d-1e9f7a6b5c42",
                          "platform": "tiktok",
                          "watch": "https://yapfactory.com/c/c9f0f895-fb98-4ab3-8e3c-1d2f3a4b5c6d?video=5d0c9a7e-2b41-4f6a-8c3d-1e9f7a6b5c42",
                          "thumbnail": "https://yapfactory.com/api/uploads/social/…/cover.jpg",
                          "views": 23049
                        }
                      ],
                      "profile": "https://yapfactory.com/c/c9f0f895-fb98-4ab3-8e3c-1d2f3a4b5c6d"
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false,
                  "meta": {
                    "page": 1,
                    "pages": 4,
                    "matched": 85,
                    "currency": "USD",
                    "focusCampaign": {
                      "id": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
                      "title": "Morning routine with Sleepwell"
                    },
                    "note": "Rates are the creator's per video before the Yap Factory service fee. Inviting is free."
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "read",
        "x-yap-side": "brand",
        "x-yap-scope": "creators:read",
        "x-yap-mcp-tool": "search_creators"
      }
    },
    "/creators/{creatorId}": {
      "get": {
        "operationId": "get_creator",
        "summary": "Get a creator",
        "description": "A creator's profile as brands see it: summary, niches, audience, rating, delivery record, rate and their videos per platform. Each video has a `watch` link that plays it on Yap Factory; social handles and links to the creator's own accounts are never included.\n\nTier `read`: changes nothing. For: Brands. MCP tool: `get_creator`.\n\nDocs: https://yapfactory.com/developers/api/get_creator",
        "tags": [
          "Creators"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "creators:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "creatorId",
            "in": "path",
            "required": true,
            "description": "The creator's id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "required": false,
            "description": "One of your campaigns, to see how this creator fits it",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "id": "c9f0f895-fb98-4ab3-8e3c-1d2f3a4b5c6d",
                    "name": "Maya R.",
                    "summary": "Sleep, wellness and slow mornings. I film in one take.",
                    "niches": [
                      "wellness",
                      "lifestyle"
                    ],
                    "country": "US",
                    "audience": "71% US audience",
                    "idVerified": true,
                    "rating": 4.9,
                    "reviews": 12,
                    "onTimeRate": 0.93,
                    "completedDeals": 14,
                    "videosPerWeek": 3,
                    "rate": {
                      "minor": 2500,
                      "currency": "USD",
                      "formatted": "$25.00"
                    },
                    "platforms": [
                      {
                        "platform": "tiktok",
                        "brandVideos": 9,
                        "medianViews": 23049,
                        "videos": [
                          {
                            "id": "5d0c9a7e-2b41-4f6a-8c3d-1e9f7a6b5c42",
                            "watch": "https://yapfactory.com/c/c9f0f895-fb98-4ab3-8e3c-1d2f3a4b5c6d?video=5d0c9a7e-2b41-4f6a-8c3d-1e9f7a6b5c42",
                            "thumbnail": "https://yapfactory.com/api/uploads/social/…/cover.jpg",
                            "views": 23049,
                            "brandWork": true
                          }
                        ]
                      }
                    ],
                    "profile": "https://yapfactory.com/c/c9f0f895-fb98-4ab3-8e3c-1d2f3a4b5c6d"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "read",
        "x-yap-side": "brand",
        "x-yap-scope": "creators:read",
        "x-yap-mcp-tool": "get_creator"
      }
    },
    "/products": {
      "get": {
        "operationId": "list_products",
        "summary": "List your products",
        "description": "The products (apps, sites or brands) on your account. Every campaign is for one of them.\n\nTier `read`: changes nothing. For: Brands. MCP tool: `list_products`.\n\nDocs: https://yapfactory.com/developers/api/list_products",
        "tags": [
          "Campaigns"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "campaigns:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of products.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListEnvelope"
                },
                "example": {
                  "data": [
                    {
                      "id": "5d41402a-bc4b-4a76-b971-9e3f2c1d0a8b",
                      "name": "Sleepwell",
                      "platform": "ios",
                      "url": "https://apps.apple.com/app/id0000000000",
                      "category": "Health & Fitness",
                      "campaigns": 2
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "read",
        "x-yap-side": "brand",
        "x-yap-scope": "campaigns:read",
        "x-yap-mcp-tool": "list_products"
      }
    },
    "/campaigns": {
      "get": {
        "operationId": "list_campaigns",
        "summary": "List campaigns",
        "description": "Your campaigns with status (draft, live, paused, closed), price per video and how many creators are invited, working or done.\n\nTier `read`: changes nothing. For: Brands. MCP tool: `list_campaigns`.\n\nDocs: https://yapfactory.com/developers/api/list_campaigns",
        "tags": [
          "Campaigns"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "campaigns:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only campaigns in this status",
            "schema": {
              "default": "any",
              "type": "string",
              "enum": [
                "draft",
                "live",
                "paused",
                "closed",
                "any"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of campaigns.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListEnvelope"
                },
                "example": {
                  "data": [
                    {
                      "id": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
                      "title": "Morning routine with Sleepwell",
                      "status": "live",
                      "product": "Sleepwell",
                      "videosPerCreator": 1,
                      "budgetPerVideo": {
                        "minor": 3000,
                        "currency": "USD",
                        "formatted": "$30.00"
                      },
                      "deadline": "2026-12-16T12:00:00.000Z",
                      "creators": {
                        "shortlisted": 12,
                        "invited": 3,
                        "saidYes": 1,
                        "working": 1,
                        "done": 0
                      },
                      "url": "https://yapfactory.com/brand/campaigns/8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f"
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "read",
        "x-yap-side": "brand",
        "x-yap-scope": "campaigns:read",
        "x-yap-mcp-tool": "list_campaigns"
      },
      "post": {
        "operationId": "create_campaign_draft",
        "summary": "Draft a campaign",
        "description": "Create a campaign draft with its brief. Nobody sees a draft until publish_campaign makes it live, so the person can review it first. Takes productId, or product to add a new one.\n\nTier `write`: changes your own things only. For: Brands. MCP tool: `create_campaign_draft`.\n\nDocs: https://yapfactory.com/developers/api/create_campaign_draft",
        "tags": [
          "Campaigns"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "campaigns:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "productId": {
                    "description": "From list_products",
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "product": {
                    "description": "A new product, when productId isn't given",
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80,
                        "description": "The product's name"
                      },
                      "url": {
                        "description": "App Store, Play Store or website link",
                        "type": "string",
                        "maxLength": 500,
                        "format": "uri"
                      },
                      "platform": {
                        "type": "string",
                        "enum": [
                          "ios",
                          "android",
                          "web"
                        ],
                        "description": "Where people use it"
                      },
                      "description": {
                        "description": "What it is and who it's for",
                        "type": "string",
                        "maxLength": 2000
                      }
                    },
                    "required": [
                      "name",
                      "platform"
                    ]
                  },
                  "title": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 100,
                    "description": "The campaign's name, as creators see it"
                  },
                  "template": {
                    "default": "one_video",
                    "description": "one_video: 1 video for your own channels. test_openings: 1 video with 3 openings. ad_bundle: 3 videos you can run as ads for 3 months.",
                    "type": "string",
                    "enum": [
                      "one_video",
                      "test_openings",
                      "ad_bundle"
                    ]
                  },
                  "videos": {
                    "description": "Videos per creator (overrides the template)",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 20
                  },
                  "adRights": {
                    "description": "organic = your own channels, no ads. paid_*: how long you can run it as an ad.",
                    "type": "string",
                    "enum": [
                      "organic",
                      "paid_3m",
                      "paid_6m",
                      "paid_12m",
                      "paid_forever"
                    ]
                  },
                  "targetCountries": {
                    "description": "Where the creators' audiences should be. Left out: your own country",
                    "minItems": 1,
                    "maxItems": 5,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "GB",
                        "US",
                        "IE",
                        "CA",
                        "AU"
                      ]
                    }
                  },
                  "lengthSeconds": {
                    "default": 30,
                    "description": "How long each video runs",
                    "anyOf": [
                      {
                        "type": "number",
                        "const": 15
                      },
                      {
                        "type": "number",
                        "const": 30
                      },
                      {
                        "type": "number",
                        "const": 60
                      }
                    ]
                  },
                  "deadline": {
                    "description": "yyyy-mm-dd, at least 5 days away. Default: the template's (2-3 weeks).",
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "brief": {
                    "type": "object",
                    "properties": {
                      "keyMessage": {
                        "description": "What the video must get across. Leave out to let the creator decide.",
                        "type": "string",
                        "maxLength": 600
                      },
                      "hooks": {
                        "description": "Opening lines to try. Leave out to let the creator decide.",
                        "maxItems": 5,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 200
                        }
                      },
                      "cta": {
                        "description": "Closing call to action. Leave out to let the creator decide.",
                        "type": "string",
                        "maxLength": 200
                      },
                      "dos": {
                        "description": "Things the video should do",
                        "maxItems": 8,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 200
                        }
                      },
                      "donts": {
                        "description": "Things it must not do or say",
                        "maxItems": 8,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 200
                        }
                      },
                      "exampleVideoUrl": {
                        "description": "A video in the style you want",
                        "type": "string",
                        "maxLength": 500,
                        "format": "uri"
                      }
                    }
                  }
                },
                "required": [
                  "title",
                  "brief"
                ],
                "additionalProperties": false
              },
              "example": {
                "productId": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
                "title": "Morning routine with Sleepwell",
                "template": "one_video",
                "lengthSeconds": 30,
                "brief": {
                  "keyMessage": "Sleepwell helps you fall asleep in 10 minutes without your phone.",
                  "hooks": [
                    "I used to scroll until 2am."
                  ],
                  "cta": "Try it free tonight."
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "campaignId": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
                    "status": "draft",
                    "review": "https://yapfactory.com/brand/campaigns/8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f/edit",
                    "next": "Show the person the draft (get_campaign), then publish_campaign when they're happy."
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`conflict`: The state doesn't allow it. `message` is written for people. `idempotency_conflict`: Same Idempotency-Key with a different body.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "write",
        "x-yap-side": "brand",
        "x-yap-scope": "campaigns:write",
        "x-yap-mcp-tool": "create_campaign_draft"
      }
    },
    "/campaigns/{campaignId}": {
      "get": {
        "operationId": "get_campaign",
        "summary": "Get a campaign",
        "description": "One of your campaigns: the brief, the deal terms, the ranked shortlist of creators (with who asked to join) and every deal on it.\n\nTier `read`: changes nothing. For: Brands. MCP tool: `get_campaign`.\n\nDocs: https://yapfactory.com/developers/api/get_campaign",
        "tags": [
          "Campaigns"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "campaigns:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "description": "The campaign's id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "id": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
                    "title": "Morning routine with Sleepwell",
                    "status": "live",
                    "product": {
                      "id": "5d41402a-bc4b-4a76-b971-9e3f2c1d0a8b",
                      "name": "Sleepwell",
                      "url": "https://apps.apple.com/app/id0000000000"
                    },
                    "terms": {
                      "videosPerCreator": 1,
                      "openingsPerVideo": 1,
                      "adRights": "Brand's channels, no ads",
                      "budgetPerVideo": {
                        "minor": 3000,
                        "currency": "USD",
                        "formatted": "$30.00"
                      },
                      "targetCountries": [
                        "US"
                      ],
                      "deadline": "2026-12-16T12:00:00.000Z",
                      "accessBy": "2026-12-04T12:00:00.000Z",
                      "revisionRounds": 3,
                      "autoInvite": true
                    },
                    "brief": {
                      "keyMessage": "Sleepwell helps you fall asleep in 10 minutes without your phone.",
                      "hooks": [
                        "I used to scroll until 2am.",
                        "My sleep score went from 52 to 81."
                      ],
                      "cta": "Try it free tonight.",
                      "dos": [
                        "Film on your phone, vertical, natural light",
                        "Show the app on screen within the first 5 seconds"
                      ],
                      "donts": [
                        "No health or medical claims"
                      ],
                      "creatorDecides": {},
                      "exampleVideoUrl": null
                    },
                    "shortlist": [
                      {
                        "creatorId": "c9f0f895-fb98-4ab3-8e3c-1d2f3a4b5c6d",
                        "name": "Maya R.",
                        "score": 0.92,
                        "reasons": [
                          "Makes wellness content",
                          "71% US audience"
                        ],
                        "rate": {
                          "minor": 2500,
                          "currency": "USD",
                          "formatted": "$25.00"
                        },
                        "askedToJoin": false,
                        "decision": "yes"
                      }
                    ],
                    "deals": [
                      {
                        "id": "3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19",
                        "creator": "Maya R.",
                        "status": "draft_submitted",
                        "url": "https://yapfactory.com/deals/3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19"
                      }
                    ],
                    "url": "https://yapfactory.com/brand/campaigns/8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "read",
        "x-yap-side": "brand",
        "x-yap-scope": "campaigns:read",
        "x-yap-mcp-tool": "get_campaign"
      }
    },
    "/campaigns/{campaignId}/brief": {
      "patch": {
        "operationId": "update_campaign_brief",
        "summary": "Edit a campaign brief",
        "description": "Change the creative brief of a draft or paused campaign (title, message, openings, call to action, dos and don'ts). Only the fields sent change: a field sent replaces what was there, and fields left out keep their value. A live campaign has to be paused before its brief can change.\n\nTier `write`: changes your own things only. For: Brands. MCP tool: `update_campaign_brief`.\n\nDocs: https://yapfactory.com/developers/api/update_campaign_brief",
        "tags": [
          "Campaigns"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "campaigns:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "description": "The campaign's id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "description": "The campaign's name, as creators see it",
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 100
                  },
                  "keyMessage": {
                    "description": "The one thing the video should get across",
                    "type": "string",
                    "maxLength": 600
                  },
                  "hooks": {
                    "description": "Opening lines to use. Replaces the whole list",
                    "maxItems": 5,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 200
                    }
                  },
                  "cta": {
                    "description": "What the viewer should do at the end",
                    "type": "string",
                    "maxLength": 200
                  },
                  "dos": {
                    "description": "Things the video should do. Replaces the whole list",
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 200
                    }
                  },
                  "donts": {
                    "description": "Things it must not do or say. Replaces the whole list",
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 200
                    }
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "keyMessage": "Sleepwell helps you fall asleep without your phone.",
                "hooks": [
                  "I used to scroll until 2am.",
                  "My sleep score went from 52 to 81."
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "campaignId": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
                    "saved": true,
                    "url": "https://yapfactory.com/brand/campaigns/8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f/edit"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`conflict`: The state doesn't allow it. `message` is written for people. `idempotency_conflict`: Same Idempotency-Key with a different body.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "write",
        "x-yap-side": "brand",
        "x-yap-scope": "campaigns:write",
        "x-yap-mcp-tool": "update_campaign_brief"
      }
    },
    "/campaigns/{campaignId}/publish": {
      "post": {
        "operationId": "publish_campaign",
        "summary": "Publish a campaign",
        "description": "Make a draft campaign live: matching creators see the brief and can ask to join. Free; nothing is charged until you start a deal. For use once the person has agreed to go live.\n\nTier `outbound`: other people are told (an email, a notification or a public post). Idempotency-Key is required. For: Brands. MCP tool: `publish_campaign`.\n\nDocs: https://yapfactory.com/developers/api/publish_campaign",
        "tags": [
          "Campaigns"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "campaigns:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "description": "The campaign's id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "responses": {
          "200": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "campaignId": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
                    "status": "live",
                    "url": "https://yapfactory.com/brand/campaigns/8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
                    "next": "Matching creators are being ranked now. Use get_campaign for the shortlist, then invite_creators."
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`conflict`: The state doesn't allow it. `message` is written for people. `idempotency_conflict`: Same Idempotency-Key with a different body.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "outbound",
        "x-yap-side": "brand",
        "x-yap-scope": "campaigns:write",
        "x-yap-mcp-tool": "publish_campaign"
      }
    },
    "/campaigns/{campaignId}/status": {
      "post": {
        "operationId": "set_campaign_status",
        "summary": "Pause, resume or close a campaign",
        "description": "Pause a live campaign (hidden from new creators), resume it, or close it (creators who asked are told it closed). Deals already running carry on. A draft goes live through publish_campaign. For use once the person has agreed.\n\nTier `outbound`: other people are told (an email, a notification or a public post). Idempotency-Key is required. For: Brands. MCP tool: `set_campaign_status`.\n\nDocs: https://yapfactory.com/developers/api/set_campaign_status",
        "tags": [
          "Campaigns"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "campaigns:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "description": "The campaign's id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "live",
                      "paused",
                      "closed"
                    ],
                    "description": "paused: hidden from new creators. live: resume a paused or closed campaign. closed: finished; creators who asked are told"
                  }
                },
                "required": [
                  "status"
                ],
                "additionalProperties": false
              },
              "example": {
                "status": "paused"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "campaignId": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
                    "status": "paused",
                    "url": "https://yapfactory.com/brand/campaigns/8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`conflict`: The state doesn't allow it. `message` is written for people. `idempotency_conflict`: Same Idempotency-Key with a different body.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "outbound",
        "x-yap-side": "brand",
        "x-yap-scope": "campaigns:write",
        "x-yap-mcp-tool": "set_campaign_status"
      }
    },
    "/campaigns/{campaignId}/invites": {
      "post": {
        "operationId": "invite_creators",
        "summary": "Invite creators",
        "description": "Invite hand-picked creators to a live campaign: up to 8 per campaign in all. Invites are free; each creator gets the offer and has 2 days to say yes. You only pay when you start a deal with someone who said yes (on yapfactory.com). The result lists who was invited and who couldn't be, with why. For use once the person has agreed the list.\n\nTier `outbound`: other people are told (an email, a notification or a public post). Idempotency-Key is required. For: Brands. MCP tool: `invite_creators`.\n\nDocs: https://yapfactory.com/developers/api/invite_creators",
        "tags": [
          "Campaigns"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "campaigns:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "description": "The campaign's id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "creatorIds": {
                    "minItems": 1,
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "description": "Creator ids from search_creators or get_campaign"
                  }
                },
                "required": [
                  "creatorIds"
                ],
                "additionalProperties": false
              },
              "example": {
                "creatorIds": [
                  "c9f0f895-fb98-4ab3-8e3c-1d2f3a4b5c6d"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "invited": [
                      {
                        "creatorId": "c9f0f895-fb98-4ab3-8e3c-1d2f3a4b5c6d",
                        "dealId": "3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19",
                        "url": "https://yapfactory.com/deals/3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19"
                      }
                    ],
                    "failed": [],
                    "next": "Creators have 2 days to answer. When one says yes, start the deal on its page to secure payment."
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`conflict`: The state doesn't allow it. `message` is written for people. `idempotency_conflict`: Same Idempotency-Key with a different body.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "outbound",
        "x-yap-side": "brand",
        "x-yap-scope": "campaigns:write",
        "x-yap-mcp-tool": "invite_creators"
      }
    },
    "/deals/{dealId}/pass": {
      "post": {
        "operationId": "pass_on_creator",
        "summary": "Pass on a creator",
        "description": "Say \"Not this time\" to a creator who said yes but you won't start a deal with. They're told politely, and it can't be taken back. Only for deals not yet started. For use once the person has agreed.\n\nTier `outbound`: other people are told (an email, a notification or a public post). Idempotency-Key is required. For: Brands. MCP tool: `pass_on_creator`.\n\nDocs: https://yapfactory.com/developers/api/pass_on_creator",
        "tags": [
          "Deals"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "deals:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "dealId",
            "in": "path",
            "required": true,
            "description": "The deal's id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "description": "A short, kind reason. The creator sees it",
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "reason": "We went with a creator closer to our audience this time."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "dealId": "3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19",
                    "passed": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`conflict`: The state doesn't allow it. `message` is written for people. `idempotency_conflict`: Same Idempotency-Key with a different body.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "outbound",
        "x-yap-side": "brand",
        "x-yap-scope": "deals:write",
        "x-yap-mcp-tool": "pass_on_creator"
      }
    },
    "/deals/{dealId}/revisions": {
      "post": {
        "operationId": "request_revision",
        "summary": "Ask for changes to a draft",
        "description": "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.\n\nTier `outbound`: other people are told (an email, a notification or a public post). Idempotency-Key is required. For: Brands. MCP tool: `request_revision`.\n\nDocs: https://yapfactory.com/developers/api/request_revision",
        "tags": [
          "Deals"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "deals:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "dealId",
            "in": "path",
            "required": true,
            "description": "The deal's id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "notes": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 4000,
                    "description": "What to change, specifically"
                  }
                },
                "required": [
                  "notes"
                ],
                "additionalProperties": false
              },
              "example": {
                "notes": "Open on the alarm going off, then show the app within the first 3 seconds."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "dealId": "3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19",
                    "sentBack": true,
                    "url": "https://yapfactory.com/deals/3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`conflict`: The state doesn't allow it. `message` is written for people. `idempotency_conflict`: Same Idempotency-Key with a different body.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "outbound",
        "x-yap-side": "brand",
        "x-yap-scope": "deals:write",
        "x-yap-mcp-tool": "request_revision"
      }
    },
    "/marketplace/campaigns": {
      "get": {
        "operationId": "browse_campaigns",
        "summary": "Browse campaigns",
        "description": "Live campaigns you could work on, with what each pays you, its fit with your profile and the brand's rating.\n\nTier `read`: changes nothing. For: Creators. MCP tool: `browse_campaigns`.\n\nDocs: https://yapfactory.com/developers/api/browse_campaigns",
        "tags": [
          "Marketplace"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "marketplace:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Words to look for in the product or brief",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Only this product category, e.g. Health & Fitness",
            "schema": {
              "type": "string",
              "maxLength": 60
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "Only campaigns for this audience country, e.g. US",
            "schema": {
              "type": "string",
              "maxLength": 10
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "fit: best match for your profile first. pay: what you'd earn, highest first. rating: best rated brands first",
            "schema": {
              "default": "fit",
              "type": "string",
              "enum": [
                "fit",
                "newest",
                "pay",
                "rating"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of campaigns.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListEnvelope"
                },
                "example": {
                  "data": [
                    {
                      "id": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
                      "title": "Morning routine with Sleepwell",
                      "product": "Sleepwell",
                      "category": "Health & Fitness",
                      "brand": "Sleepwell",
                      "brandRating": {
                        "average": 4.8,
                        "count": 6,
                        "completedDeals": 7,
                        "onTimeReviewRate": 1,
                        "medianReviewHours": 9.5,
                        "medianHoursDraftToPayout": 14
                      },
                      "pays": {
                        "minor": 2500,
                        "currency": "USD",
                        "formatted": "$25.00"
                      },
                      "videos": 1,
                      "openingsPerVideo": 1,
                      "lengthSeconds": 30,
                      "adRights": "Brand's channels, no ads",
                      "targetCountries": [
                        "US"
                      ],
                      "deadline": "2026-12-16T12:00:00.000Z",
                      "fit": "Great fit",
                      "fitReasons": [
                        "You make wellness videos",
                        "71% of your audience is in the US"
                      ],
                      "asked": false,
                      "url": "https://yapfactory.com/creator/browse/8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f"
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false,
                  "meta": {
                    "page": 1,
                    "pages": 8,
                    "total": 192,
                    "yourRate": {
                      "minor": 2500,
                      "currency": "USD",
                      "formatted": "$25.00"
                    },
                    "hiddenBecauseAboveBudget": 0
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "read",
        "x-yap-side": "creator",
        "x-yap-scope": "marketplace:read",
        "x-yap-mcp-tool": "browse_campaigns"
      }
    },
    "/marketplace/campaigns/{campaignId}": {
      "get": {
        "operationId": "view_campaign_brief",
        "summary": "Read a campaign brief",
        "description": "A live campaign's full brief as a creator sees it: what to make, the deadline, the ad rights, what it pays you line by line, and whether you can ask to join.\n\nTier `read`: changes nothing. For: Creators. MCP tool: `view_campaign_brief`.\n\nDocs: https://yapfactory.com/developers/api/view_campaign_brief",
        "tags": [
          "Marketplace"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "marketplace:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "description": "The campaign's id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "id": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
                    "title": "Morning routine with Sleepwell",
                    "product": {
                      "name": "Sleepwell",
                      "description": "A sleep app that winds you down without your phone.",
                      "url": "https://apps.apple.com/app/id0000000000"
                    },
                    "brand": {
                      "name": "Sleepwell",
                      "country": "US",
                      "website": "https://sleepwell.app",
                      "rating": {
                        "average": 4.8,
                        "count": 6,
                        "completedDeals": 7,
                        "onTimeReviewRate": 1,
                        "medianReviewHours": 9.5,
                        "medianHoursDraftToPayout": 14
                      }
                    },
                    "brief": {
                      "keyMessage": "Sleepwell helps you fall asleep in 10 minutes without your phone.",
                      "hooks": [
                        "I used to scroll until 2am.",
                        "My sleep score went from 52 to 81."
                      ],
                      "cta": "Try it free tonight.",
                      "dos": [
                        "Film on your phone, vertical, natural light",
                        "Show the app on screen within the first 5 seconds"
                      ],
                      "donts": [
                        "No health or medical claims"
                      ],
                      "leftToYou": {},
                      "exampleVideoUrl": null
                    },
                    "lengthSeconds": 30,
                    "adRights": "Brand's channels, no ads",
                    "deadline": "2026-12-16T12:00:00.000Z",
                    "pays": {
                      "total": {
                        "minor": 2500,
                        "currency": "USD",
                        "formatted": "$25.00"
                      },
                      "lines": [
                        {
                          "label": "1 × 30s video creation fee",
                          "amount": {
                            "minor": 2500,
                            "currency": "USD",
                            "formatted": "$25.00"
                          }
                        },
                        {
                          "label": "Licence: Brand's channels, no ads",
                          "amount": {
                            "minor": 0,
                            "currency": "USD",
                            "formatted": "$0.00"
                          }
                        }
                      ],
                      "approximate": false
                    },
                    "fit": "Great fit",
                    "fitReasons": [
                      "You make wellness videos",
                      "71% of your audience is in the US"
                    ],
                    "canAsk": true,
                    "alreadyAsked": false,
                    "dealId": null,
                    "whyNot": null,
                    "url": "https://yapfactory.com/creator/browse/8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "read",
        "x-yap-side": "creator",
        "x-yap-scope": "marketplace:read",
        "x-yap-mcp-tool": "view_campaign_brief"
      }
    },
    "/marketplace/campaigns/{campaignId}/ask": {
      "post": {
        "operationId": "ask_to_join",
        "summary": "Ask to join a campaign",
        "description": "Tell the brand you'd like to make this campaign. You go on their shortlist; some brands invite straight away. Free, no limit. For use once the person has agreed.\n\nTier `outbound`: other people are told (an email, a notification or a public post). Idempotency-Key is required. For: Creators. MCP tool: `ask_to_join`.\n\nDocs: https://yapfactory.com/developers/api/ask_to_join",
        "tags": [
          "Marketplace"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "marketplace:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "description": "The campaign's id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "responses": {
          "200": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "campaignId": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
                    "asked": true,
                    "invitedAlready": false,
                    "dealId": null,
                    "url": "https://yapfactory.com/creator/browse/8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`conflict`: The state doesn't allow it. `message` is written for people. `idempotency_conflict`: Same Idempotency-Key with a different body.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "outbound",
        "x-yap-side": "creator",
        "x-yap-scope": "marketplace:write",
        "x-yap-mcp-tool": "ask_to_join"
      }
    },
    "/deals/{dealId}/answer": {
      "post": {
        "operationId": "respond_to_invite",
        "summary": "Answer an invite",
        "description": "Say yes (\"I'm in\") or no to a brand's invite. A yes commits you to the offer if the brand starts the deal within 3 days. For use once the person has agreed.\n\nTier `outbound`: other people are told (an email, a notification or a public post). Idempotency-Key is required. For: Creators. MCP tool: `respond_to_invite`.\n\nDocs: https://yapfactory.com/developers/api/respond_to_invite",
        "tags": [
          "Deals"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "deals:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "dealId",
            "in": "path",
            "required": true,
            "description": "The deal's id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "accept": {
                    "type": "boolean",
                    "description": "true: I'm in. false: not this time"
                  },
                  "reason": {
                    "description": "When declining, a short reason for the brand",
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "accept"
                ],
                "additionalProperties": false
              },
              "example": {
                "accept": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "dealId": "3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19",
                    "answer": "yes",
                    "next": "The brand has 3 days to start the deal. You'll hear when payment is secured; don't film before then.",
                    "url": "https://yapfactory.com/deals/3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`conflict`: The state doesn't allow it. `message` is written for people. `idempotency_conflict`: Same Idempotency-Key with a different body.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "outbound",
        "x-yap-side": "creator",
        "x-yap-scope": "deals:write",
        "x-yap-mcp-tool": "respond_to_invite"
      }
    },
    "/posts/accounts": {
      "get": {
        "operationId": "list_post_accounts",
        "summary": "List accounts you can post to",
        "description": "The brand's own TikTok and Instagram accounts connected to Yap Factory that can take a scheduled post now, with what each allows (post directly, or send to TikTok drafts). Connect accounts on yapfactory.com under Accounts.\n\nTier `read`: changes nothing. For: Brands. MCP tool: `list_post_accounts`.\n\nDocs: https://yapfactory.com/developers/api/list_post_accounts",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "posts:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of accounts.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListEnvelope"
                },
                "example": {
                  "data": [
                    {
                      "id": "0cc175b9-c0f1-46a8-b1c3-99e2697726ae",
                      "platform": "tiktok",
                      "account": "@sleepwell",
                      "canPostDirectly": true,
                      "canSendToDrafts": true
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false,
                  "meta": {
                    "connect": "https://yapfactory.com/brand/accounts"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "read",
        "x-yap-side": "brand",
        "x-yap-scope": "posts:read",
        "x-yap-mcp-tool": "list_post_accounts"
      }
    },
    "/posts/accounts/{accountId}": {
      "get": {
        "operationId": "get_post_account",
        "summary": "Get posting options for an account",
        "description": "Live posting options for one account, straight from TikTok or Instagram: its name, who a post can be shown to (TikTok audiences), whether comments, Duet and Stitch can be on, the longest video, and whether it can post right now. Scheduling to a TikTok account needs these options, and the audience is the person's choice.\n\nTier `read`: changes nothing. For: Brands. MCP tool: `get_post_account`.\n\nDocs: https://yapfactory.com/developers/api/get_post_account",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "posts:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "description": "The account's id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "id": "0cc175b9-c0f1-46a8-b1c3-99e2697726ae",
                    "platform": "tiktok",
                    "account": "@sleepwell",
                    "nickname": "Sleepwell",
                    "avatarUrl": null,
                    "privacyOptions": [
                      "PUBLIC_TO_EVERYONE",
                      "MUTUAL_FOLLOW_FRIENDS",
                      "SELF_ONLY"
                    ],
                    "commentDisabled": false,
                    "duetDisabled": false,
                    "stitchDisabled": false,
                    "maxDurationS": 600,
                    "canPost": true,
                    "audiences": [
                      "PUBLIC_TO_EVERYONE",
                      "MUTUAL_FOLLOW_FRIENDS",
                      "SELF_ONLY"
                    ],
                    "say": "Ask the person who should see it; don't choose for them."
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "read",
        "x-yap-side": "brand",
        "x-yap-scope": "posts:read",
        "x-yap-mcp-tool": "get_post_account"
      }
    },
    "/posts/videos": {
      "get": {
        "operationId": "list_postable_videos",
        "summary": "List videos you can post",
        "description": "Finished videos the brand may post: approved videos from completed deals. An id from here is the video for schedule_post; prepare_post_upload is for posting your own file.\n\nTier `read`: changes nothing. For: Brands. MCP tool: `list_postable_videos`.\n\nDocs: https://yapfactory.com/developers/api/list_postable_videos",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "posts:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of videos.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListEnvelope"
                },
                "example": {
                  "data": [
                    {
                      "deliverableId": "4a8a08f0-9d37-4b73-9a5c-2f6a1e0d7c33",
                      "filename": "sleepwell-maya-v2.mp4",
                      "campaign": "Morning routine with Sleepwell",
                      "creator": "Maya R.",
                      "dealId": "3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19"
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "read",
        "x-yap-side": "brand",
        "x-yap-scope": "posts:read",
        "x-yap-mcp-tool": "list_postable_videos"
      }
    },
    "/posts/uploads": {
      "post": {
        "operationId": "prepare_post_upload",
        "summary": "Upload your own video or photo to post",
        "description": "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.\n\nTier `write`: changes your own things only. For: Brands. MCP tool: `prepare_post_upload`.\n\nDocs: https://yapfactory.com/developers/api/prepare_post_upload",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "posts:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "accountId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "The account the file is for"
                  },
                  "filename": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "description": "The file's name, with its extension"
                  },
                  "contentType": {
                    "type": "string",
                    "pattern": "^(video|image)\\/",
                    "description": "video/mp4, video/quicktime or image/jpeg"
                  },
                  "sizeBytes": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991,
                    "description": "The file's size in bytes"
                  }
                },
                "required": [
                  "accountId",
                  "filename",
                  "contentType",
                  "sizeBytes"
                ],
                "additionalProperties": false
              },
              "example": {
                "accountId": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
                "filename": "launch.mp4",
                "contentType": "video/mp4",
                "sizeBytes": 18400000
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "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."
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`conflict`: The state doesn't allow it. `message` is written for people. `idempotency_conflict`: Same Idempotency-Key with a different body.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "write",
        "x-yap-side": "brand",
        "x-yap-scope": "posts:write",
        "x-yap-mcp-tool": "prepare_post_upload"
      }
    },
    "/posts": {
      "post": {
        "operationId": "schedule_post",
        "summary": "Schedule a post",
        "description": "Schedule a video or photos to go out on one or more of the brand's own TikTok and Instagram accounts at a set time (at least 10 minutes and at most 60 days ahead). It posts publicly at that time, so it is for use once the person has seen the account, video, caption, time and (TikTok) audience and agreed. For TikTok the audience is the person's own choice from get_post_account. Not for creators' accounts.\n\nTier `outbound`: other people are told (an email, a notification or a public post). Idempotency-Key is required. For: Brands. MCP tool: `schedule_post`.\n\nDocs: https://yapfactory.com/developers/api/schedule_post",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "posts:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "accounts": {
                    "minItems": 1,
                    "maxItems": 10,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "accountId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                          "description": "The account's id"
                        },
                        "mode": {
                          "default": "direct",
                          "description": "direct posts it; drafts sends it to the TikTok app's drafts for the person to finish (TikTok only)",
                          "type": "string",
                          "enum": [
                            "direct",
                            "drafts"
                          ]
                        }
                      },
                      "required": [
                        "accountId"
                      ]
                    },
                    "description": "The accounts to post to, from list_post_accounts"
                  },
                  "media": {
                    "minItems": 1,
                    "maxItems": 35,
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "deliverableId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                              "description": "From list_postable_videos"
                            }
                          },
                          "required": [
                            "deliverableId"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "upload": {
                              "type": "object",
                              "properties": {
                                "key": {
                                  "type": "string"
                                },
                                "url": {
                                  "type": "string"
                                },
                                "filename": {
                                  "type": "string"
                                },
                                "sizeBytes": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "key",
                                "url",
                                "filename",
                                "sizeBytes"
                              ],
                              "description": "The upload object from prepare_post_upload"
                            }
                          },
                          "required": [
                            "upload"
                          ]
                        }
                      ]
                    },
                    "description": "One video, one photo, or several photos (a carousel), in order"
                  },
                  "caption": {
                    "default": "",
                    "description": "The words under the post, hashtags included",
                    "type": "string",
                    "maxLength": 2200
                  },
                  "publishAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                    "description": "When it goes out, ISO 8601 with a time zone, e.g. 2026-12-10T18:00:00Z"
                  },
                  "timeZone": {
                    "default": "UTC",
                    "description": "The person's IANA time zone, for how times are shown to them, e.g. Europe/London",
                    "type": "string",
                    "maxLength": 60
                  },
                  "tiktok": {
                    "description": "Needed when posting directly to a TikTok account",
                    "type": "object",
                    "properties": {
                      "privacy": {
                        "type": "string",
                        "enum": [
                          "PUBLIC_TO_EVERYONE",
                          "MUTUAL_FOLLOW_FRIENDS",
                          "FOLLOWER_OF_CREATOR",
                          "SELF_ONLY"
                        ],
                        "description": "Who can see it: the person's choice, from get_post_account"
                      },
                      "allowComments": {
                        "default": false,
                        "description": "Let people comment, if get_post_account says the account allows it",
                        "type": "boolean"
                      },
                      "allowDuet": {
                        "default": false,
                        "description": "Let people Duet it (videos only)",
                        "type": "boolean"
                      },
                      "allowStitch": {
                        "default": false,
                        "description": "Let people Stitch it (videos only)",
                        "type": "boolean"
                      },
                      "disclose": {
                        "default": false,
                        "description": "Disclose commercial content",
                        "type": "boolean"
                      },
                      "yourBrand": {
                        "default": false,
                        "description": "Promotional content for your own brand",
                        "type": "boolean"
                      },
                      "brandedContent": {
                        "default": false,
                        "description": "A paid partnership for another brand (can't be Only me)",
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "privacy"
                    ]
                  },
                  "instagram": {
                    "type": "object",
                    "properties": {
                      "shareToFeed": {
                        "default": true,
                        "description": "Reels also show in the main feed",
                        "type": "boolean"
                      }
                    }
                  }
                },
                "required": [
                  "accounts",
                  "media",
                  "publishAt"
                ],
                "additionalProperties": false
              },
              "example": {
                "accounts": [
                  {
                    "accountId": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
                    "mode": "direct"
                  }
                ],
                "media": [
                  {
                    "deliverableId": "c9f0f895-fb98-4ab3-8e3c-1d2f3a4b5c6d"
                  }
                ],
                "caption": "Fell asleep before the alarm app even loaded.",
                "publishAt": "2026-12-10T18:00:00Z",
                "timeZone": "Europe/London",
                "tiktok": {
                  "privacy": "PUBLIC_TO_EVERYONE",
                  "allowComments": true,
                  "disclose": true,
                  "yourBrand": true
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "posts": [
                      {
                        "id": "92eb5ffe-e6ae-4fec-8ad7-1c4c4e2f8a55",
                        "accountId": "0cc175b9-c0f1-46a8-b1c3-99e2697726ae",
                        "status": "scheduled",
                        "publishAt": "2026-12-10T18:00:00.000Z",
                        "url": "https://yapfactory.com/brand/accounts?tab=calendar&post=92eb5ffe-e6ae-4fec-8ad7-1c4c4e2f8a55"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`conflict`: The state doesn't allow it. `message` is written for people. `idempotency_conflict`: Same Idempotency-Key with a different body.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "outbound",
        "x-yap-side": "brand",
        "x-yap-scope": "posts:write",
        "x-yap-mcp-tool": "schedule_post"
      },
      "get": {
        "operationId": "list_posts",
        "summary": "List scheduled posts",
        "description": "The brand's posts across its accounts: what's coming up, what went live (with its link) and anything that needs the person (a failed post says why). Defaults to the last 7 days and everything ahead.\n\nTier `read`: changes nothing. For: Brands. MCP tool: `list_posts`.\n\nDocs: https://yapfactory.com/developers/api/list_posts",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "posts:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "upcoming: not out yet. live: posted. needs_action: stopped and needs the person",
            "schema": {
              "default": "all",
              "type": "string",
              "enum": [
                "upcoming",
                "live",
                "needs_action",
                "all"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Start of the range (default: 7 days ago)",
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "End of the range (default: 60 days ahead)",
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of posts.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListEnvelope"
                },
                "example": {
                  "data": [
                    {
                      "id": "92eb5ffe-e6ae-4fec-8ad7-1c4c4e2f8a55",
                      "accountId": "0cc175b9-c0f1-46a8-b1c3-99e2697726ae",
                      "platform": "tiktok",
                      "account": "@sleepwell",
                      "status": "scheduled",
                      "publishAt": "2026-12-10T18:00:00.000Z",
                      "mode": "direct",
                      "mediaType": "video",
                      "items": 1,
                      "caption": "Fell asleep before the alarm app even loaded.",
                      "postUrl": null,
                      "problem": null,
                      "url": "https://yapfactory.com/brand/accounts?tab=calendar&post=92eb5ffe-e6ae-4fec-8ad7-1c4c4e2f8a55"
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "read",
        "x-yap-side": "brand",
        "x-yap-scope": "posts:read",
        "x-yap-mcp-tool": "list_posts"
      }
    },
    "/posts/{postId}": {
      "patch": {
        "operationId": "update_post",
        "summary": "Change a scheduled post",
        "description": "Change the caption or time of a post that hasn't gone out. For use once the person has agreed the change.\n\nTier `write`: changes your own things only. For: Brands. MCP tool: `update_post`.\n\nDocs: https://yapfactory.com/developers/api/update_post",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "posts:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "description": "The post's id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "caption": {
                    "description": "The new caption",
                    "type": "string",
                    "maxLength": 2200
                  },
                  "publishAt": {
                    "description": "The new time, ISO 8601 with a time zone, 10 minutes to 60 days ahead",
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "publishAt": "2026-12-11T18:00:00Z"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "id": "92eb5ffe-e6ae-4fec-8ad7-1c4c4e2f8a55",
                    "status": "scheduled",
                    "publishAt": "2026-12-11T18:00:00.000Z",
                    "caption": "Fell asleep before the alarm app even loaded."
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`conflict`: The state doesn't allow it. `message` is written for people. `idempotency_conflict`: Same Idempotency-Key with a different body.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "write",
        "x-yap-side": "brand",
        "x-yap-scope": "posts:write",
        "x-yap-mcp-tool": "update_post"
      }
    },
    "/posts/{postId}/cancel": {
      "post": {
        "operationId": "cancel_post",
        "summary": "Cancel a scheduled post",
        "description": "Cancel a post that hasn't gone out, so it never posts. It can't be undone, though the post can be scheduled again. A post that's already live has to be deleted in TikTok or Instagram.\n\nTier `write`: changes your own things only. For: Brands. MCP tool: `cancel_post`.\n\nDocs: https://yapfactory.com/developers/api/cancel_post",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "posts:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "description": "The post's id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The result.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                },
                "example": {
                  "data": {
                    "id": "92eb5ffe-e6ae-4fec-8ad7-1c4c4e2f8a55",
                    "status": "cancelled"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`conflict`: The state doesn't allow it. `message` is written for people. `idempotency_conflict`: Same Idempotency-Key with a different body.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "write",
        "x-yap-side": "brand",
        "x-yap-scope": "posts:write",
        "x-yap-mcp-tool": "cancel_post"
      }
    },
    "/deals/{dealId}/start": {
      "post": {
        "operationId": "start_deal",
        "summary": "Start a deal (payment link)",
        "description": "Starting a deal charges the brand's card, so it can't happen through the API. Returns the link where the brand starts it on yapfactory.com, and whether it can be started now.\n\nTier `money`: never charges or pays. Returns a handoff link to finish the step on yapfactory.com. For: Brands. REST only.\n\nDocs: https://yapfactory.com/developers/api/start_deal",
        "tags": [
          "Deals"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "deals:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "dealId",
            "in": "path",
            "required": true,
            "description": "The deal's id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The handoff link.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "dealId",
                        "status",
                        "handoff"
                      ],
                      "properties": {
                        "dealId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "status": {
                          "type": "string"
                        },
                        "canStartNow": {
                          "type": "boolean"
                        },
                        "handoff": {
                          "$ref": "#/components/schemas/Handoff"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "dealId": "3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19",
                    "status": "accepted",
                    "canStartNow": true,
                    "handoff": {
                      "action": "start_deal",
                      "url": "https://yapfactory.com/deals/3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19",
                      "say": "Start the deal on this page: your card is charged and payment is held until you approve the video."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`conflict`: The state doesn't allow it. `message` is written for people. `idempotency_conflict`: Same Idempotency-Key with a different body.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "money",
        "x-yap-side": "brand",
        "x-yap-scope": "deals:write"
      }
    },
    "/deals/{dealId}/approve": {
      "post": {
        "operationId": "approve_draft",
        "summary": "Approve a draft (review link)",
        "description": "Approving a draft pays the creator, so it can't happen through the API. Returns the link where the brand watches the draft and approves it on yapfactory.com.\n\nTier `money`: never charges or pays. Returns a handoff link to finish the step on yapfactory.com. For: Brands. REST only.\n\nDocs: https://yapfactory.com/developers/api/approve_draft",
        "tags": [
          "Deals"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "deals:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "dealId",
            "in": "path",
            "required": true,
            "description": "The deal's id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The handoff link.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "dealId",
                        "status",
                        "handoff"
                      ],
                      "properties": {
                        "dealId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "status": {
                          "type": "string"
                        },
                        "canApproveNow": {
                          "type": "boolean"
                        },
                        "handoff": {
                          "$ref": "#/components/schemas/Handoff"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "dealId": "3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19",
                    "status": "draft_submitted",
                    "canApproveNow": true,
                    "handoff": {
                      "action": "approve_draft",
                      "url": "https://yapfactory.com/deals/3b2f6c1e-7a54-4d0b-9f1a-6e5d4c3b2a19",
                      "say": "Watch the draft on this page and approve it there: approving pays the creator."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=. `forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`conflict`: The state doesn't allow it. `message` is written for people. `idempotency_conflict`: Same Idempotency-Key with a different body.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "x-yap-tier": "money",
        "x-yap-side": "brand",
        "x-yap-scope": "deals:write"
      }
    }
  },
  "webhooks": {
    "deal.updated": {
      "post": {
        "summary": "Any deal status change",
        "description": "Sent to your endpoint (Settings → Webhooks), signed with `Yap-Signature`. Answer 2xx within 10 seconds. Docs: https://yapfactory.com/developers/webhooks",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Yap-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event's id. The same across retries and replays: dedupe on it."
          },
          {
            "name": "Yap-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "deal.updated"
              ]
            }
          },
          {
            "name": "Yap-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "deal.updated"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Delivered."
          }
        }
      }
    },
    "deal.invited": {
      "post": {
        "summary": "A brand invited you",
        "description": "Sent to your endpoint (Settings → Webhooks), signed with `Yap-Signature`. Answer 2xx within 10 seconds. Docs: https://yapfactory.com/developers/webhooks",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Yap-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event's id. The same across retries and replays: dedupe on it."
          },
          {
            "name": "Yap-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "deal.invited"
              ]
            }
          },
          {
            "name": "Yap-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "deal.invited"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Delivered."
          }
        }
      }
    },
    "invite.accepted": {
      "post": {
        "summary": "A creator said yes",
        "description": "Sent to your endpoint (Settings → Webhooks), signed with `Yap-Signature`. Answer 2xx within 10 seconds. Docs: https://yapfactory.com/developers/webhooks",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Yap-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event's id. The same across retries and replays: dedupe on it."
          },
          {
            "name": "Yap-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "invite.accepted"
              ]
            }
          },
          {
            "name": "Yap-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "invite.accepted"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Delivered."
          }
        }
      }
    },
    "invite.declined": {
      "post": {
        "summary": "A creator said no",
        "description": "Sent to your endpoint (Settings → Webhooks), signed with `Yap-Signature`. Answer 2xx within 10 seconds. Docs: https://yapfactory.com/developers/webhooks",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Yap-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event's id. The same across retries and replays: dedupe on it."
          },
          {
            "name": "Yap-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "invite.declined"
              ]
            }
          },
          {
            "name": "Yap-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "invite.declined"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Delivered."
          }
        }
      }
    },
    "invite.expired": {
      "post": {
        "summary": "An invite ran out",
        "description": "Sent to your endpoint (Settings → Webhooks), signed with `Yap-Signature`. Answer 2xx within 10 seconds. Docs: https://yapfactory.com/developers/webhooks",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Yap-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event's id. The same across retries and replays: dedupe on it."
          },
          {
            "name": "Yap-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "invite.expired"
              ]
            }
          },
          {
            "name": "Yap-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "invite.expired"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Delivered."
          }
        }
      }
    },
    "deal.started": {
      "post": {
        "summary": "A deal started and payment is secured",
        "description": "Sent to your endpoint (Settings → Webhooks), signed with `Yap-Signature`. Answer 2xx within 10 seconds. Docs: https://yapfactory.com/developers/webhooks",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Yap-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event's id. The same across retries and replays: dedupe on it."
          },
          {
            "name": "Yap-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "deal.started"
              ]
            }
          },
          {
            "name": "Yap-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "deal.started"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Delivered."
          }
        }
      }
    },
    "draft.submitted": {
      "post": {
        "summary": "A draft is ready to review",
        "description": "Sent to your endpoint (Settings → Webhooks), signed with `Yap-Signature`. Answer 2xx within 10 seconds. Docs: https://yapfactory.com/developers/webhooks",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Yap-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event's id. The same across retries and replays: dedupe on it."
          },
          {
            "name": "Yap-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "draft.submitted"
              ]
            }
          },
          {
            "name": "Yap-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "draft.submitted"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Delivered."
          }
        }
      }
    },
    "revision.requested": {
      "post": {
        "summary": "The brand sent a draft back",
        "description": "Sent to your endpoint (Settings → Webhooks), signed with `Yap-Signature`. Answer 2xx within 10 seconds. Docs: https://yapfactory.com/developers/webhooks",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Yap-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event's id. The same across retries and replays: dedupe on it."
          },
          {
            "name": "Yap-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "revision.requested"
              ]
            }
          },
          {
            "name": "Yap-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "revision.requested"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Delivered."
          }
        }
      }
    },
    "draft.approved": {
      "post": {
        "summary": "A draft was approved",
        "description": "Sent to your endpoint (Settings → Webhooks), signed with `Yap-Signature`. Answer 2xx within 10 seconds. Docs: https://yapfactory.com/developers/webhooks",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Yap-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event's id. The same across retries and replays: dedupe on it."
          },
          {
            "name": "Yap-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "draft.approved"
              ]
            }
          },
          {
            "name": "Yap-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "draft.approved"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Delivered."
          }
        }
      }
    },
    "deal.completed": {
      "post": {
        "summary": "A deal is done",
        "description": "Sent to your endpoint (Settings → Webhooks), signed with `Yap-Signature`. Answer 2xx within 10 seconds. Docs: https://yapfactory.com/developers/webhooks",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Yap-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event's id. The same across retries and replays: dedupe on it."
          },
          {
            "name": "Yap-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "deal.completed"
              ]
            }
          },
          {
            "name": "Yap-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "deal.completed"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Delivered."
          }
        }
      }
    },
    "deal.cancelled": {
      "post": {
        "summary": "A deal was cancelled",
        "description": "Sent to your endpoint (Settings → Webhooks), signed with `Yap-Signature`. Answer 2xx within 10 seconds. Docs: https://yapfactory.com/developers/webhooks",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Yap-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event's id. The same across retries and replays: dedupe on it."
          },
          {
            "name": "Yap-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "deal.cancelled"
              ]
            }
          },
          {
            "name": "Yap-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "deal.cancelled"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Delivered."
          }
        }
      }
    },
    "ask.received": {
      "post": {
        "summary": "A creator asked to join a campaign",
        "description": "Sent to your endpoint (Settings → Webhooks), signed with `Yap-Signature`. Answer 2xx within 10 seconds. Docs: https://yapfactory.com/developers/webhooks",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Yap-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event's id. The same across retries and replays: dedupe on it."
          },
          {
            "name": "Yap-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ask.received"
              ]
            }
          },
          {
            "name": "Yap-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "ask.received"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Delivered."
          }
        }
      }
    },
    "message.received": {
      "post": {
        "summary": "A new message on a deal",
        "description": "Sent to your endpoint (Settings → Webhooks), signed with `Yap-Signature`. Answer 2xx within 10 seconds. Docs: https://yapfactory.com/developers/webhooks",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Yap-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event's id. The same across retries and replays: dedupe on it."
          },
          {
            "name": "Yap-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "message.received"
              ]
            }
          },
          {
            "name": "Yap-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "message.received"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Delivered."
          }
        }
      }
    },
    "campaign.published": {
      "post": {
        "summary": "A campaign went live",
        "description": "Sent to your endpoint (Settings → Webhooks), signed with `Yap-Signature`. Answer 2xx within 10 seconds. Docs: https://yapfactory.com/developers/webhooks",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Yap-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event's id. The same across retries and replays: dedupe on it."
          },
          {
            "name": "Yap-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "campaign.published"
              ]
            }
          },
          {
            "name": "Yap-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "campaign.published"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Delivered."
          }
        }
      }
    },
    "post.published": {
      "post": {
        "summary": "A scheduled post went live",
        "description": "Sent to your endpoint (Settings → Webhooks), signed with `Yap-Signature`. Answer 2xx within 10 seconds. Docs: https://yapfactory.com/developers/webhooks",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Yap-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event's id. The same across retries and replays: dedupe on it."
          },
          {
            "name": "Yap-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "post.published"
              ]
            }
          },
          {
            "name": "Yap-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "post.published"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Delivered."
          }
        }
      }
    },
    "post.failed": {
      "post": {
        "summary": "A scheduled post needs you",
        "description": "Sent to your endpoint (Settings → Webhooks), signed with `Yap-Signature`. Answer 2xx within 10 seconds. Docs: https://yapfactory.com/developers/webhooks",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Yap-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event's id. The same across retries and replays: dedupe on it."
          },
          {
            "name": "Yap-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "post.failed"
              ]
            }
          },
          {
            "name": "Yap-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "post.failed"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Delivered."
          }
        }
      }
    },
    "ping": {
      "post": {
        "summary": "A test event from Settings",
        "description": "Sent to your endpoint (Settings → Webhooks), signed with `Yap-Signature`. Answer 2xx within 10 seconds. Docs: https://yapfactory.com/developers/webhooks",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Yap-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event's id. The same across retries and replays: dedupe on it."
          },
          {
            "name": "Yap-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ping"
              ]
            }
          },
          {
            "name": "Yap-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookEvent"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "ping"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Delivered."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key (`yf_live_…`, from Settings → AI agents → Make an API key) or an OAuth access token (`yfa_…`)."
      },
      "oauth2": {
        "type": "oauth2",
        "description": "Authorization code with PKCE (S256), public clients only. Use a Client ID Metadata Document or register at /oauth/register.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://yapfactory.com/oauth/authorize",
            "tokenUrl": "https://yapfactory.com/oauth/token",
            "refreshUrl": "https://yapfactory.com/oauth/token",
            "scopes": {
              "read": "Every operation that reads",
              "write": "Every operation that acts, and every read",
              "account:read": "Read account",
              "account:write": "Act on account, and read it",
              "deals:read": "Read deals",
              "deals:write": "Act on deals, and read it",
              "campaigns:read": "Read campaigns",
              "campaigns:write": "Act on campaigns, and read it",
              "creators:read": "Read creators",
              "creators:write": "Act on creators, and read it",
              "marketplace:read": "Read marketplace",
              "marketplace:write": "Act on marketplace, and read it",
              "posts:read": "Read posts",
              "posts:write": "Act on posts, and read it"
            }
          }
        }
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "8–200 characters. The same key and body within 24 hours returns the stored response.",
        "schema": {
          "type": "string",
          "minLength": 8,
          "maxLength": 200
        }
      },
      "IdempotencyKeyRequired": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "description": "Required: this operation tells other people. 8–200 characters. The same key and body within 24 hours returns the stored response.",
        "schema": {
          "type": "string",
          "minLength": 8,
          "maxLength": 200
        }
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "description": "How many to return.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50,
          "default": 20
        }
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "description": "The nextCursor from the previous page.",
        "schema": {
          "type": "string"
        }
      }
    },
    "headers": {
      "RequestId": {
        "description": "`req_` and 20 base62 characters. Also in every error body.",
        "schema": {
          "type": "string",
          "pattern": "^req_[A-Za-z0-9]{20}$"
        }
      },
      "RateLimitLimit": {
        "description": "The limit for this kind of call, per minute.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitRemaining": {
        "description": "Calls left in this window.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitReset": {
        "description": "Seconds until the window resets.",
        "schema": {
          "type": "integer"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before retrying.",
        "schema": {
          "type": "integer"
        }
      },
      "IdempotentReplayed": {
        "description": "`true` when this is the stored response for a repeated Idempotency-Key.",
        "schema": {
          "type": "string",
          "enum": [
            "true"
          ]
        }
      }
    },
    "schemas": {
      "WebhookEvent": {
        "type": "object",
        "required": [
          "id",
          "type",
          "createdAt",
          "livemode",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "`evt_…`. The same across retries and replays."
          },
          "type": {
            "type": "string",
            "enum": [
              "deal.updated",
              "deal.invited",
              "invite.accepted",
              "invite.declined",
              "invite.expired",
              "deal.started",
              "draft.submitted",
              "revision.requested",
              "draft.approved",
              "deal.completed",
              "deal.cancelled",
              "ask.received",
              "message.received",
              "campaign.published",
              "post.published",
              "post.failed",
              "ping"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "livemode": {
            "type": "boolean",
            "description": "false for events from test sites."
          },
          "data": {
            "type": "object",
            "additionalProperties": true,
            "description": "Ids, statuses and a link to the page. Never a creator's handle or contact details. Fields per event: /developers/webhooks#payload."
          }
        }
      },
      "DataEnvelope": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "ListEnvelope": {
        "type": "object",
        "required": [
          "data",
          "nextCursor",
          "hasMore"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` for the next page."
          },
          "hasMore": {
            "type": "boolean"
          },
          "meta": {
            "type": "object",
            "additionalProperties": true,
            "description": "Summary fields, when there are any."
          }
        }
      },
      "Handoff": {
        "type": "object",
        "required": [
          "action",
          "url"
        ],
        "properties": {
          "action": {
            "type": "string",
            "description": "The step, such as start_deal or approve_draft."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The deal page on yapfactory.com, where the person finishes the step."
          },
          "say": {
            "type": "string",
            "description": "A sentence to show the person, including when the step can't happen yet."
          }
        }
      },
      "Money": {
        "type": "object",
        "required": [
          "minor",
          "currency",
          "formatted"
        ],
        "properties": {
          "minor": {
            "type": "integer",
            "description": "Integer minor units (pence or cents)."
          },
          "currency": {
            "type": "string",
            "examples": [
              "USD",
              "GBP"
            ]
          },
          "formatted": {
            "type": "string",
            "examples": [
              "$15.00"
            ]
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "requestId"
            ],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "invalid_request",
                  "unauthorized",
                  "insufficient_scope",
                  "forbidden",
                  "not_found",
                  "conflict",
                  "idempotency_conflict",
                  "rate_limited",
                  "internal"
                ],
                "description": "Branch on this, never on message."
              },
              "message": {
                "type": "string",
                "description": "A sentence written for the person, safe to show them."
              },
              "requestId": {
                "type": "string",
                "pattern": "^req_[A-Za-z0-9]{20}$"
              },
              "meta": {
                "type": "object",
                "additionalProperties": true,
                "description": "`issues` for a failed validation, `required` for a missing scope."
              }
            }
          }
        }
      }
    },
    "responses": {
      "InvalidRequest": {
        "description": "`invalid_request`: Bad JSON, a failed validation (`meta.issues`), an unknown query parameter, or no Idempotency-Key on an outbound operation.",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "invalid_request",
                "message": "…",
                "requestId": "req_8fK2mQ9xLp3VtR7nYc1B"
              }
            }
          }
        }
      },
      "Unauthorized": {
        "description": "`unauthorized`: Missing, wrong, expired or revoked token, or a key from the other environment.",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "unauthorized",
                "message": "…",
                "requestId": "req_8fK2mQ9xLp3VtR7nYc1B"
              }
            }
          }
        }
      },
      "InsufficientScope": {
        "description": "`insufficient_scope`: The token lacks the scope. `meta.required` names it, and WWW-Authenticate carries scope=.",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "insufficient_scope",
                "message": "…",
                "requestId": "req_8fK2mQ9xLp3VtR7nYc1B"
              }
            }
          }
        }
      },
      "Forbidden": {
        "description": "`forbidden`: Never allowed for this account: wrong side, email not confirmed, account paused.",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "forbidden",
                "message": "…",
                "requestId": "req_8fK2mQ9xLp3VtR7nYc1B"
              }
            }
          }
        }
      },
      "NotFound": {
        "description": "`not_found`: Doesn't exist or isn't yours (we never say which).",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "not_found",
                "message": "…",
                "requestId": "req_8fK2mQ9xLp3VtR7nYc1B"
              }
            }
          }
        }
      },
      "Conflict": {
        "description": "`conflict`: The state doesn't allow it. `message` is written for people.",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "conflict",
                "message": "…",
                "requestId": "req_8fK2mQ9xLp3VtR7nYc1B"
              }
            }
          }
        }
      },
      "IdempotencyConflict": {
        "description": "`idempotency_conflict`: Same Idempotency-Key with a different body.",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "idempotency_conflict",
                "message": "…",
                "requestId": "req_8fK2mQ9xLp3VtR7nYc1B"
              }
            }
          }
        }
      },
      "RateLimited": {
        "description": "`rate_limited`: Over the limit. Retry-After is set.",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "rate_limited",
                "message": "…",
                "requestId": "req_8fK2mQ9xLp3VtR7nYc1B"
              }
            }
          }
        }
      },
      "Internal": {
        "description": "`internal`: Our fault. Send the requestId to support.",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "internal",
                "message": "…",
                "requestId": "req_8fK2mQ9xLp3VtR7nYc1B"
              }
            }
          }
        }
      }
    }
  }
}