Endpoints
Organizations
Session-authenticated organization, member, invite, usage, and team activity endpoints.
GET
Organization endpoints are dashboard endpoints for team workspaces. They use the signed-in app session, not
For plan changes, send
X-NearIQ-Key. Owners and admins can manage members, invites, usage visibility, API key ownership, and activity logs according to their organization permissions.
Public v1 API keys can be scoped to an organization, but organization management itself is controlled through the signed-in dashboard session.
GET /api/orgs
Returns organizations owned by the signed-in user, organizations where the user is a member, and compatibility fields used by Settings.POST /api/orgs
Creates an organization and starts organization billing checkout for supported team plans.Organization name.
Team plan. Supported values are enforced by the API.
PATCH /api/orgs/:id
Renames an organization or changes its plan. Only the organization owner can update it.{ "plan": "enterprise" }. The API blocks changes that would exceed seat limits.
DELETE /api/orgs/:id
Soft-deletes an organization and immediately revokes memberships, pending invites, and organization-scoped API keys. Only the owner can delete the organization.POST /api/orgs/invites
Creates or refreshes an invitation for a team member. Owners and admins with invite permission can send invites.DELETE /api/orgs/invites/:id
Cancels a pending invitation in the signed-in user’s organization. Owners and admins can cancel invites.GET /api/orgs/invites/me
Returns pending organization invitations for the signed-in user’s email address.PATCH /api/orgs/members/:userId
Changes a member role or permission set. Owners and admins can update members, but the owner role cannot be changed.DELETE /api/orgs/members/:userId
Removes a member from the organization or lets a member leave. Removing a member also revokes their organization-scoped API keys.GET /api/orgs/keys
Lists organization-scoped API keys visible to permitted team managers.DELETE /api/orgs/keys
Compatibility route for revoking an organization-scoped API key by request body.DELETE /api/orgs/api-keys/:keyId
Revokes an organization-scoped member API key by path parameter.GET /api/orgs/usage
Returns organization limits, total usage, and per-member usage for owners and admins.GET /api/orgs/activity
Returns schema-backed team activity for owners and admins. Results are no-store and paginated.Page size from 1 to 100. Defaults to 50.
Offset for pagination.
Optional user ID filter.
Optional action filter. Group aliases such as
api_key, content, and competitor expand to related events.Errors
| Status | Meaning |
|---|---|
400 | Invalid body, unsupported plan, or seat-limit conflict |
401 | Missing dashboard session |
403 | User lacks owner/admin/permission access |
404 | Organization not found |
409 | Organization is already deleted |
500 | Billing or database operation failed |