Match Consumer to an Identity Source User
Endpoint
POST /apiops/projects/{projectName}/consumers/{consumerKey}/actions/sync-match
This is the same step as the match flow on the Consumer screen.
Authentication
Requires a Personal API Access Token.
Authorization: Bearer YOUR_TOKEN
Request
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| consumerKey | string | Yes | Consumer key, assigned by the installation. Returned as consumerKey by every consumer response |
Request Body
{
"sourceType": "ldap",
"sourceName": "corporate-ldap",
"username": "jdoe",
"email": "jdoe@example.com",
"fullName": "John Doe",
"ldapDn": "uid=jdoe,ou=people,dc=example,dc=com"
}
| Field | Type | Required | Description |
|---|---|---|---|
| sourceType | string | Yes | ldap, database or api |
| sourceName | string | Yes | Name of the identity source in the project |
| username | string | Yes | Username of the user in the source. The next synchronization reconciles on this value |
| string | No | Email address, copied from the matched user | |
| fullName | string | No | Display name, copied from the matched user |
| ldapDn | string | No | Distinguished name of the user. LDAP sources only |
Response
200 OK.
The response is a write response. runtimeDeployment.state is IN_SYNC when every environment acknowledged the change, or DEGRADED when the change is stored but at least one environment did not acknowledge it. Do not retry a DEGRADED write; redeploy instead. resourceVersion is not returned.
result is the consumer. From now on the identity source owns the identity fields of the consumer, and Update Consumer refuses the consumer with params.reason = ldapManaged.
Errors
| Status | Error key | Cause |
|---|---|---|
| 400 | malformedRequest | sourceType is not ldap, database or api (params.reason = unsupportedSourceType) |
| 400 | malformedRequest | The synchronization of the source is disabled (params.reason = syncProviderDisabled) |
| 400 | malformedRequest | Another consumer already holds the username (params.reason = credentialUsernameTaken) |
| 400 | malformedRequest | username or sourceName is missing |
| 404 | resourceNotFound | The source is unknown in the project |
cURL Example
curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/consumers/CONSUMER_KEY/actions/sync-match" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "sourceType": "ldap", "sourceName": "corporate-ldap", "username": "jdoe" }'
Permissions
- User must have
IDENTITY+MANAGEpermission in the project - A project outside the scope of the caller answers
404 resourceNotFound, never403 - The admin project has no consumers: a call on it answers
400 malformedRequest(params.reason=platformScopeNotSupported)