Kibo Admin User API Developer Guide
Administration
Manage admin users and permissions
Understanding Admin User in Kibo
In Kibo, it’s important to distinguish between two types of “users”: a Customer Account and an Admin User. Customer accounts are for shoppers who buy things on your storefront. Admin Users, the focus of this guide, are the people who manage your business—your merchandisers, marketers, customer service reps, and developers. Kibo treats Admin Users as a core security and operational concept. Instead of a flat list of users, Kibo uses a Role-Based Access Control (RBAC) system. Each Admin User is assigned one or more Roles (e.g., “Merchandiser,” “Content Manager”), and each Role is a collection of specific permissions (called “Behaviors”) that dictate exactly what that user can see and do within the Kibo platform.How This Domain Fits Into Kibo
Admin User management is the foundation of platform security and team collaboration. While it doesn’t directly interact with the live storefront like the Catalog or Cart APIs, it controls who has the power to change those things. Every significant action in Kibo, from updating product price to canceling an order, is logged with theuserId of the administrator who performed it. Proper user management is therefore important for auditing, security, and day-to-day operations.
Prerequisites
- Kibo API credentials and basic setup
- Node.js 16+ with TypeScript
- Familiarity with REST APIs
What You’ll Learn
After completing this guide, you’ll understand:- How Kibo structures Admin User data, including Roles and Permissions (based on official API specs).
- The key patterns Kibo uses for creating users and managing their roles (verified from apidocs.kibocommerce.com).
- Common workflows like onboarding new team members and auditing user access.
- How to avoid the most common beginner mistakes, like confusing Admin Users with Shopper Customers.
- How to read and navigate the official User Administration API documentation effectively.
Kibo Admin User Fundamentals
How Kibo Organizes Admin User Data
Kibo’s user model is a classic Role-Based Access Control (RBAC) system. Here are the core data structures:- User: The central object representing a person. Key properties include
userId(a unique integer assigned by Kibo),emailAddress,firstName,lastName, and anisActiveflag. - Role: A named collection of permissions, like “Administrator” or “Fulfiller.” You interact with these via a
roleId. - Behaviors: These are the granular permissions that make up a Role (e.g., “Read Products,” “Update Orders”). You typically don’t interact with these directly via the API but assign them to Roles within the Kibo Admin UI.
Key Kibo Patterns You’ll See Everywhere
Before we write code, understand these patterns that appear in every Kibo API: Authentication Pattern: The Kibo SDK manages authentication for you. You create a singleConfiguration object containing your credentials (Client ID, Shared Secret, etc.). This object is then passed to the constructor of specific API clients (e.g., new AdminUserApi(configuration)). The clients will automatically handle the OAuth 2.0 token exchange behind the scenes for every API call.
Request/Response Structure:
When you request a collection of resources, Kibo’s API provides a consistent, paginated response. The actual data is always inside the items array.
pageSize and startIndex parameters. For refining results, the powerful filter parameter allows you to query for specific data, like filter=isActive eq true.
API Documentation Reference:
Throughout this guide, we’ll reference specific endpoints. Find complete specs at:
/api-overviews/openapi_tenant_and_user_overview
Common Admin User Workflows
Kibo developers typically work with Admin Users in these scenarios:- Onboarding a New Employee: Creating a user account and assigning the correct starting role.
- Auditing User Access: Programmatically listing all users and the roles they are assigned to for a security review.
- Offboarding an Employee: Deactivating or deleting a user’s account to revoke their access.
Getting a List of Admin Users: The Kibo Way
When You Need This
This is your starting point for almost any user management task. You need it when you want to display a list of users in a custom dashboard, find a specific user to update, or perform a bulk operation.API Documentation Reference
Endpoint:GET /commerce/admin/users
Method: GET
API Docs: Get Users
Understanding the Kibo Approach
Kibo treats fetching users as a potentially large-scale operation. Therefore, it never returns all users at once. It forces you to think about pagination from the start by usingpageSize and startIndex. This is a defensive design that ensures performance and stability.
Code Structure Walkthrough
Before we implement, let’s understand what we’re building (based on actual API requirements):Step-by-Step Implementation
Step 1: Setting Up the FoundationgetUsers, our request (including pagination parameters) goes to the Kibo API. The API queries its user database, constructs a response object containing a page of results (items) and metadata (totalCount, etc.), and sends it back.
Step 3: The Core Implementation
What Just Happened? (Code Explanation)
- The setup phase created a single
Configurationobject. This is the source of truth for all API credentials and is passed to every client. - The API call was made using an instance of
AdminUserApi. This client has type-safe methods (likegetUsers) that match the available operations in the User Administration API group. - We passed a
filterparameter (isActive eq true) to instruct Kibo’s servers to do the filtering for us, which is much more efficient than fetching all users and filtering them in our own code. - The response handling safely accesses the
itemsarray from the response and includes error handling for API failures.
Common Beginner Mistakes
Mistake 1: Forgetting about pagination and assuming the first call returns all users.AdminUserApi) with Shopper Accounts (CustomerAccountApi).
userId in subsequent API calls. The API requires the integer userId.
How This Connects to Other Kibo Operations
Fetching users is the first step in almost any other user operation. Before you can update, delete, or manage roles, you first need to get theuserId of the user you want to modify.
Creating a New User and Assigning a Role
This is a two-step process in Kibo, and understanding that is key. You first create the user, then you make a second API call to assign a role.When You Need This
This workflow is essential for automating the onboarding of new employees. For example, a script could be triggered from your HR system to create a Kibo account for a new merchandiser.API Documentation Reference
- Create User:
- Endpoint:
POST /commerce/admin/users - Method:
POST - API Docs: Create User
- Endpoint:
- Add User Role:
- Endpoint:
POST /commerce/admin/users/{userId}/roles/{roleId} - Method:
POST - API Docs: Add User Role
- Endpoint:
Understanding the Kibo Approach
Kibo separates user creation from role assignment for clarity and security. This atomic design ensures that you can’t accidentally create a user with the wrong permissions in a single, complex request. It forces a deliberate, two-step process: establish the identity, then grant the permissions.Step-by-Step Implementation
Advanced Admin User Patterns
When You’ve Mastered the Basics
Now that you understand Kibo’s fundamental approach, let’s explore more sophisticated patterns using actual API capabilities.Pattern 1: Role Auditing Script
Business Scenario: A security manager needs a CSV report of every user and which roles they are assigned to. Kibo’s Architecture Consideration: There is no single endpoint to get users and their roles simultaneously. This is intentional to keep the API responses lean. The correct pattern is to first get all users, then iterate through each user to fetch their assigned roles. API Endpoints Used:GET /commerce/admin/usersGET /commerce/admin/users/{userId}/roles- Full API Reference: Get Users
Multiple Real-World Examples
Here are 5 complete, runnable examples for commonAdmin User operations.
Example 1: Find a Specific User by Email
Integrating Admin User with Other Kibo Domains
Understanding howAdmin User connects to other parts of Kibo helps you build more effective solutions.
Admin User + Orders Integration
When an administrator manually edits an order (e.g., adds a discount, changes the shipping address), theiruserId is stored in the order’s auditInfo block. This creates a clear audit trail. You can use the Admin User API to cross-reference this userId to find out who made the change (e.g., John Doe ([email protected])).
Admin User + Catalog Data Integration
Similarly, every change to a product in your catalog—a price update, a new image, a changed description—is logged against theuserId of the merchandiser who performed the action. This is useful for tracking down unauthorized or accidental changes.
Performance Considerations
- Filter, Don’t Fetch: Always use the
filterquery parameter (filter=emailAddress eq '...') when you need a specific user or subset of users. It is vastly more performant than fetching all users and filtering them in your code. - Paginate Wisely: Never try to fetch thousands of users in a single API call. Use the
pageSize(max 200) andstartIndexparameters to loop through pages of results. - Cache Roles: The list of available roles (
getRoles) changes infrequently. For applications that need to display roles, it’s a good practice to cache this API call’s response for a few hours to reduce redundant API traffic.
Troubleshooting Your Admin User Implementation
Reading Kibo Error Messages
Kibo’s error responses follow specific patterns. Here’s how to decode them (verified from actual API responses):USER_ALREADY_EXISTS: Occurs when usingcreateUserwith an email/username that is already taken.USER_NOT_FOUND: Occurs when providing an invaliduserIdto endpoints likeupdateUser,getUserRoles, ordeleteUser.VALIDATION_ERROR: The request body for creating or updating a user is missing required fields (e.g.,emailAddress) or contains invalid data.ROLE_NOT_FOUND: You tried to add or remove aroleIdthat does not exist.
Common Development Issues
Issue 1:401 Unauthorized Error on Every API Call
- Why it happens: Your API credentials in the
Configurationobject are incorrect, or the API key you are using does not have the required permissions (Behaviors) for the User Administration API. - How to fix it:
- Carefully verify your
clientId,sharedSecret,tenantId, andauthHost. - In the Kibo Dev Center, check that your Application has been granted permissions like
user.read,user.create,user.update, etc.
- Carefully verify your
- API Reference: pages/introduction-to-the-kccp-uis
- Why it happens: There can sometimes be a very brief replication delay between when a user is created in Kibo’s identity system and when it’s available to have a role assigned.
- How to fix it: While rare, a simple retry mechanism with a short delay (e.g., wait 500ms and try the
createUserRolecall again) can make your integration more robust. - How to avoid it: Structure your error handling to catch failures on the role assignment step and log them for manual review or automated retry.
Debugging Checklist
When your Admin User implementation isn’t working:- Verify endpoint URL matches
apidocs.kibocommerce.comexactly. - Confirm request body for
createUserorupdateUsermatches the required schema in the API docs. - Check authentication credentials in your
Configurationobject. - Validate that the
userIdandroleIdare integers, not strings or objects. - Review the
errorCodein the API error response - it tells you exactly what went wrong. - Check your application’s permissions in the Kibo Dev Center.
- Ensure you are using
AdminUserApiand not another client likeCustomerAccountApi.

