Documentation

Organizations

Manage your organization settings and review the org-level audit endpoints. Create, get, update, and delete organizations plus a paginated audit log listing.

Manage your organization settings and review audit logs of all actions taken.

Organizations

List Organizations

GET/organisations

List all organizations the current user belongs to.

Create Organization

POST/organisations

Create a new organization.

Request · bash
curl -X POST https://zopnight.com/api/organisations \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
  "name": "Acme Corp"
}'
Response · json
{
"data": {
  "id": "org_acme001",
  "name": "Acme Corp",
  "createdBy": "founder@acme.com",
  "createdAt": "2025-01-05T08:00:00Z",
  "updatedAt": "2025-01-05T08:00:00Z"
}
}

Get Current Organization

GET/organisation

Get details of the currently selected organization.

Update Organization

PUT/organisation

Update the current organization's name or settings.

Delete Organization

DELETE/organisation

Delete the current organization. This removes all associated data including users, teams, and resources.

Audit Logs

Track all actions performed within the organization. Audit logs are immutable and retained for compliance and troubleshooting purposes.

List Audit Logs

GET/audit-logs

List audit log entries. Supports filtering by action, user email, product scope, and pagination.

Query parameters: ?action=schedule.created&email=admin@company.com&include=cost,scheduling&page=1&limit=50

Product scopes

Audit events are tagged with the product that produced them. Use the include parameter (comma-separated, repeatable) to scope the query to one or more product surfaces.

ScopeCovers
platformAuth, users, teams, roles, organizations, cloud accounts
schedulingSchedules, resource groups, overrides, schedule executions
costReports, recommendations, anomalies, budgets, billing upgrade
provisioningDeployment Spaces, provisioning jobs, Helm components
deploymentDeploy service activity
Request · bash
curl -X GET "https://zopnight.com/api/audit-logs?page=1&limit=10" \
-H "Authorization: Bearer <token>"
Response · json
{
"data": [
  {
    "id": "log_001",
    "action": "schedule.created",
    "email": "admin@company.com",
    "resourceUID": "sch_abc123",
    "details": "Created schedule 'Business Hours'",
    "createdAt": "2025-03-15T10:30:00Z"
  },
  {
    "id": "log_002",
    "action": "team.member.added",
    "email": "admin@company.com",
    "resourceUID": "team_abc123",
    "details": "Added engineer@company.com to team 'Platform Engineering'",
    "createdAt": "2025-03-15T10:15:00Z"
  }
],
"pagination": {
  "page": 1,
  "limit": 10,
  "total": 248
}
}

Organization Object

FieldTypeDescription
idstringUnique organization ID
namestringOrganization display name
createdBystringEmail of the creator
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last update timestamp

Audit Log Object

FieldTypeDescription
idstringUnique audit log entry ID
actionstringAction that was performed (e.g., schedule.created)
emailstringEmail of the user who performed the action
resourceUIDstringUID of the affected resource, if applicable
detailsstringHuman-readable description of the action
createdAtstringISO 8601 timestamp of when the action occurred