{"openapi":"3.1.0","info":{"title":"Referly (BYOK) API","version":"0.1.0","description":"Referly (BYOK) lets an AI assistant read your own Referly data through the Referly API with a key you supply (Referly API key (needs the Business plan)). Read-only: 7 tools (list_affiliates, get_affiliate, list_referrals, list_sales, list_affiliate_links, list_coupons, list_promotional_codes). The BYOK key travels with each request, is used for that one call only and is never stored, logged or...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-referly.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-referly/docs"},"termsOfService":"https://connectorbay.com/byok-referly/terms"},"servers":[{"url":"https://byok-referly.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-referly/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/list_affiliates":{"post":{"operationId":"list_affiliates","summary":"List every affiliate of the program with status, commission rate, link slug, referred user and click counts and total co","description":"List every affiliate of the program with status, commission rate, link slug, referred user and click counts and total commission earned (names, emails and payout details are left out). Returns all affiliates; no paging. Use for \"How many affiliates does my Referly program have and who earned the most\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"list_affiliatesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_affiliate":{"post":{"operationId":"get_affiliate","summary":"Get one affiliate by UUID or link slug: status, commission rate, click and referral counts and earnings (contact details","description":"Get one affiliate by UUID or link slug: status, commission rate, click and referral counts and earnings (contact details left out). The answer is null when nothing matches. Use for \"How is Referly affiliate jane-doe doing\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"id":{"description":"Affiliate UUID, one of their link slugs, or a numeric click id.","maxLength":60,"title":"Id","type":"string"}},"required":["id"],"title":"get_affiliateArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_referrals":{"post":{"operationId":"list_referrals","summary":"List referrals (customers brought in by affiliates) with plan, subscription status, medium, revenue and commission; name","description":"List referrals (customers brought in by affiliates) with plan, subscription status, medium, revenue and commission; names and emails are left out. Filter by affiliate; with no filter returns all. Use for \"Which Referly referrals are active and how much revenue did they bring\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"affiliate_id":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"default":null,"description":"Only items that belong to this affiliate UUID (id from list_affiliates).","title":"Affiliate Id"},"external_id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only referrals whose referredUserExternalId equals this id from your own system.","title":"External Id"}},"title":"list_referralsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_sales":{"post":{"operationId":"list_sales","summary":"List sales credited to affiliates with amount, commission rate, commission earned, status (active or refunded), payment ","description":"List sales credited to affiliates with amount, commission rate, commission earned, status (active or refunded), payment trigger and date; customer names and emails are left out. Use for \"Which Referly sales were refunded this quarter\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"affiliate_id":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"default":null,"description":"Only items that belong to this affiliate UUID (id from list_affiliates).","title":"Affiliate Id"},"referral_id":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"default":null,"description":"Only sales of this referral UUID.","title":"Referral Id"},"sale_external_id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only sales whose externalId matches this id from your own system.","title":"Sale External Id"},"sale_external_invoice_id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only sales whose externalInvoiceId matches this invoice id from your system.","title":"Sale External Invoice Id"}},"title":"list_salesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_affiliate_links":{"post":{"operationId":"list_affiliate_links","summary":"List affiliate links with click, referral and sale counts, revenue and the ready-to-share URLs; the affiliate's name and","description":"List affiliate links with click, referral and sale counts, revenue and the ready-to-share URLs; the affiliate's name and email are left out. Use for \"How many clicks and sales does each Referly affiliate link have\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"affiliate_id":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"default":null,"description":"Only items that belong to this affiliate UUID (id from list_affiliates).","title":"Affiliate Id"},"link":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}],"default":null,"description":"Only the link with this slug, for example jane-doe.","title":"Link"}},"title":"list_affiliate_linksArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_coupons":{"post":{"operationId":"list_coupons","summary":"List coupons (the discount definitions: percent or flat amount, duration, redemptions, validity and billing integration)","description":"List coupons (the discount definitions: percent or flat amount, duration, redemptions, validity and billing integration). Filter by name or id. Use for \"Which discount coupons exist in my Referly program\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"id":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"default":null,"description":"Coupon UUID; returns a single coupon.","title":"Id"},"name":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Coupon name; returns a single coupon.","title":"Name"}},"title":"list_couponsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_promotional_codes":{"post":{"operationId":"list_promotional_codes","summary":"List promotional codes (the strings customers type at checkout) with their coupon, assigned affiliate, expiry and redemp","description":"List promotional codes (the strings customers type at checkout) with their coupon, assigned affiliate, expiry and redemption counts. Use for \"Which Referly promo codes are active and how often were they used\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"affiliate_id":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"default":null,"description":"Only items that belong to this affiliate UUID (id from list_affiliates).","title":"Affiliate Id"},"code":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"default":null,"description":"Only this code string, for example JANE20.","title":"Code"},"coupon_id":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"default":null,"description":"Only codes of this coupon UUID.","title":"Coupon Id"}},"title":"list_promotional_codesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}