Skip to main content
If there’s no official SDK for your language or runtime, you can integrate with Cano Analytics directly over HTTP — the REST API is straightforward, follows standard conventions, and works from any environment that can make an HTTPS request. This guide walks you through authentication, tracking events, identifying users, batching, and handling errors.

Base URL and Authentication

All API requests go to the following base URL. Every request must include an Authorization header with your API key as a Bearer token and a Content-Type of application/json.
You can find your API key in the Cano dashboard under Settings → API Keys.
Keep your API key secret. Never expose it in client-side JavaScript, public repositories, or logs. Use environment variables or a secrets manager to inject it at runtime.

Track an Event

Send a POST request to /events with an event name, a user identifier, and any properties you want to capture.
track-event.sh
Expected response (201 Created):
The same request in other languages:

Identify a User

Send a POST to /identify to associate a user ID with a set of traits. Call this after a user signs up or logs in so that all future events from that ID are enriched with their profile data.
identify-user.sh
Expected response (200 OK):

Batch Events

To reduce HTTP round-trips, send multiple events in a single request by posting an array to /events/batch. You can include up to 500 events per batch.
batch-events.sh
Expected response (200 OK):

Pagination

Endpoints that return lists of records (such as GET /events) use cursor-based pagination. Each response includes a next_cursor field — pass its value as the cursor query parameter to fetch the next page. When next_cursor is null, you have reached the last page.
pagination.sh
A paginated response looks like this:
Cursors are opaque, base64-encoded strings. Do not attempt to decode or construct them manually — always use the next_cursor value returned by the previous response.

Error Handling

The API returns standard HTTP status codes. All error responses include a JSON body with a machine-readable error_code and a human-readable message.
For 429 responses, the API includes a Retry-After header with the number of seconds to wait before retrying:
If an official SDK exists for your language, use it instead of calling the REST API directly. The JavaScript SDK and Python SDK handle batching, automatic retries, exponential backoff, and persistent queuing out of the box — saving you from re-implementing that logic yourself.