User accounts (trusted apps)
Trusted apps can look up and create Anikeen ID accounts with the app's own token (client credentials). Email addresses are matched regardless of case. User tokens and untrusted apps get 403.
Looking up an account by email
POST /api/v1/admin/users/lookup
Authorization: Bearer APP_TOKEN
{"email": "erika@example.com"}A POST, so the address stays out of URLs and access logs. Changes nothing.
{"data": {"id": "01j…", "name": "Erika Mustermann", "email": "erika@example.com",
"email_verified": true, "has_billing_address": true}}404 user_not_found when no account uses the address.
$account = app(\Anikeen\Id\AnikeenId::class)->findUserByEmail('erika@example.com'); // null if none
$account?->data->id;findUserByEmail() returns null only for an unknown address and throws ApiException for every other failure.
Checking whether an address has an account
POST /api/v1/admin/users/check
Authorization: Bearer APP_TOKEN
{"email": "erika@example.com"}{"data": {"exists": true}}Only tells whether an account uses the address (regardless of case). With the SDK: app(\Anikeen\Id\AnikeenId::class)->isEmailExisting('erika@example.com') (a Result).
Finding or creating an account
POST /api/v1/admin/users
Authorization: Bearer APP_TOKEN
{"email": "erika@example.com", "name": "Erika Mustermann", "send_invitation": true}| Field | |
|---|---|
email | required |
name | optional; set on a new account (or an existing one without a name) |
username | optional |
password, password_confirmation | optional, at least 8 characters |
send_invitation | true: a new account without a password gets a mail with a link to set one (valid for 7 days) |
Finds the account of the email address or creates it. An existing account is returned unchanged. 201 for a new account, 200 for an existing one; both carry the user plus:
| Field | |
|---|---|
created | false when the account already existed |
invitation_sent | true only for an account created by this call without a password and with send_invitation |
$result = app(\Anikeen\Id\AnikeenId::class)->createUser([
'name' => 'Erika Mustermann',
'email' => 'erika@example.com',
'send_invitation' => true,
]);
$result->data->created;
$result->data->invitation_sent;A new account's email address is unverified.