Welcome to the Sunwise API 🚀
Introduction
Welcome to the API for Sunwise. This service allows you to access securely and effectively via API. This platform offers you two primary operations:
- Retrieve data from the Sunwise application to be used in any of your integrations.
- Create data (e.g. Contacts) in your Sunwise application from any place.
This guide will lead you through the setup and use cases for this API.
Interactive documentation: visit API Documentation at Swagger UI to explore and test endpoints.
Requirements
- Active Sunwise account.
- HTTP client (
curl, Postman, Insomnia) or your own SDK.
Environments & Base URL
-
Production
https://production.sunwise.ai/boty/api/v1 -
OpenAPI (Swagger)
https://production.sunwise.ai/boty/docs/api
Check the Swagger documentation for the full list of endpoints and parameters.
Authentication
The API uses Bearer Token in the Authorization header.
Authorization: Bearer <YOUR_API_KEY>
Example headers:
Authorization: Bearer <YOUR_API_KEY>
Content-Type: application/json
Accept: application/json
Obtain your API key from the login endpoint using your active Sunwise account credentials.
Getting Started
The below flow describe what currently is available in the API, please consult the swagger documentation for further information:
First Request
Replace <YOUR_API_KEY> with your token.
curl
curl -X GET "https://production.sunwise.ai//boty/api/v1/contacts/" -H "Authorization: Bearer <YOUR_API_KEY>" -H "Accept: application/json"
Usage Examples
Python (requests)
import os
import requests
BASE_URL = "https://production.sunwise.ai/boty/api/v1"
API_KEY = os.getenv("BOTY_API_KEY") or "<YOUR_API_KEY>"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Accept": "application/json",
"Content-Type": "application/json",
}
resp = requests.get(f"{BASE_URL}/contacts/", headers=headers, timeout=30)
resp.raise_for_status()
print(resp.json())
JavaScript (fetch)
const BASE_URL = "https://production.sunwise.ai/boty/api/v1";
const API_KEY = "<YOUR_API_KEY>";
async function main() {
const res = await fetch(`${BASE_URL}/contacts/`, {
method: "GET",
headers: {
Authorization: `Bearer ${API_KEY}`,
Accept: "application/json",
},
});
if (!res.ok) {
throw new Error(`HTTP ${res.status}: ${await res.text()}`);
}
const data = await res.json();
console.log(data);
}
main().catch(console.error);
Postman / Insomnia
- Open Swagger and copy the OpenAPI URL.
- In Postman, Import → Link → paste the OpenAPI URL.
- Create an environment variable
BOTY_API_KEYand use it in the header:Authorization: Bearer {{BOTY_API_KEY}}
Next Steps
- Review API Documentation in Swagger and identify key endpoints.
- Test with Try it out and copy generated
curl. - Integrate your client (Python/JS) with Bearer Token and handle errors/pagination.
- For questions on permissions, rate limits, or schemas, contact Support.
Support
- Developer portal: Swagger Docs
- Contact: soporte@sunwise.io