The B12 API is hosted at https://b12.apprentx.rocks/api. An access token is required to access it, available on demand.
The B12 provisioning API implements the SCIM specification:
https://www.rfc-editor.org/rfc/rfc7644
B12 SCIM attributes
SCIM attribute mapping defines the attributes that synchronize between an Identity Provider (IdP) and B12 when users are provisioned and updated.
Below is the list of SCIM attributes that B12 supports.
Core
Each SCIM resources include these commun attributes:
| SCIM attribute | Description | Type | Mandatory | Default |
| id | B12 ID | String | Yes | |
| schemas | Array | Yes | ||
| schemas[] | String | Yes | ||
| meta | Object | Yes | ||
| meta.resourceType | String | Yes | ||
| meta.created | Datetime | Yes | ||
| meta.lastModified | Datetime | Yes | ||
| meta.location | String | No | ||
| meta.version | String | No |
https://www.rfc-editor.org/rfc/rfc7643#section-3.1
User
| SCIM attribute | Description | Type | Mandatory | Default |
| userName | As email | String | Yes | |
| name | Object | Yes | ||
| name.givenName | First name | String | Yes | |
| name.familyName | Last name | String | Yes | |
| active | Boolean | No | true | |
| emails | Array | Yes | ||
| emails[].value | String | Yes | ||
| preferredLanguage | BCP 47 format eg.: "fr-CA' | String | No | "fr-CA" |
| timezone | IANA format eg.: "Europe/Paris" | String | No | "America/Toronto" |
| roles | Array | No | [{ value: "LEARNER" }] | |
| roles[].value | Possible values: LEARNER, MANAGER, TRAINER, DESIGNER, ADMIN | String | Yes |
https://www.rfc-editor.org/rfc/rfc7643#section-4.1
User Enterprise
| SCIM attribute | Description | Type | Mandatory | Default |
|
urn:ietf:params: scim:schemas: extension:enterprise: 2.0:User |
Object | No | ||
|
urn:ietf:params: scim:schemas: extension:enterprise: 2.0:User:manager |
The email of this user's manager | String | No |
https://www.rfc-editor.org/info/rfc7643/#section-4.3
User Custom
Custom attributes can be mapped from an IdP to custom fields in B12. SCIM attributes are in the following format:
urn:ietf:params:scim:schemas:extension:customb12:2.0:User:[B12_USER_FIELD_ID]| SCIM attribute | Description | Type | Mandatory | Default |
|
urn:ietf:params: scim:schemas: extension:customb12: 2.0:User |
Object | No | ||
|
urn:ietf:params: scim:schemas: extension:customb12: 2.0:User:[B12_USER_FIELD_ID] |
String | No |
Endpoints
GET /api/scim/v2/Users
To fetch an array of users matching a specified filter.
GET /api/scim/v2/Users/:userId
To fetch a user by id.
POST /api/scim/v2/Users
To create a user.
PATCH /api/scim/v2/Users/:userId
To update a user by id.
DELETE /api/scim/v2/Users/:userId
To delete (deactivate) a user by id.