{"openapi":"3.1.0","info":{"title":"Polar (BYOK) API","version":"0.1.0","description":"Polar (BYOK) lets an AI assistant read your own Polar data through the Polar API with a key you supply (organization access token (read scopes only)). Read-only: 9 tools (list_organizations, list_products, list_subscriptions, list_orders, get_order, list_refunds, list_customers, get_metrics, list_meters). The BYOK key travels with each request, is used for that one call only and is never stored,...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-polar.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-polar/docs"},"termsOfService":"https://connectorbay.com/byok-polar/terms"},"servers":[{"url":"https://byok-polar.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-polar/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_organizations":{"post":{"operationId":"list_organizations","summary":"List the organizations the token can see: name, slug, status, country and default currency. Use for \"Which Polar organiz","description":"List the organizations the token can see: name, slug, status, country and default currency. Use for \"Which Polar organization does this token belong to\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many results per page (1 to 100).","title":"Limit"},"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"list_organizationsArguments","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_products":{"post":{"operationId":"list_products","summary":"List products with name, billing interval, recurring or one-time, archived flag and creation time. Needs the products:re","description":"List products with name, billing interval, recurring or one-time, archived flag and creation time. Needs the products:read scope. Use for \"What products and subscription tiers do we sell on Polar\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"query":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Filter by product name.","title":"Query"},"is_recurring":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True for only subscription products, false for only one-time products.","title":"Is Recurring"},"is_archived":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True for only archived products, false for only active ones.","title":"Is Archived"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many results per page (1 to 100).","title":"Limit"},"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"list_productsArguments","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_subscriptions":{"post":{"operationId":"list_subscriptions","summary":"List subscriptions with status, amount in cents, interval, current period end, cancel-at-period-end flag and cancellatio","description":"List subscriptions with status, amount in cents, interval, current period end, cancel-at-period-end flag and cancellation reason. Needs subscriptions:read. Use for \"Which Polar subscriptions are active, and which will cancel at period end\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True for only active subscriptions, false for only inactive ones.","title":"Active"},"status":{"anyOf":[{"enum":["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid","paused"],"type":"string"},{"type":"null"}],"default":null,"description":"Only subscriptions in this state.","title":"Status"},"cancel_at_period_end":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True to list only subscriptions set to cancel at period end.","title":"Cancel At Period End"},"product_id":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"Only items of this product id.","title":"Product Id"},"customer_id":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"Only items of this Polar customer id.","title":"Customer Id"},"started_after":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Only subscriptions started after this ISO 8601 time.","title":"Started After"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many results per page (1 to 100).","title":"Limit"},"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"list_subscriptionsArguments","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_orders":{"post":{"operationId":"list_orders","summary":"List orders (one-time purchases and subscription invoices) with status, amounts in cents, tax, refunds, invoice number a","description":"List orders (one-time purchases and subscription invoices) with status, amounts in cents, tax, refunds, invoice number and ids. Needs orders:read. Use for \"What orders did Polar record this month\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"status":{"anyOf":[{"enum":["draft","pending","paid","refunded","partially_refunded","void"],"type":"string"},{"type":"null"}],"default":null,"description":"Only orders in this state.","title":"Status"},"product_billing_type":{"anyOf":[{"enum":["one_time","recurring"],"type":"string"},{"type":"null"}],"default":null,"description":"one_time or recurring (recurring means subscription creations and renewals).","title":"Product Billing Type"},"product_id":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"Only items of this product id.","title":"Product Id"},"customer_id":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"Only items of this Polar customer id.","title":"Customer Id"},"subscription_id":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"Only orders of this subscription.","title":"Subscription Id"},"created_after":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Only orders created after this ISO 8601 time.","title":"Created After"},"created_before":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Only orders created before this ISO 8601 time.","title":"Created Before"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many results per page (1 to 100).","title":"Limit"},"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"list_ordersArguments","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_order":{"post":{"operationId":"get_order","summary":"Get one order by id with status, amounts in cents, tax, refunds, invoice number and linked ids. Use for \"Show details of","description":"Get one order by id with status, amounts in cents, tax, refunds, invoice number and linked ids. Use for \"Show details of Polar order ord_1\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"id":{"description":"Polar order id (UUID).","maxLength":200,"title":"Id","type":"string"}},"required":["id"],"title":"get_orderArguments","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_refunds":{"post":{"operationId":"list_refunds","summary":"List refunds with status, reason, amount in cents and the order and customer ids. Needs refunds:read. Use for \"Which ref","description":"List refunds with status, reason, amount in cents and the order and customer ids. Needs refunds:read. Use for \"Which refunds have been issued on Polar\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"succeeded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True for only refunds that succeeded, false for the others.","title":"Succeeded"},"order_id":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"Only refunds of this order.","title":"Order Id"},"customer_id":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"Only items of this Polar customer id.","title":"Customer Id"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many results per page (1 to 100).","title":"Limit"},"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"list_refundsArguments","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_customers":{"post":{"operationId":"list_customers","summary":"List customers with name, email, type, external id and creation time. Needs customers:read. Use for \"Which customers do ","description":"List customers with name, email, type, external id and creation time. Needs customers:read. Use for \"Which customers do we have in Polar\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"email":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only the customer with this exact email.","title":"Email"},"query":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Filter by name, email or external id.","title":"Query"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many results per page (1 to 100).","title":"Limit"},"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"list_customersArguments","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_metrics":{"post":{"operationId":"get_metrics","summary":"Revenue and subscription metrics per period in a date range: orders, revenue, net revenue (cents), MRR, ARR, active subs","description":"Revenue and subscription metrics per period in a date range: orders, revenue, net revenue (cents), MRR, ARR, active subscriptions, churn rate. Needs metrics:read. Use for \"What was our MRR and churn per month this year in Polar\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"start_date":{"description":"First day of the range, YYYY-MM-DD.","maxLength":10,"title":"Start Date","type":"string"},"end_date":{"description":"Last day of the range, YYYY-MM-DD.","maxLength":10,"title":"End Date","type":"string"},"interval":{"description":"Period size: year, month, week, day or hour.","enum":["year","month","week","day","hour"],"title":"Interval","type":"string"},"billing_type":{"anyOf":[{"enum":["one_time","recurring"],"type":"string"},{"type":"null"}],"default":null,"description":"Only recurring (subscription) or one_time sales.","title":"Billing Type"},"product_id":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"Only items of this product id.","title":"Product Id"},"customer_id":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"Only items of this Polar customer id.","title":"Customer Id"}},"required":["start_date","end_date","interval"],"title":"get_metricsArguments","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_meters":{"post":{"operationId":"list_meters","summary":"List usage meters (name, unit, aggregation function, archived time) used for usage-based billing. Needs meters:read. Use","description":"List usage meters (name, unit, aggregation function, archived time) used for usage-based billing. Needs meters:read. Use for \"Which usage meters are configured in Polar\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many results per page (1 to 100).","title":"Limit"},"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"list_metersArguments","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}}}}