Profile API
The profile module is the caller’s own account: a staff member’s profile in the admin area, or the client’s profile in the client area. These calls read and change it, change the password, and manage two-factor sign-in, passkeys and the sign-in history. See Two-factor sign-in and Sign-in security.
Admin calls need no module access: every staff account may make them, subject to each call’s own permission below. See Authentication.
Admin calls
Section titled “Admin calls”POST /api/admin/profile/get
Returns the signed-in staff member’s profile.
No parameters.
Returns: An object: id, email, name, signature, status, api_token (the staff member’s own API key), timezone, created_at and updated_at (dates as Y-m-d).
Example
Request parameters:
{}result:
{ "id": 3, "email": "anna@example.com", "name": "Anna Lee", "signature": "Anna, Example Hosting support", "status": "active", "api_token": "Xk2…", "timezone": "Europe/Berlin", "created_at": "2026-01-10", "updated_at": "2026-11-17"}logout
Section titled “logout”POST /api/admin/profile/logout
Signs the staff member out of the current session.
No parameters.
Returns: true
update
Section titled “update”POST /api/admin/profile/update
Changes the signed-in staff member’s own details. Only the fields you send change.
| Parameter | Type | Description |
|---|---|---|
email |
string | A new sign-in email. Needs current_password. Password reset links sent to the old address stop working. |
current_password |
string | The current password, required only to change email. |
name |
string | The name clients see on ticket replies. |
signature |
string | The ticket reply signature. |
timezone |
string | A time zone such as Europe/Berlin; empty for the site’s default. |
Returns: true
Errors:
- Enter your current password to change your email address.
- Too many attempts: a new email counts against the same limits as
change_password. - Invalid timezone:
- An email address that is not valid.
Fires onBeforeAdminStaffProfileUpdate and onAfterAdminStaffProfileUpdate.
Example
Request parameters:
{ "name": "Anna Lee", "timezone": "Europe/Berlin"}result:
truegenerate_api_key
Section titled “generate_api_key”POST /api/admin/profile/generate_api_key
Makes a new API key for the signed-in staff member. The old key stops working, and the staff member’s other sessions are signed out.
No parameters.
Returns: true. Read the new key with get (api_token).
When the request has both a signed-in session and an API key, the session is used. Fires onBeforeAdminStaffApiKeyChange and onAfterAdminStaffApiKeyChange.
change_password
Section titled “change_password”POST /api/admin/profile/change_password
Changes the signed-in staff member’s password. Every other session of the staff member is signed out.
| Parameter | Type | Description |
|---|---|---|
current_password |
string, required | The current password. |
new_password |
string, required | 8 to 256 characters, with a number, a lowercase and an uppercase letter. |
confirm_password |
string, required | The new password again. |
Returns: true
Errors:
- Current password is required / New password is required / New password confirmation is required
- Minimum password length is 8 characters. (and the other password strength messages)
- Passwords do not match
- Current password incorrect
- Too many attempts: 5 tries an hour per account, 30 per IP address.
Fires onBeforeAdminStaffProfilePasswordChange and onAfterAdminStaffProfilePasswordChange.
twofactor_get
Section titled “twofactor_get”POST /api/admin/profile/twofactor_get
Says whether two-factor sign-in with an authenticator app is on for the signed-in staff member.
No parameters.
Returns: An object: enabled, backup (whether an unused backup code is left) and enabled_at.
Example
Request parameters:
{}result:
{ "enabled": true, "backup": true, "enabled_at": "2026-10-02 09:14:00"}twofactor_setup
Section titled “twofactor_setup”POST /api/admin/profile/twofactor_setup
Starts setting up two-factor sign-in: makes a new secret for the authenticator app. Finish with twofactor_enable in the same session within 15 minutes.
No parameters.
Returns: An object: secret (to type into the app, in groups of 4 characters) and uri (an otpauth:// address for a QR code).
Errors:
- Two-factor sign-in is already on.
twofactor_enable
Section titled “twofactor_enable”POST /api/admin/profile/twofactor_enable
Turns two-factor sign-in on with a code from the app for the secret of twofactor_setup.
| Parameter | Type | Description |
|---|---|---|
password |
string, required | The staff member’s password. |
code |
string, required | The 6-digit code the app shows now. |
Returns: An object with backup_code: a one-time code to sign in without the app. It is shown only this once.
Errors:
- The setup has expired. Please start again.
- The password is not correct.
- The code is not correct. Check the time on your phone and try the newest code.
twofactor_disable
Section titled “twofactor_disable”POST /api/admin/profile/twofactor_disable
Turns two-factor sign-in off.
| Parameter | Type | Description |
|---|---|---|
password |
string, required | The staff member’s password. |
code |
string, required | A code from the app, or the backup code. |
Returns: true
Errors:
- Two-factor sign-in is not on.
- The password is not correct.
- The code is not correct.
twofactor_backup
Section titled “twofactor_backup”POST /api/admin/profile/twofactor_backup
Makes a new backup code. The old one stops working.
| Parameter | Type | Description |
|---|---|---|
password |
string, required | The staff member’s password. |
Returns: An object with backup_code, shown only this once.
Errors:
- Two-factor sign-in is not on.
- The password is not correct.
passkey_list
Section titled “passkey_list”POST /api/admin/profile/passkey_list
Lists the signed-in staff member’s passkeys.
No parameters.
Returns: An object: on (whether passkeys are turned on for staff) and passkeys (each with id, name, created_at and last_used_at; empty while passkeys are off).
Example
Request parameters:
{}result:
{ "on": true, "passkeys": [ { "id": 4, "name": "Chrome on Windows", "created_at": "2026-11-01 08:30:00", "last_used_at": "2026-11-17 08:02:10" } ]}passkey_options
Section titled “passkey_options”POST /api/admin/profile/passkey_options
Starts adding a passkey: returns the options for the browser’s navigator.credentials.create(). Finish with passkey_add in the same session within 5 minutes.
| Parameter | Type | Description |
|---|---|---|
password |
string | The staff member’s password. Not needed within 10 minutes of a sign-in that offered a passkey. |
Returns: WebAuthn creation options: challenge, rp (id, name), user (id, name, displayName), pubKeyCredParams, authenticatorSelection, attestation (none), excludeCredentials and timeout. Binary values are base64url text.
Errors:
- Passkeys are not on.
- The password is not correct.
passkey_add
Section titled “passkey_add”POST /api/admin/profile/passkey_add
Saves the passkey the browser created for passkey_options.
| Parameter | Type | Description |
|---|---|---|
id |
string, required | The credential ID (base64url). |
clientDataJSON |
string, required | From the browser’s response (base64url). |
authenticatorData |
string, required | From the browser’s response (base64url). |
publicKey |
string, required | The public key from getPublicKey() (base64url). |
publicKeyAlgorithm |
integer, required | -7 (ES256) or -257 (RS256). |
Returns: An object: id and name (the browser and system, such as Chrome on Windows).
Errors:
- The passkey request has expired. Please try again.
- This browser cannot create a passkey. Please update it, or use another browser.
- The passkey could not be checked. Please try again, or sign in with your password.
- This passkey uses a kind of key that cannot be used here. Please try another one.
- This passkey is already saved.
passkey_rename
Section titled “passkey_rename”POST /api/admin/profile/passkey_rename
Renames one of the signed-in staff member’s passkeys.
| Parameter | Type | Description |
|---|---|---|
id |
integer, required | The passkey’s ID. |
name |
string, required | The new name, up to 100 characters. |
Returns: true
Errors:
- Enter a name for the passkey.
- Passkey not found. (code 404)
passkey_remove
Section titled “passkey_remove”POST /api/admin/profile/passkey_remove
Removes one of the signed-in staff member’s passkeys.
| Parameter | Type | Description |
|---|---|---|
id |
integer, required | The passkey’s ID. |
password |
string, required | The staff member’s password. |
Returns: true
Errors:
- The password is not correct.
- Passkey not found. (code 404)
passkey_offer
Section titled “passkey_offer”POST /api/admin/profile/passkey_offer
Says whether the admin area should offer to add a passkey now (“Sign in faster next time”). It answers true once, on the first page after a password sign-in, when passkeys are on for staff and the staff member has none.
No parameters.
Returns: true or false.
signins
Section titled “signins”POST /api/admin/profile/signins
Lists the signed-in staff member’s last 20 sign-ins, while the sign-in history is turned on.
No parameters.
Returns: null while Show the sign-in history on the profile pages is off; otherwise a list of sign-ins, newest first, each with id, created_at, ip, country (name), network, browser, current (this session) and active (still signed in).
Example
Request parameters:
{}result:
[ { "id": 51, "created_at": "2026-11-17 08:02:10", "ip": "203.0.113.20", "country": "Germany", "network": "Example Telecom", "browser": "Chrome on Windows", "current": true, "active": true }]signin_end
Section titled “signin_end”POST /api/admin/profile/signin_end
Signs out the session of one of the staff member’s own sign-ins (not the current one).
| Parameter | Type | Description |
|---|---|---|
id |
integer, required | The sign-in’s ID from signins. |
Returns: true
Errors:
- Sign-in ID was not passed
- Sign-in not found. (code 404)
- This is the session you are using.
destroy_sessions
Section titled “destroy_sessions”POST /api/admin/profile/destroy_sessions
Signs the staff member out everywhere else: every other session of the staff member ends; the current one stays.
No parameters.
Returns: true
api_key_reset
Section titled “api_key_reset”POST /api/admin/profile/api_key_reset
Makes a new API key for a client and signs out the client’s other sessions.
Permission: Manage Client API Keys (client.manage_api_keys)
| Parameter | Type | Description |
|---|---|---|
id |
integer, required | The client’s ID. |
Returns: The new API key.
Errors:
- Client ID was not passed
- Client not found
Client calls
Section titled “Client calls”get (client)
Section titled “get (client)”POST /api/client/profile/get
Returns the signed-in client’s profile.
No parameters.
Returns: An object: id, email, email_approved, type, first_name, last_name, gender, birthday, phone_cc, phone, company, company_vat, company_number, address_1, address_2, city, state, postcode, country, currency, lang, timezone, billing_email, po_number, balance (the credit the client can spend) and each active custom field (custom_1 to custom_20) that has a value.
An authorized user without the Change the account details permission gets only id, first_name, last_name, company, currency, lang and timezone, plus balance with View and pay invoices.
Example
Request parameters:
{}result:
{ "id": 12, "email": "jane@example.com", "email_approved": true, "type": "company", "first_name": "Jane", "last_name": "Doe", "gender": null, "birthday": null, "phone_cc": "1", "phone": "5550100", "company": "Doe Web Studio", "company_vat": null, "company_number": null, "address_1": "1 Main St", "address_2": null, "city": "Springfield", "state": "IL", "postcode": "62701", "country": "US", "currency": "USD", "lang": "en_US", "timezone": "America/Chicago", "billing_email": "billing@example.com", "po_number": null, "balance": 25}update (client)
Section titled “update (client)”POST /api/client/profile/update
Changes the signed-in client’s profile. Only the fields you send change.
| Parameter | Type | Description |
|---|---|---|
email |
string | A new sign-in email. Needs current_password, and fails when changing the email is turned off or another account uses it. The new address must be confirmed again when confirmation is required. |
current_password |
string | The current password, required only to change email. |
billing_email |
string | Where invoices go instead of the main email; empty to clear. |
first_name |
string | First name. |
last_name |
string | Last name. |
type |
string | Account type, such as individual or company. |
company |
string | Company name. |
company_vat |
string | VAT number. An EU VAT number is checked with VIES and can make the account tax exempt. |
company_number |
string | Company registration number. |
po_number |
string | Purchase order number new invoices carry, up to 64 characters; empty to clear. |
gender |
string | male, female, nonbinary or other; empty to clear. |
birthday |
string | A date such as 1990-04-21, not in the future and at most 120 years ago. |
phone_cc |
string | Phone country calling code, such as 1. |
phone |
string | Phone number. |
address_1 |
string | Address line 1. |
address_2 |
string | Address line 2. |
city |
string | City. |
state |
string | State or region. |
postcode |
string | Postal code. |
country |
string | Two-letter country code, such as US. |
lang |
string | Language code, such as en_US. |
timezone |
string | A time zone such as America/Chicago. |
custom_1 … custom_20 |
string | Custom field values. |
Returns: true
Errors:
- Enter your current password to change your email address.
- Email address cannot be changed
- This email address is already registered.
- Only the account owner can change the account email. (code 403)
- Invalid country code:
/ Invalid locale code:/ Invalid timezone: - Invalid gender value. Allowed: male, female, nonbinary, other
- Invalid birthdate value
- Your IP address (
) is blocked. Please contact our support to lift your block. (code 403)
An authorized user needs the Change the account details permission and can never change email. A banned email or phone is refused. Fires onBeforeClientProfileUpdate and onAfterClientProfileUpdate.
Example
Request parameters:
{ "phone_cc": "1", "phone": "5550100", "city": "Springfield"}result:
trueapi_key_get (client)
Section titled “api_key_get (client)”POST /api/client/profile/api_key_get
Client API keys are turned off in ClientFence: this call always fails.
No parameters.
Returns: Nothing: the call fails.
Errors:
- API keys are not available. (code 403)
api_key_reset (client)
Section titled “api_key_reset (client)”POST /api/client/profile/api_key_reset
Client API keys are turned off in ClientFence: this call always fails.
No parameters.
Returns: Nothing: the call fails.
Errors:
- API keys are not available. (code 403)
change_password (client)
Section titled “change_password (client)”POST /api/client/profile/change_password
Changes the account owner’s password. Every other session of the client is signed out.
| Parameter | Type | Description |
|---|---|---|
current_password |
string, required | The current password. |
new_password |
string, required | 8 to 256 characters, with a number, a lowercase and an uppercase letter. |
confirm_password |
string, required | The new password again. |
Returns: true
Errors:
- Current password required / New password required / New password confirmation required
- Minimum password length is 8 characters. (and the other password strength messages)
- Passwords do not match.
- Current password incorrect
- Too many attempts: 5 tries an hour per account, 30 per IP address.
Only the account owner may call it; authorized users change their own password with client user_password_change. Fires onBeforeClientProfilePasswordChange and onAfterClientProfilePasswordChange.
logout (client)
Section titled “logout (client)”POST /api/client/profile/logout
Signs the client out of the current session.
No parameters.
Returns: true
destroy_sessions (client)
Section titled “destroy_sessions (client)”POST /api/client/profile/destroy_sessions
Signs the client out everywhere else: every other session of the client ends; the current one stays.
No parameters.
Returns: true
Only the account owner may call it.
signins (client)
Section titled “signins (client)”POST /api/client/profile/signins
Lists the last 20 sign-ins of the signed-in login (the owner’s own, or the authorized user’s own), while the sign-in history is turned on.
No parameters.
Returns: null while Show the sign-in history on the profile pages is off; otherwise a list, newest first, each with id, created_at, ip, country, network, browser, current and active.
signin_end (client)
Section titled “signin_end (client)”POST /api/client/profile/signin_end
Signs out the session of one of the login’s own sign-ins (not the current one).
| Parameter | Type | Description |
|---|---|---|
id |
integer, required | The sign-in’s ID from signins. |
Returns: true
Errors:
- Sign-in ID was not passed
- Sign-in not found. (code 404)
- This is the session you are using.

