API Documentation

Welcome to the #divisions API reference. Our RESTful API allows you to programmatically manage users, projects, analytics, and webhooks. All requests and responses use JSON encoding over HTTPS.

💡 Tip

Use our official SDKs for faster integration, or interact directly with the raw endpoints documented below.

Base URL & Versioning

All API requests must be made to the following base URL. We use URL path versioning to maintain backward compatibility.

Base URL
https://api.divisions.io/v1

Authentication

The API uses Bearer token authentication. Include your API key in the Authorization header of every request.

Headers
Authorization: Bearer div_live_sk_8f9a2b3c4d5e6f7g8h9i0j
Content-Type: application/json
⚠️ Security Notice

Never expose your secret API keys in client-side code. Use environment variables and server-side proxies.

Users

Manage team members, roles, and account permissions.

GET /v1/users

Returns a paginated list of all users in your organization.

Query Parameters

ParameterTypeDescription
limitintegerNumber of results per page (1-100). Default: 20
cursorstringPagination cursor from previous response
rolestringFilter by role: admin, member, viewer

Response

200 OK
{
  "data": [
    {
      "id": "usr_9f8e7d6c5b4a",
      "name": "Alex Morgan",
      "email": "alex@divisions.io",
      "role": "admin",
      "created_at": "2024-11-15T08:30:00Z"
    }
  ],
  "pagination": {
    "next_cursor": "eyJpZCI6MTAyMn0=",
    "has_more": true
  }
}

Projects

Create, update, and manage your division projects.

POST /v1/projects

Creates a new project workspace.

Request Body

FieldTypeRequiredDescription
namestringRequiredProject name (3-50 chars)
descriptionstringOptional project description
regionstringDeployment region: us-east, eu-west, ap-south

Example Request

JSON
{
  "name": "Q4 Marketing Campaign",
  "description": "Cross-channel analytics tracking",
  "region": "us-east"
}
PUT /v1/projects/:id

Updates an existing project configuration.

Analytics

GET /v1/analytics/summary

Returns aggregated metrics for the specified time range.

Query Parameters

ParameterTypeDescription
start_datestringISO 8601 timestamp
end_datestringISO 8601 timestamp
granularitystringhourly, daily, weekly

Error Codes

#divisions uses conventional HTTP status codes. Error responses include a structured JSON payload.

CodeMeaningDescription
400Bad RequestInvalid parameters or malformed JSON
401UnauthorizedMissing or invalid API key
403ForbiddenInsufficient permissions for this resource
404Not FoundResource does not exist
429Too Many RequestsRate limit exceeded. Retry after header applies.
500Internal ErrorSomething went wrong on our end. Contact support.
Error Response Format
{
  "error": {
    "code": "invalid_request",
    "message": "Missing required field: name",
    "request_id": "req_8f9a2b3c"
  }
}

Rate Limits

API requests are limited based on your plan tier. Limits are applied per API key.

PlanRequests/minBurst Limit
Starter6010
Professional60050
EnterpriseCustomCustom

Rate limit headers are included in every response:

Response Headers
X-RateLimit-Limit: 600
X-RateLimit-Remaining: 582
X-RateLimit-Reset: 1703982400