Organization Units API
The Organization Units API enables you to manage B2B functionalities in your VTEX store, focusing on users and organization units. This API provides endpoints for managing users, organization units, and their associated scopes.
This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts.
Common parameters
| Parameter name | Description | Type |
|---|---|---|
accountName |
Name of the VTEX account. Used as part of the URL. | Server variable. |
environment |
Environment to use. Used as part of the URL. | Server variable. |
VtexIdclientAutCookie |
User token, valid for 24 hours. | Authentication header. |
Endpoints
Users
| Summary | Method | Path |
|---|---|---|
| Get user scopes | GET | /api/organization-units/v1/users/{userId}/scopes |
| Get user's organization unit | GET | /api/organization-units/v1/{userId}/unit |
Units
| Summary | Method | Path |
|---|---|---|
| Create organization unit | POST | /api/organization-units/v1 |
| Search organization units | GET | /api/organization-units/v1 |
| Get organization unit | GET | /api/organization-units/v1/{organizationUnitId} |
| Delete organization unit | DELETE | /api/organization-units/v1/{organizationUnitId} |
| Rename organization unit | PATCH | /api/organization-units/v1/{organizationUnitId} |
| Get all children organization units | GET | /api/organization-units/v1/{organizationUnitId}/children |
| Get root organization units | GET | /api/organization-units/v1/roots |
| Move organization unit | PUT | /api/organization-units/v1/{organizationUnitId}/path |
| Add user to organization unit | POST | /api//vtexid/organization-units/{organizationUnitId}/users |
| Remove users from organization unit | DELETE | /api//vtexid/organization-units/{organizationUnitId}/users |
| List users from organization unit | GET | /api//vtexid/organization-units/{organizationUnitId}/users |
| Find all organization units with scope value | GET | /api/organization-units/v1/scope/{scope}/value/{scopeValue} |
Scopes
| Summary | Method | Path |
|---|---|---|
| Get organization unit scopes | GET | /api/organization-units/v1/{organizationUnitId}/scopes |
| Delete all scopes from organization unit | DELETE | /api/organization-units/v1/{organizationUnitId}/scopes |
| Create organization unit scope | POST | /api/organization-units/v1/{organizationUnitId}/scopes/{scope} |
| Update organization unit scope | PUT | /api/organization-units/v1/{organizationUnitId}/scopes/{scope} |
| Delete organization unit scope | DELETE | /api/organization-units/v1/{organizationUnitId}/scopes/{scope} |
| Remove values from organization unit scope | DELETE | /api/organization-units/v1/{organizationUnitId}/scopes/{scope}/remove |