{"openapi":"3.1.0","info":{"title":"Basely API","version":"1.0.0","description":"One key per business. The business comes from the key, never from the request. Money is in integer cents with a currency; dates are ISO. Every response carries an x-request-id header; errors carry it in the body too."},"servers":[{"url":"https://api.baselyapp.com/v1"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Authorization: Bearer bsk_live_... or bsk_test_..."}}},"paths":{"/me":{"get":{"operationId":"me","summary":"The business and the key behind this request.","description":"The business and the key behind this request. Any valid key of the business. Rate limit: 120 requests per minute per key.","tags":["platform"],"security":[{"bearer":[]}],"x-basely-scope":null,"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/financial/summary":{"get":{"operationId":"financial.summary","summary":"Cash, inflows, outflows, expenses, recurring costs, burn and runway for a period.","description":"Cash, inflows, outflows, expenses, recurring costs, burn and runway for a period. Scope: `financial:read`. Rate limit: 20 requests per minute per key. Needs finance enabled and the books set up for the business.","tags":["financial"],"security":[{"bearer":[]}],"x-basely-scope":"financial:read","parameters":[{"name":"period","in":"query","required":false,"description":"A month, YYYY-MM. Default: the current month in the books' timezone.","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"Start date, YYYY-MM-DD.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"description":"End date, YYYY-MM-DD. Up to two years after from.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/financial/cash-flow":{"get":{"operationId":"financial.cash_flow","summary":"Cash flow month by month: operating, investing and financing.","description":"Cash flow month by month: operating, investing and financing. Scope: `financial:read`. Rate limit: 20 requests per minute per key. Needs finance enabled and the books set up for the business.","tags":["financial"],"security":[{"bearer":[]}],"x-basely-scope":"financial:read","parameters":[{"name":"from","in":"query","required":false,"description":"Start date. Default: January 1st.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"description":"End date. Default: today.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/financial/reports/{report}":{"get":{"operationId":"financial.report","summary":"A financial report: pnl, balance-sheet, expenses-by-category or trial-balance.","description":"A financial report: pnl, balance-sheet, expenses-by-category or trial-balance. Scope: `financial:read`. Rate limit: 20 requests per minute per key. Needs finance enabled and the books set up for the business.","tags":["financial"],"security":[{"bearer":[]}],"x-basely-scope":"financial:read","parameters":[{"name":"report","in":"path","required":true,"schema":{"type":"string"}},{"name":"period","in":"query","required":false,"description":"A month, YYYY-MM. Default: the current month in the books' timezone.","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"Start date, YYYY-MM-DD.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"description":"End date, YYYY-MM-DD. Up to two years after from.","schema":{"type":"string","format":"date"}},{"name":"basis","in":"query","required":false,"description":"cash or accrual. Default: the books' basis.","schema":{"type":"string","enum":["cash","accrual"]}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/accounts":{"get":{"operationId":"accounts.list","summary":"Bank accounts connected to the books, with their ledger balance.","description":"Bank accounts connected to the books, with their ledger balance. Scope: `accounts:read`. Rate limit: 120 requests per minute per key. Needs finance enabled and the books set up for the business.","tags":["financial"],"security":[{"bearer":[]}],"x-basely-scope":"accounts:read","responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/transactions":{"get":{"operationId":"transactions.list","summary":"Bank transactions, newest first.","description":"Bank transactions, newest first. Scope: `transactions:read`. Rate limit: 120 requests per minute per key. Needs finance enabled and the books set up for the business.","tags":["financial"],"security":[{"bearer":[]}],"x-basely-scope":"transactions:read","parameters":[{"name":"from","in":"query","required":false,"description":"From date.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"description":"To date.","schema":{"type":"string","format":"date"}},{"name":"account_id","in":"query","required":false,"description":"Only this bank account.","schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","required":false,"description":"needs_review, categorized, matched or excluded.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"1 to 100. Default 50.","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/transactions/{id}":{"get":{"operationId":"transactions.get","summary":"One bank transaction.","description":"One bank transaction. Scope: `transactions:read`. Rate limit: 120 requests per minute per key. Needs finance enabled and the books set up for the business.","tags":["financial"],"security":[{"bearer":[]}],"x-basely-scope":"transactions:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/transactions/{id}/categorize":{"post":{"operationId":"transactions.categorize","summary":"Post a bank transaction to a category in the books.","description":"Post a bank transaction to a category in the books. Scope: `transactions:write`. Rate limit: 30 requests per minute per key. Needs finance enabled and the books set up for the business. Test keys (bsk_test_) validate the request and never save it.","tags":["financial"],"security":[{"bearer":[]}],"x-basely-scope":"transactions:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"category_id":{"type":"string","format":"uuid","description":"Ledger account (from the chart of accounts) to post to."},"always":{"type":"boolean","description":"Also create a rule for this description."},"pattern":{"type":"string","description":"Text the rule matches. Default: the merchant."}},"required":["category_id"]},{"type":"object","properties":{"entry_id":{"type":"string","format":"uuid","description":"Match to a journal entry that already exists (no double posting)."}},"required":["entry_id"]},{"type":"object","properties":{"bill_id":{"type":"string","format":"uuid","description":"This transaction pays an open bill of the exact amount."}},"required":["bill_id"]}]}}}},"responses":{"201":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/invoices":{"get":{"operationId":"invoices.list","summary":"Invoices, newest first.","description":"Invoices, newest first. Scope: `invoices:read`. Rate limit: 120 requests per minute per key. Needs finance enabled and the books set up for the business.","tags":["financial"],"security":[{"bearer":[]}],"x-basely-scope":"invoices:read","parameters":[{"name":"status","in":"query","required":false,"description":"draft, open or void.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"1 to 100. Default 50.","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}},"post":{"operationId":"invoices.create","summary":"Create an invoice.","description":"Create an invoice. Scope: `invoices:write`. Rate limit: 30 requests per minute per key. Needs finance enabled and the books set up for the business. Test keys (bsk_test_) validate the request and never save it.","tags":["financial"],"security":[{"bearer":[]}],"x-basely-scope":"invoices:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customer":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"address":{"type":"string"}},"required":["name"]},"contact_id":{"type":"string","format":"uuid"},"date":{"type":"string","format":"date","description":"Default: today."},"due_date":{"type":"string","format":"date"},"terms_days":{"type":"integer","description":"Used when due_date is missing. Default 15.","minimum":0,"maximum":365},"lines":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","properties":{"description":{"type":"string"},"quantity":{"type":"number","default":1},"unit_cents":{"type":"integer","minimum":0},"income_account_id":{"type":"string","format":"uuid"},"taxable":{"type":"boolean"}},"required":["description","unit_cents","income_account_id"]}},"tax_percent":{"type":"number","minimum":0,"maximum":100},"tax_label":{"type":"string"},"deposit_cents":{"type":"integer","minimum":0},"memo":{"type":"string"},"reminders":{"type":"boolean"}},"required":["customer","lines"]}}}},"responses":{"201":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/invoices/{id}":{"get":{"operationId":"invoices.get","summary":"One invoice, with what is still open.","description":"One invoice, with what is still open. Scope: `invoices:read`. Rate limit: 120 requests per minute per key. Needs finance enabled and the books set up for the business.","tags":["financial"],"security":[{"bearer":[]}],"x-basely-scope":"invoices:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/invoices/{id}/payments":{"post":{"operationId":"invoices.payment","summary":"Record a payment received for an invoice.","description":"Record a payment received for an invoice. Scope: `invoices:write`. Rate limit: 30 requests per minute per key. Needs finance enabled and the books set up for the business. Test keys (bsk_test_) validate the request and never save it.","tags":["financial"],"security":[{"bearer":[]}],"x-basely-scope":"invoices:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["cash","check","bank","other"]},"date":{"type":"string","format":"date"},"cash_account_id":{"type":"string","format":"uuid","description":"The cash or bank account in the books that received it."},"amount_cents":{"type":"integer","description":"Default: what is still due.","minimum":1},"reference":{"type":"string"}},"required":["method","date","cash_account_id"]}}}},"responses":{"201":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/bills":{"get":{"operationId":"bills.list","summary":"Bills to pay, newest first.","description":"Bills to pay, newest first. Scope: `bills:read`. Rate limit: 120 requests per minute per key. Needs finance enabled and the books set up for the business.","tags":["financial"],"security":[{"bearer":[]}],"x-basely-scope":"bills:read","parameters":[{"name":"status","in":"query","required":false,"description":"awaiting (needs the owner's OK), open or void.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"1 to 100. Default 50.","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}},"post":{"operationId":"bills.create","summary":"Create a bill to pay.","description":"Create a bill to pay. Scope: `bills:write`. Rate limit: 30 requests per minute per key. Needs finance enabled and the books set up for the business. Test keys (bsk_test_) validate the request and never save it.","tags":["financial"],"security":[{"bearer":[]}],"x-basely-scope":"bills:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"vendor":{"type":"string"},"number":{"type":"string"},"date":{"type":"string","format":"date"},"due_date":{"type":"string","format":"date"},"amount_cents":{"type":"integer","minimum":1},"category_id":{"type":"string","format":"uuid"},"memo":{"type":"string"}},"required":["vendor","date","due_date","amount_cents","category_id"]}}}},"responses":{"201":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/contacts":{"get":{"operationId":"contacts.list","summary":"Contacts of the business.","description":"Contacts of the business. Scope: `contacts:read`. Rate limit: 120 requests per minute per key.","tags":["crm"],"security":[{"bearer":[]}],"x-basely-scope":"contacts:read","parameters":[{"name":"search","in":"query","required":false,"description":"Name, email or phone.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"1 to 200. Default 50.","schema":{"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}},"post":{"operationId":"contacts.upsert","summary":"Create a contact, or update the one with the same email or phone.","description":"Create a contact, or update the one with the same email or phone. Scope: `contacts:write`. Rate limit: 30 requests per minute per key. Test keys (bsk_test_) validate the request and never save it.","tags":["crm"],"security":[{"bearer":[]}],"x-basely-scope":"contacts:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"language":{"type":"string"},"external_id":{"type":"string","description":"Your id for this person."}}}}}},"responses":{"201":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/email/send":{"post":{"operationId":"email.send","summary":"Send one transactional email from the business's verified domain. Accepts Idempotency-Key.","description":"Send one transactional email from the business's verified domain. Accepts Idempotency-Key. Scope: `email:send`. Rate limit: 30 requests per minute per key. Test keys (bsk_test_) validate the request and never save it.","tags":["email"],"security":[{"bearer":[]}],"x-basely-scope":"email:send","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","description":"The recipient. A string, or { email, name }. One recipient per call."},"from":{"type":"string","description":"An address on the business's verified domain, or { email, name }. Default: the business sender."},"reply_to":{"type":"string","description":"Where replies go."},"subject":{"type":"string","description":"Required without a template."},"html":{"type":"string","description":"HTML body. Required without a template (or `text`)."},"text":{"type":"string","description":"Plain text body."},"template":{"type":"string","description":"A template slug, or { slug, variables }. Variables are escaped."},"metadata":{"type":"string","description":"Up to 20 keys, string values up to 500 characters. Returned on reads and events."},"headers":{"type":"string","description":"Only List-Unsubscribe and List-Unsubscribe-Post."},"category":{"type":"string","description":"Only `transactional` in v1.","enum":["transactional"]}},"required":["to"]}}}},"responses":{"201":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/email/messages":{"get":{"operationId":"email.messages.list","summary":"Emails sent by the business, newest first.","description":"Emails sent by the business, newest first. Scope: `email:read`. Rate limit: 120 requests per minute per key.","tags":["email"],"security":[{"bearer":[]}],"x-basely-scope":"email:read","parameters":[{"name":"limit","in":"query","required":false,"description":"1 to 100. Default 50.","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"description":"queued, sent, delivered, bounced, complained, suppressed, failed or test.","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"Only emails to this address.","schema":{"type":"string"}},{"name":"before","in":"query","required":false,"description":"The id of an email: returns the ones sent before it.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/email/messages/{id}":{"get":{"operationId":"email.messages.get","summary":"One email, with its status and delivery events.","description":"One email, with its status and delivery events. Scope: `email:read`. Rate limit: 120 requests per minute per key.","tags":["email"],"security":[{"bearer":[]}],"x-basely-scope":"email:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/email/senders":{"get":{"operationId":"email.senders","summary":"The business's sender and whether it can send now.","description":"The business's sender and whether it can send now. Scope: `email:read`. Rate limit: 120 requests per minute per key.","tags":["email"],"security":[{"bearer":[]}],"x-basely-scope":"email:read","responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/email/templates":{"get":{"operationId":"email.templates.list","summary":"The business's email templates.","description":"The business's email templates. Scope: `email:read`. Rate limit: 120 requests per minute per key.","tags":["email"],"security":[{"bearer":[]}],"x-basely-scope":"email:read","responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}},"post":{"operationId":"email.templates.create","summary":"Create or replace a template. Variables are {{name}} and are escaped on send.","description":"Create or replace a template. Variables are {{name}} and are escaped on send. Scope: `email_templates:write`. Rate limit: 30 requests per minute per key. Test keys (bsk_test_) validate the request and never save it.","tags":["email"],"security":[{"bearer":[]}],"x-basely-scope":"email_templates:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","description":"a-z, 0-9 and dashes."},"name":{"type":"string"},"subject":{"type":"string","description":"Can use {{variables}}."},"html":{"type":"string","description":"Can use {{variables}}; values are escaped on send."},"text":{"type":"string"}},"required":["slug","name","subject","html"]}}}},"responses":{"201":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/email/templates/{slug}":{"get":{"operationId":"email.templates.get","summary":"One template.","description":"One template. Scope: `email:read`. Rate limit: 120 requests per minute per key.","tags":["email"],"security":[{"bearer":[]}],"x-basely-scope":"email:read","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}},"put":{"operationId":"email.templates.update","summary":"Update a template.","description":"Update a template. Scope: `email_templates:write`. Rate limit: 30 requests per minute per key. Test keys (bsk_test_) validate the request and never save it.","tags":["email"],"security":[{"bearer":[]}],"x-basely-scope":"email_templates:write","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"}}}}}},"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/sms/send":{"post":{"operationId":"sms.send","summary":"Send one transactional text from a business number. Accepts Idempotency-Key.","description":"Send one transactional text from a business number. Accepts Idempotency-Key. Scope: `sms:send`. Rate limit: 30 requests per minute per key. Test keys (bsk_test_) validate the request and never save it.","tags":["sms"],"security":[{"bearer":[]}],"x-basely-scope":"sms:send","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","description":"The recipient, E.164 (+13235550142). One recipient per call."},"contact_id":{"type":"string","format":"uuid","description":"A contact of the business, instead of `to`."},"body":{"type":"string","description":"The text. Up to 1600 characters; billed and counted by segment."},"from":{"type":"string","description":"A business number (E.164). Default: the main number."},"category":{"type":"string","description":"Only `transactional` in v1.","enum":["transactional"]}},"required":["body"]}}}},"responses":{"201":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/sms/messages":{"get":{"operationId":"sms.messages.list","summary":"Texts sent by the business, newest first. Recipients are masked.","description":"Texts sent by the business, newest first. Recipients are masked. Scope: `sms:read`. Rate limit: 120 requests per minute per key.","tags":["sms"],"security":[{"bearer":[]}],"x-basely-scope":"sms:read","parameters":[{"name":"limit","in":"query","required":false,"description":"1 to 100. Default 50.","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"before","in":"query","required":false,"description":"The id of a text: returns the ones sent before it.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/sms/messages/{id}":{"get":{"operationId":"sms.messages.get","summary":"One text, with its delivery status and segments.","description":"One text, with its delivery status and segments. Scope: `sms:read`. Rate limit: 120 requests per minute per key.","tags":["sms"],"security":[{"bearer":[]}],"x-basely-scope":"sms:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/sms/senders":{"get":{"operationId":"sms.senders","summary":"The business numbers, with the US A2P registration status and whether each can send now.","description":"The business numbers, with the US A2P registration status and whether each can send now. Scope: `sms:read`. Rate limit: 120 requests per minute per key.","tags":["sms"],"security":[{"bearer":[]}],"x-basely-scope":"sms:read","responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/businesses/{negocioId}/conversations":{"get":{"operationId":"phone.conversations","summary":"Messages and calls, masked.","description":"Messages and calls, masked. Scope: `conversations:read`. Rate limit: 120 requests per minute per key. Phone route: the business id in the URL must be the key's business.","tags":["phone"],"security":[{"bearer":[]}],"x-basely-scope":"conversations:read","parameters":[{"name":"negocioId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/businesses/{negocioId}/texts":{"post":{"operationId":"phone.texts.send","summary":"Send a text from the business number.","description":"Send a text from the business number. Scope: `texts:send`. Rate limit: 30 requests per minute per key. Test keys (bsk_test_) validate the request and never save it. Phone route: the business id in the URL must be the key's business.","tags":["phone"],"security":[{"bearer":[]}],"x-basely-scope":"texts:send","parameters":[{"name":"negocioId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/businesses/{negocioId}/emails":{"post":{"operationId":"phone.emails","summary":"Hand a received email to the inbox.","description":"Hand a received email to the inbox. Scope: `inbox:write`. Rate limit: 30 requests per minute per key. Test keys (bsk_test_) validate the request and never save it. Phone route: the business id in the URL must be the key's business.","tags":["phone"],"security":[{"bearer":[]}],"x-basely-scope":"inbox:write","parameters":[{"name":"negocioId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/businesses/{negocioId}/calls":{"post":{"operationId":"phone.calls","summary":"Ring a team member.","description":"Ring a team member. Scope: `calls:create`. Rate limit: 30 requests per minute per key. Test keys (bsk_test_) validate the request and never save it. Phone route: the business id in the URL must be the key's business.","tags":["phone"],"security":[{"bearer":[]}],"x-basely-scope":"calls:create","parameters":[{"name":"negocioId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/businesses/{negocioId}/contacts":{"post":{"operationId":"phone.contacts","summary":"Declare a customer or a team member.","description":"Declare a customer or a team member. Scope: `phone_contacts:write`. Rate limit: 30 requests per minute per key. Test keys (bsk_test_) validate the request and never save it. Phone route: the business id in the URL must be the key's business.","tags":["phone"],"security":[{"bearer":[]}],"x-basely-scope":"phone_contacts:write","parameters":[{"name":"negocioId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/businesses/{negocioId}/sessions":{"post":{"operationId":"phone.sessions.open","summary":"Open a masked line.","description":"Open a masked line. Scope: `sessions:manage`. Rate limit: 30 requests per minute per key. Test keys (bsk_test_) validate the request and never save it. Phone route: the business id in the URL must be the key's business.","tags":["phone"],"security":[{"bearer":[]}],"x-basely-scope":"sessions:manage","parameters":[{"name":"negocioId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/businesses/{negocioId}/sessions/{sessionId}":{"delete":{"operationId":"phone.sessions.close","summary":"Close a masked line.","description":"Close a masked line. Scope: `sessions:manage`. Rate limit: 30 requests per minute per key. Test keys (bsk_test_) validate the request and never save it. Phone route: the business id in the URL must be the key's business.","tags":["phone"],"security":[{"bearer":[]}],"x-basely-scope":"sessions:manage","parameters":[{"name":"negocioId","in":"path","required":true,"schema":{"type":"string"}},{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/businesses/{negocioId}/otp":{"post":{"operationId":"phone.otp.send","summary":"Send a one-time code by text.","description":"Send a one-time code by text. Scope: `otp:send`. Rate limit: 30 requests per minute per key. Test keys (bsk_test_) validate the request and never save it. Phone route: the business id in the URL must be the key's business.","tags":["phone"],"security":[{"bearer":[]}],"x-basely-scope":"otp:send","parameters":[{"name":"negocioId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}},"/businesses/{negocioId}/otp/verify":{"post":{"operationId":"phone.otp.verify","summary":"Verify a one-time code.","description":"Verify a one-time code. Scope: `otp:send`. Rate limit: 30 requests per minute per key. Test keys (bsk_test_) validate the request and never save it. Phone route: the business id in the URL must be the key's business.","tags":["phone"],"security":[{"bearer":[]}],"x-basely-scope":"otp:send","parameters":[{"name":"negocioId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"403":{"description":"Scope or module not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MISSING_KEY","INVALID_KEY","KEY_REVOKED","KEY_EXPIRED","NOT_FOUND","BUSINESS_FROZEN","BUSINESS_CLOSED","SCOPE_DENIED","MODULE_NOT_ENABLED","BOOKS_NOT_SET_UP","RATE_LIMITED","INVALID_REQUEST","INVALID_JSON","TEST_MODE","CONFLICT","FORBIDDEN","NO_SENDER","SENDER_NOT_REGISTERED","SENDER_NOT_VERIFIED","SENDER_PAUSED","SYSTEM_SENDER_ONLY_FOR_SYSTEM","RECIPIENT_OPTED_OUT","RECIPIENT_SUPPRESSED","RECIPIENT_REJECTED","RECIPIENT_NOT_FOUND","INVALID_RECIPIENT","EMPTY_BODY","QUOTA_EXCEEDED","PROVIDER_UNAVAILABLE","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_IN_PROGRESS","BULK_NOT_ALLOWED","CATEGORY_NOT_ALLOWED","TEMPLATE_NOT_FOUND","SEND_FAILED","INTERNAL"]},"message":{"type":"string"},"request_id":{"type":"string"},"scope":{"type":"string"},"field":{"type":"string"},"reason":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}}},"404":{"description":"Not found"},"409":{"description":"Business frozen or closed, books not set up, or the books refuse the change"},"429":{"description":"Rate limited. See the retry-after header."}}}}},"x-basely-scopes":[{"name":"financial:read","service":"financial","writes":false,"writes_to_books":false,"available":true},{"name":"accounts:read","service":"financial","writes":false,"writes_to_books":false,"available":true},{"name":"transactions:read","service":"financial","writes":false,"writes_to_books":false,"available":true},{"name":"transactions:write","service":"financial","writes":true,"writes_to_books":true,"available":true},{"name":"invoices:read","service":"financial","writes":false,"writes_to_books":false,"available":true},{"name":"invoices:write","service":"financial","writes":true,"writes_to_books":true,"available":true},{"name":"bills:read","service":"financial","writes":false,"writes_to_books":false,"available":true},{"name":"bills:write","service":"financial","writes":true,"writes_to_books":true,"available":true},{"name":"contacts:read","service":"crm","writes":false,"writes_to_books":false,"available":true},{"name":"contacts:write","service":"crm","writes":true,"writes_to_books":false,"available":true},{"name":"conversations:read","service":"phone","writes":false,"writes_to_books":false,"available":true},{"name":"texts:send","service":"phone","writes":true,"writes_to_books":false,"available":true},{"name":"inbox:write","service":"phone","writes":true,"writes_to_books":false,"available":true},{"name":"calls:create","service":"phone","writes":true,"writes_to_books":false,"available":true},{"name":"sessions:manage","service":"phone","writes":true,"writes_to_books":false,"available":true},{"name":"otp:send","service":"phone","writes":true,"writes_to_books":false,"available":true},{"name":"phone_contacts:write","service":"phone","writes":true,"writes_to_books":false,"available":true},{"name":"bank:refresh","service":"banking","writes":true,"writes_to_books":false,"available":false},{"name":"email:send","service":"email","writes":true,"writes_to_books":false,"available":true},{"name":"email:read","service":"email","writes":false,"writes_to_books":false,"available":true},{"name":"email_templates:write","service":"email","writes":true,"writes_to_books":false,"available":true},{"name":"sms:send","service":"sms","writes":true,"writes_to_books":false,"available":true},{"name":"sms:read","service":"sms","writes":false,"writes_to_books":false,"available":true},{"name":"calendar:read","service":"calendar","writes":false,"writes_to_books":false,"available":false},{"name":"calendar:write","service":"calendar","writes":true,"writes_to_books":false,"available":false},{"name":"files:read","service":"files","writes":false,"writes_to_books":false,"available":false}],"x-basely-events":["transaction.created","transaction.categorized","invoice.created","invoice.paid","bill.created","bill.paid","bank_connection.disconnected","sms.sent","sms.delivered","sms.failed","sms.opted_out","email.sent","email.delivered","email.bounced","email.complained","email.failed"],"x-basely-webhooks":{"signature":"basely-signature: t=<unix seconds>,v1=<hex HMAC-SHA256(secret, `${t}.${body}`)>","event_id_header":"basely-event-id","retries":"1 min, 5 min, 15 min, 1 h, 3 h, then every 6 h, for up to 24 hours"}}