Using the API
All API requests require a valid API key sent via the Authorization header using the Bearer scheme.
Base URL
Section titled “Base URL”https://api.cohost.vip/v1Making Requests
Section titled “Making Requests”Include your API key in the Authorization header:
curl https://api.cohost.vip/v1/events \ -H "Authorization: Bearer YOUR_API_KEY"JavaScript
Section titled “JavaScript”const response = await fetch('https://api.cohost.vip/v1/events', { headers: { Authorization: `Bearer ${process.env.COHOST_API_KEY}`, },});
const { data } = await response.json();Python
Section titled “Python”import requestsimport os
response = requests.get( 'https://api.cohost.vip/v1/events', headers={'Authorization': f'Bearer {os.environ["COHOST_API_KEY"]}'},)
data = response.json()['data']Response Format
Section titled “Response Format”All responses are wrapped in an envelope:
{ "status": "ok", "data": { ... }}Error responses use the same format:
{ "status": "error", "error": { "message": "Invalid API key provided", "code": "UNAUTHORIZED" }}HTTP Status Codes
Section titled “HTTP Status Codes”| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad request — check your request body |
| 401 | Unauthorized — invalid or missing API key |
| 403 | Forbidden — key doesn’t have permission |
| 404 | Resource not found |
| 500 | Server error |
Rate Limits
Section titled “Rate Limits”API requests are rate-limited per key. If you exceed the limit you’ll receive a 429 Too Many Requests response. Back off and retry with exponential delay.
Next Steps
Section titled “Next Steps”- Quick Start — make your first API call
- API Reference — browse all endpoints