Docs menu

Account API

Read the account behind an API key and change its email or password.

The account endpoints tell you which account a key belongs to and let you change its email address or password.

Get the account

GET/api/account

The account the key belongs to. A good first call to check that a key works.

Needs: API key.

Example request

Shell
curl "https://siz.la/api/account" \
  -H "Authorization: Bearer $SIZLA_API_KEY"
JavaScript
const response = await fetch("https://siz.la/api/account", {
  headers: {
    Authorization: `Bearer ${process.env.SIZLA_API_KEY}`,
  },
});
const data = await response.json();
console.log(data);
Python
import os
import requests

response = requests.get(
    "https://siz.la/api/account",
    headers={"Authorization": f"Bearer {os.environ['SIZLA_API_KEY']}"},
)
print(response.json())
PHP
$ch = curl_init('https://siz.la/api/account');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer '.getenv('SIZLA_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);

Example answer, status 200

JSON
{
    "error": 0,
    "data": {
        "id": 7,
        "email": "[email protected]",
        "username": "you",
        "avatar": "https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mp",
        "status": "pro",
        "expires": "",
        "registered": "2026-10-02 14:05:11"
    }
}

Notes

  • status is free on the free plan and pro on every paid plan.

Update the account

PUT/api/account/update

Change the email address or the password. Changing either one also needs the current password, so a key alone cannot take an account over.

Needs: API key with write access.

Parameters

NameInTypeDescription
emailBodystringThe new email address. A confirmation message is sent to it.
passwordBodystringThe new password, at least 8 characters.
current_passwordBodystringThe current password. Required when you change the email or the password.

Example request

Shell
curl -X PUT "https://siz.la/api/account/update" \
  -H "Authorization: Bearer $SIZLA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","current_password":"your-current-password"}'
JavaScript
const response = await fetch("https://siz.la/api/account/update", {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.SIZLA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "email": "[email protected]",
    "current_password": "your-current-password"
  }),
});
const data = await response.json();
console.log(data);
Python
import os
import requests

response = requests.put(
    "https://siz.la/api/account/update",
    headers={"Authorization": f"Bearer {os.environ['SIZLA_API_KEY']}"},
    json={
        "email": "[email protected]",
        "current_password": "your-current-password",
    },
)
print(response.json())
PHP
$ch = curl_init('https://siz.la/api/account/update');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer '.getenv('SIZLA_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'email' => '[email protected]',
        'current_password' => 'your-current-password',
    ]),
]);
$data = json_decode(curl_exec($ch), true);

Example answer, status 200

JSON
{
    "error": 0,
    "message": "Account has been successfully updated."
}

Errors specific to this call

  • 400: The email or password is not valid.
  • 403: The current password is missing or wrong.
  • 429: Five wrong passwords in ten minutes. Wait ten minutes.