# Account

> Your profile, username, email, plan limits, social sign-ins, connected AI apps and account deletion.

URL: https://renzo-digital.com/docs/resources/account

These calls act on the signed-in customer. Every call needs a token. Profile reads work before a username is set. To sign in, see [Authentication](https://renzo-digital.com/docs/authentication).

## Endpoints

| Operation | What it does | Auth |
| --- | --- | --- |
| `GET /api/v1/users/me` | Read your profile. | Token |
| `PATCH /api/v1/users/me` | Change the fields you send. Set the username here. | Token |
| `GET /api/v1/users/username-available` | Check if a username is valid and free: `?username=...`. | Token |
| `POST /api/v1/users/me/email/request` | Send a code to a new email address. Answers `202`. | Token and username |
| `POST /api/v1/users/me/email/verify` | Confirm the code and move the account to the new address. | Token and username |
| `GET /api/v1/users/me/entitlements` | Read what your plan grants. | Token |
| `GET /api/v1/users/me/identities` | List linked social sign-ins. | Token |
| `DELETE /api/v1/users/me/identities/{provider}` | Unlink one social sign-in. Answers `204`. | Token |
| `GET /api/v1/users/me/connections` | List connected AI apps. Cursor-paginated. | Token |
| `DELETE /api/v1/users/me/connections/{connection_id}` | Disconnect an AI app. Answers `204`. | Token |
| `DELETE /api/v1/users/me` | Delete the account. Answers `204`. | Token |

Calls that need a username answer `409` [`profile_incomplete`](https://renzo-digital.com/docs/error-codes#profile_incomplete) until one is set. This is the same gate that guards writes on watchlists, price alerts and other pages. Any mutating call accepts an `Idempotency-Key`. See [Idempotency](https://renzo-digital.com/docs/concepts/idempotency).

## Example: finish sign-up with a username

A new account has `status` of `pending_profile`. Set a username to finish. First check the name:

```bash tab="curl"
curl "$BASE/api/v1/users/username-available?username=marketwatcher" \
  -H "Authorization: Bearer $TOKEN"
```

```python tab="Python"
import os

import requests

BASE = os.environ["BASE"]
TOKEN = os.environ["TOKEN"]

answer = requests.get(
    f"{BASE}/api/v1/users/username-available",
    headers={"Authorization": f"Bearer {TOKEN}"},
    params={"username": "marketwatcher"},
)
answer.raise_for_status()
print(answer.json())
```

```js tab="Node.js"
const { BASE, TOKEN } = process.env;

const answer = await fetch(`${BASE}/api/v1/users/username-available?username=marketwatcher`, {
  headers: { Authorization: `Bearer ${TOKEN}` },
});
if (!answer.ok) throw new Error(`HTTP ${answer.status}`);
console.log(await answer.json());
```

The answer is always `200`:

```json title="Response"
{
  "username": "marketwatcher",
  "available": true
}
```

Then claim it:

```bash tab="curl"
curl -X PATCH "$BASE/api/v1/users/me" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"username": "marketwatcher"}'
```

```python tab="Python"
import os

import requests

BASE = os.environ["BASE"]
TOKEN = os.environ["TOKEN"]

answer = requests.patch(
    f"{BASE}/api/v1/users/me",
    headers={"Authorization": f"Bearer {TOKEN}"},
    json={"username": "marketwatcher"},
)
answer.raise_for_status()
print(answer.json())
```

```js tab="Node.js"
const { BASE, TOKEN } = process.env;

const answer = await fetch(`${BASE}/api/v1/users/me`, {
  method: "PATCH",
  headers: { Authorization: `Bearer ${TOKEN}`, "Content-Type": "application/json" },
  body: JSON.stringify({ username: "marketwatcher" }),
});
if (!answer.ok) throw new Error(`HTTP ${answer.status}`);
console.log(await answer.json());
```

Send only `username` in this first call. Any other field before a username is set answers `409` [`profile_incomplete`](https://renzo-digital.com/docs/error-codes#profile_incomplete). Change the other fields in a second call. The answer below is after both calls.

```json title="Response"
{
  "id": "eca8506d-1dfa-56a2-8765-96305e99f89c",
  "email": "reader@example.com",
  "username": "marketwatcher",
  "status": "active",
  "ui_language": "en",
  "article_language": "en",
  "timezone": "America/New_York",
  "currency": "USD",
  "country": "US",
  "mobile": null,
  "created_at": "2026-10-04T13:30:00Z",
  "last_login_at": "2026-11-04T13:30:00Z"
}
```

## Example: read your plan limits

```bash tab="curl"
curl "$BASE/api/v1/users/me/entitlements" \
  -H "Authorization: Bearer $TOKEN"
```

```python tab="Python"
import os

import requests

BASE = os.environ["BASE"]
TOKEN = os.environ["TOKEN"]

answer = requests.get(
    f"{BASE}/api/v1/users/me/entitlements",
    headers={"Authorization": f"Bearer {TOKEN}"},
)
answer.raise_for_status()
print(answer.json())
```

```js tab="Node.js"
const { BASE, TOKEN } = process.env;

const answer = await fetch(`${BASE}/api/v1/users/me/entitlements`, {
  headers: { Authorization: `Bearer ${TOKEN}` },
});
if (!answer.ok) throw new Error(`HTTP ${answer.status}`);
console.log(await answer.json());
```

```json title="Response"
{
  "product_code": "premium",
  "capabilities": {
    "content.tier": "premium",
    "markets.data_download": true,
    "mcp.full_text": true,
    "notifications.whatsapp": true,
    "price_alerts.max_active": 50,
    "watchlist.max_lists": 10
  }
}
```

Read limits here instead of hard-coding them. See [Plans and limits](https://renzo-digital.com/docs/concepts/plans-and-limits).

## Rules and edge cases

- **Partial update.** `PATCH` changes only the fields you send. A field you leave out stays as it is. `mobile` set to `null` clears it.
- **Username.** It is 3 to 30 characters: letters, digits, `.`, `_` and `-`. It must start and end with a letter or digit. You can change it later. A name another account holds answers `409` [`username_taken`](https://renzo-digital.com/docs/error-codes#username_taken). A name that breaks the rules answers `422` [`validation_failed`](https://renzo-digital.com/docs/error-codes#validation_failed), with the field in `errors`.
- **Username check.** `GET /api/v1/users/username-available` always answers `200` with `{username, available}`. `available` is `false` for a name that is taken or invalid. It never says who holds a taken name.
- **Two languages.** `ui_language` is the interface language. `article_language` is the language articles are served in. They are independent. Send a public tag such as `en` or `zh-Hans`. See [Locales](https://renzo-digital.com/docs/concepts/locales).
- **Other fields.** `country` is 2 letters. `currency` is a 3-letter ISO 4217 code. `timezone` is an IANA name. `mobile` is up to 32 characters.
- **Change email.** `POST /api/v1/users/me/email/request` with `{"email": "..."}` emails a code to the new address and answers `202` with a `challenge_token`. Then `POST /api/v1/users/me/email/verify` with `{"challenge_token": "...", "code": "..."}` moves the account and answers `200` with the profile. The address does not change before that.
- **Email change limits.** The same address answers `409` [`email_unchanged`](https://renzo-digital.com/docs/error-codes#email_unchanged). An address another account uses answers `409` [`email_already_registered`](https://renzo-digital.com/docs/error-codes#email_already_registered) on verify. A wrong or old code answers `401` with an `otp_` code, see [Authentication](https://renzo-digital.com/docs/authentication). Both calls share the per-IP limits of sign-in codes and answer `429` [`rate_limited`](https://renzo-digital.com/docs/error-codes#rate_limited). See [Rate limits](https://renzo-digital.com/docs/concepts/rate-limits).
- **Entitlements.** The answer has `product_code` and `capabilities`, with every capability key resolved. A limit your plan does not name shows its default. Premium keys such as `content.tier` are the same on every paid plan.
- **Social sign-ins.** `GET /api/v1/users/me/identities` lists linked providers: `google`, `apple`, `facebook`, `x` or `github`. There is at most one per provider, so the list is not paged. Each item has `provider`, `email`, `created_at` and `last_login_at`. Linking starts from a sign-in flow, see [Authentication](https://renzo-digital.com/docs/authentication).
- **Unlinking.** `DELETE /api/v1/users/me/identities/{provider}` is always allowed, because an emailed code still opens the account. A provider that is not linked answers `404` [`identity_not_found`](https://renzo-digital.com/docs/error-codes#identity_not_found).
- **Connected AI apps.** `GET /api/v1/users/me/connections` lists the AI apps you allowed to use your account, newest first. Each has `id`, `name`, `client_id`, `kind`, `scopes`, `created_at` and `last_used_at`. `limit` defaults to 20 and may not pass 100. See [Pagination](https://renzo-digital.com/docs/concepts/pagination) and [MCP](https://renzo-digital.com/docs/mcp).
- **Disconnecting an app.** `DELETE /api/v1/users/me/connections/{connection_id}` revokes the app at once. Its tokens stop on the next call. An unknown or not-yours ID answers `404` [`connection_not_found`](https://renzo-digital.com/docs/error-codes#connection_not_found).
- **Deleting the account.** `DELETE /api/v1/users/me` signs out every session and starts a 15-day grace period. A paid subscription is set to cancel at period end. Signing in during grace restores renewal only when deletion set that cancel; an earlier cancel remains. With `?now=true`, local access ends at once and provider subscriptions are cancelled without a refund. A sign-in after hard deletion answers `403` [`customer_account_deleted`](https://renzo-digital.com/docs/error-codes#customer_account_deleted).
- **After deleting.** Provider customer contact details are redacted. Orders, payments and refunds remain for accounting, and the token used for the call stops working.

## Errors

| Code | Status | When |
| --- | --- | --- |
| [`profile_incomplete`](https://renzo-digital.com/docs/error-codes#profile_incomplete) | 409 | The account has no username yet. |
| [`username_taken`](https://renzo-digital.com/docs/error-codes#username_taken) | 409 | Another account holds the name. |
| [`validation_failed`](https://renzo-digital.com/docs/error-codes#validation_failed) | 422 | The name breaks the length or character rules. |
| [`email_unchanged`](https://renzo-digital.com/docs/error-codes#email_unchanged) | 409 | The new email is the same as the current one. |
| [`email_already_registered`](https://renzo-digital.com/docs/error-codes#email_already_registered) | 409 | Another account uses this email. |
| [`identity_not_found`](https://renzo-digital.com/docs/error-codes#identity_not_found) | 404 | This provider is not linked to your account. |
| [`connection_not_found`](https://renzo-digital.com/docs/error-codes#connection_not_found) | 404 | No connected app with this ID is yours. |
| [`rate_limited`](https://renzo-digital.com/docs/error-codes#rate_limited) | 429 | Too many email change requests or codes from this IP. |

Sign-in and request errors, such as [`token_expired`](https://renzo-digital.com/docs/error-codes#token_expired) and [`validation_failed`](https://renzo-digital.com/docs/error-codes#validation_failed), can come from any call. See [Errors](https://renzo-digital.com/docs/concepts/errors).

## Reference

- [Users in the API reference](https://renzo-digital.com/docs/api#tag/users)
