Users & Teams
Manage users within your organization and organize them into teams with resource assignments.
Users
List Users
GET
/usersList all users in your organization.
Invite User
POST
/usersInvite a new user to your organization by email.
Update User
PATCH
/users/{email}Update a user's role or details.
Remove User
DELETE
/users/{email}Remove a user from your organization.
Teams
List Teams
GET
/teamsList all teams in your organization.
Create Team
POST
/teamsCreate a new team.
Requestbash
curl -X POST https://zopnight.com/api/teams \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Platform Engineering",
"description": "Manages shared infrastructure and developer tooling"
}'Responsejson
{
"data": {
"id": "team_abc123",
"name": "Platform Engineering",
"description": "Manages shared infrastructure and developer tooling",
"members": [],
"resources": [],
"createdBy": "admin@company.com",
"createdAt": "2025-03-10T09:00:00Z",
"updatedAt": "2025-03-10T09:00:00Z"
}
}Get Team
GET
/teams/{teamID}Get a team with its members and assigned resources.
Update Team
PUT
/teams/{teamID}Update team name or description.
Delete Team
DELETE
/teams/{teamID}Delete a team. Members and resource assignments are removed.
Team Members
Member Permissions
Adding a user to a team does not automatically grant them permissions on the team's resources. Use role assignments to control what team members can do.
List Members
GET
/teams/{teamID}/membersList all members of a team.
Add Member
POST
/teams/{teamID}/membersAdd a user to a team by email.
Requestbash
curl -X POST https://zopnight.com/api/teams/team_abc123/members \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"email": "engineer@company.com"
}'Responsejson
{
"data": {
"teamID": "team_abc123",
"email": "engineer@company.com",
"addedBy": "admin@company.com",
"addedAt": "2025-03-10T09:15:00Z"
}
}Remove Member
DELETE
/teams/{teamID}/members/{email}Remove a member from a team.
Team Resources
List Assigned Resources
GET
/teams/{teamID}/resourcesList all resources assigned to a team.
Assign Resource
POST
/teams/{teamID}/resourcesAssign a cloud resource to a team.
Requestbash
curl -X POST https://zopnight.com/api/teams/team_abc123/resources \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"resourceUID": "aws:us-east-1:i-0abc123def456"
}'Responsejson
{
"data": {
"teamID": "team_abc123",
"resourceUID": "aws:us-east-1:i-0abc123def456",
"assignedBy": "admin@company.com",
"assignedAt": "2025-03-10T09:30:00Z"
}
}Unassign Resource
DELETE
/teams/{teamID}/resources/{resourceUID}Remove a resource assignment from a team.
Team Object
| Field | Type | Description |
|---|---|---|
id | string | Unique team ID |
name | string | Team display name |
description | string | Optional description |
members | TeamMember[] | List of team members |
resources | AssignedResource[] | List of assigned resources |
createdBy | string | Email of the creator |
createdAt | string | ISO 8601 creation timestamp |
updatedAt | string | ISO 8601 last update timestamp |