Users API
API endpoints for managing users in the Kubiya platform
Users API
The Users API allows you to manage users in your organization, including creating, updating, and deleting user accounts, as well as managing user groups and permissions.
Endpoints
Method | Path | Description |
---|---|---|
GET | /api/v1/users | List all users |
GET | /api/v1/users/{email} | Get user details |
GET | /api/v1/users/current | Get current user |
GET | /api/v1/users/self | Get self (general) |
POST | /api/v1/users/invite | Invite a new user |
POST | /api/v1/users/groups/{id} | Add user to group |
GET | /api/v1/users/membership/{id} | Get user membership |
DELETE | /api/v1/users/{email} | Delete a user |
POST | /api/v1/users/system_invite | System invite |
Common Response Status Codes
Status Code | Description |
---|---|
200 | Success |
400 | Bad Request - Invalid parameters or request body |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - Insufficient permissions |
404 | Not Found - Resource doesn't exist |
500 | Internal Server Error |
Error Response Format
List Users
Retrieve all users in your organization.
Query Parameters
Name | Type | Required | Description |
---|---|---|---|
role | string | No | Filter by role |
group | string | No | Filter by group |
limit | integer | No | Maximum number of users to return (default: 50) |
page | integer | No | Page number for pagination |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
Get User Details
Retrieve details for a specific user.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
email | string | Yes | Email of the user |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
Get Current User
Retrieve details for the currently authenticated user.
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
Invite User
Invite a new user to your organization.
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Content-Type | Yes | application/json |
Request Body
Required Fields
email
: Email address of the user to inviterole
: Role to assign to the user ("admin", "member", "viewer")
Response
Add User to Group
Add a user to a specific group.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Yes | ID of the group |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Content-Type | Yes | application/json |
Request Body
Response
Get User Membership
Retrieve group membership information for a user.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Yes | ID of the user |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
Delete User
Delete a user from your organization.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
email | string | Yes | Email of the user to delete |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
A successful delete operation returns an HTTP 200 status with no response body.
System Invite
Create a system-level user invitation.
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Content-Type | Yes | application/json |
Request Body
Response
User management is a critical part of your organization's security. Make sure to regularly review user roles and remove access for users who no longer need it.
Example Usage
Common Errors
HTTP Status | Description |
---|---|
400 | Bad Request - Invalid request body or missing required fields |
401 | Unauthorized - API key is missing or invalid |
403 | Forbidden - The API key doesn't have permission to perform this action |
404 | Not Found - The specified user was not found |
409 | Conflict - A user with the same email already exists |
500 | Internal Server Error - An unexpected error occurred on the server |
Next Steps
After managing users, you can: