Skip to content

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 ​

http
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.

json
{"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.

php
$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 ​

http
POST /api/v1/admin/users/check
Authorization: Bearer APP_TOKEN

{"email": "erika@example.com"}
json
{"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 ​

http
POST /api/v1/admin/users
Authorization: Bearer APP_TOKEN

{"email": "erika@example.com", "name": "Erika Mustermann", "send_invitation": true}
Field
emailrequired
nameoptional; set on a new account (or an existing one without a name)
usernameoptional
password, password_confirmationoptional, at least 8 characters
send_invitationtrue: 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
createdfalse when the account already existed
invitation_senttrue only for an account created by this call without a password and with send_invitation
php
$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.

Anikeen ID developer documentation