Create federated group mapping
const url = 'http://localhost:3000/api/v1/federation/group-mappings';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"provider":"ENTRA","externalId":"fleet-operators","externalKind":"APP_ROLE","externalLabel":"Fleet Operators (Entra group)","organizationId":"550e8400-e29b-41d4-a716-446655440000","roleId":"550e8400-e29b-41d4-a716-446655440001","enabled":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/v1/federation/group-mappings \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "provider": "ENTRA", "externalId": "fleet-operators", "externalKind": "APP_ROLE", "externalLabel": "Fleet Operators (Entra group)", "organizationId": "550e8400-e29b-41d4-a716-446655440000", "roleId": "550e8400-e29b-41d4-a716-446655440001", "enabled": true }'Creates a federated group mapping tying a provider app-role / group to a WFM role within an organization. Requires Super Admin privileges.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
Identity provider that supplies the app-role / group
Example
ENTRAProvider role value or group id carried in the token claim
Example
fleet-operatorsKind of external identifier (application role or group)
Example
GROUPHuman-readable label captured at mapping time
Example
Fleet Operators (Entra group)Organization the mapping grants membership in
Example
550e8400-e29b-41d4-a716-446655440000WFM role granted to users matching this mapping
Example
550e8400-e29b-41d4-a716-446655440001Whether the mapping is active (resolved at login time)
Example
trueResponses
Section titled “ Responses ”Mapping created successfully
object
Unique mapping identifier
Organization the mapping grants membership in
Identity provider that supplies the app-role / group
Provider role value or group id carried in the token claim
Kind of external identifier (application role or group)
Human-readable label captured at mapping time
WFM role granted to users matching this mapping
Whether the mapping is active (resolved at login time)
Id of the user who created the mapping
When the mapping was created
When the mapping was last updated
Example
{ "id": "550e8400-e29b-41d4-a716-446655440002", "organizationId": "550e8400-e29b-41d4-a716-446655440000", "provider": "ENTRA", "externalId": "fleet-operators", "externalKind": "APP_ROLE", "externalLabel": "Fleet Operators (Entra group)", "roleId": "550e8400-e29b-41d4-a716-446655440001", "enabled": true, "createdById": "550e8400-e29b-41d4-a716-446655440003", "createdAt": "2024-01-15T10:30:00Z", "updatedAt": "2024-06-20T14:45:00Z"}Invalid input data or role does not exist
Unauthorized
Forbidden - Super Admin required
Organization not found
Mapping already exists for this provider/externalId