Skip to content

Using the API

All API requests require a valid API key sent via the Authorization header using the Bearer scheme.

https://api.cohost.vip/v1

Include your API key in the Authorization header:

Terminal window
curl https://api.cohost.vip/v1/events \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch('https://api.cohost.vip/v1/events', {
headers: {
Authorization: `Bearer ${process.env.COHOST_API_KEY}`,
},
});
const { data } = await response.json();
import requests
import os
response = requests.get(
'https://api.cohost.vip/v1/events',
headers={'Authorization': f'Bearer {os.environ["COHOST_API_KEY"]}'},
)
data = response.json()['data']

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"
}
}
CodeMeaning
200Success
201Created
400Bad request — check your request body
401Unauthorized — invalid or missing API key
403Forbidden — key doesn’t have permission
404Resource not found
500Server error

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.