# account

The authenticated user's own account and organization memberships.

**Amfelt REST API** · v1.13.0 · `https://api.amfelt.com`

---
### GET `/v1/me/archived-organizations` {#listarchivedorgs}

**List the caller's archived organizations.**

Organizations the caller is an active member of that have been disabled (archived). Used to re-enable them.

#### Responses

**200** — The caller's archived organizations.

`application/json`

| Property | Type | Required | Description |
|---|---|---|---|
| `data` | [ArchivedOrg](#archived-org)[] | Yes |  |


**401** — The request lacks valid credentials.

`application/json`

| Property | Type | Required | Description |
|---|---|---|---|
| `code` | string | Yes | Stable, snake_case token identifying the error condition. See ErrorCode for the api's canonical named vocabulary — this field is deliberately not restricted to it, since handlers may emit other ad-hoc codes not listed there (e.g. not_implemented). Examples: `invalid_argument`. |
| `field` | string | No | Optional hint identifying the request field the error refers to, in snake_case (e.g. "slug", "display_name", "token"). Set by handlers that validate multiple fields and want to enable field-targeted UX in clients. Absent when the error does not map to a single field. Examples: `slug`. |
| `message` | string | Yes | Human-readable description of the error. Examples: `limit must be between 1 and 100`. |


#### Security

bearer_jwt

---

### GET `/v1/me` {#getcurrentaccount}

**Get the current account.**

Returns the authenticated user's account profile and the organizations they are an active member of.

#### Responses

**200** — The current account and its memberships.

`application/json`

| Property | Type | Required | Description |
|---|---|---|---|
| `account` | [AccountProfile](#account-profile) | Yes |  |
| `memberships` | [Membership](#membership)[] | Yes | The organizations the account is an active member of. |


**401** — The request lacks valid credentials.

`application/json`

| Property | Type | Required | Description |
|---|---|---|---|
| `code` | string | Yes | Stable, snake_case token identifying the error condition. See ErrorCode for the api's canonical named vocabulary — this field is deliberately not restricted to it, since handlers may emit other ad-hoc codes not listed there (e.g. not_implemented). Examples: `invalid_argument`. |
| `field` | string | No | Optional hint identifying the request field the error refers to, in snake_case (e.g. "slug", "display_name", "token"). Set by handlers that validate multiple fields and want to enable field-targeted UX in clients. Absent when the error does not map to a single field. Examples: `slug`. |
| `message` | string | Yes | Human-readable description of the error. Examples: `limit must be between 1 and 100`. |


#### Security

bearer_jwt

---

### PATCH `/v1/me` {#updatecurrentaccount}

**Update the current account.**

Updates the authenticated user's profile fields. Only the supplied fields are changed.

#### Request body _(required)_

`application/json`

| Property | Type | Required | Description |
|---|---|---|---|
| `avatar_url` | string | No | URL of the account holder's avatar image. |
| `country_code` | string | No | ISO country code of the account holder. |
| `first_name` | string | No | Given name of the account holder. |
| `last_name` | string | No | Family name of the account holder. |
| `last_name_prefix` | string | No | Family-name prefix (e.g. 'van', 'de'). |
| `phone_country_code` | string | No | Dialling country code for the phone number. |
| `phone_number` | string | No | Phone number of the account holder. |


#### Responses

**200** — The updated account profile.

`application/json`

| Property | Type | Required | Description |
|---|---|---|---|
| `avatar_url` | string | No | URL of the account holder's avatar image. |
| `country_code` | string | No | ISO country code of the account holder. |
| `email` | string | Yes | Email address of the account. |
| `first_name` | string | No | Given name of the account holder. |
| `hanko_subject` | string | No | Hanko subject identifier bound to the account. |
| `id` | string | Yes | Unique identifier of the account. |
| `is_phone_verified` | boolean | Yes | Whether the phone number has been verified. |
| `last_name` | string | No | Family name of the account holder. |
| `last_name_prefix` | string | No | Family-name prefix (e.g. 'van', 'de'). |
| `phone_country_code` | string | No | Dialling country code for the phone number. |
| `phone_number` | string | No | Phone number of the account holder. |


**400** — The request was malformed or failed validation.

`application/json`

| Property | Type | Required | Description |
|---|---|---|---|
| `code` | string | Yes | Stable, snake_case token identifying the error condition. See ErrorCode for the api's canonical named vocabulary — this field is deliberately not restricted to it, since handlers may emit other ad-hoc codes not listed there (e.g. not_implemented). Examples: `invalid_argument`. |
| `field` | string | No | Optional hint identifying the request field the error refers to, in snake_case (e.g. "slug", "display_name", "token"). Set by handlers that validate multiple fields and want to enable field-targeted UX in clients. Absent when the error does not map to a single field. Examples: `slug`. |
| `message` | string | Yes | Human-readable description of the error. Examples: `limit must be between 1 and 100`. |


**401** — The request lacks valid credentials.

`application/json`

| Property | Type | Required | Description |
|---|---|---|---|
| `code` | string | Yes | Stable, snake_case token identifying the error condition. See ErrorCode for the api's canonical named vocabulary — this field is deliberately not restricted to it, since handlers may emit other ad-hoc codes not listed there (e.g. not_implemented). Examples: `invalid_argument`. |
| `field` | string | No | Optional hint identifying the request field the error refers to, in snake_case (e.g. "slug", "display_name", "token"). Set by handlers that validate multiple fields and want to enable field-targeted UX in clients. Absent when the error does not map to a single field. Examples: `slug`. |
| `message` | string | Yes | Human-readable description of the error. Examples: `limit must be between 1 and 100`. |


#### Security

bearer_jwt

---

### DELETE `/v1/me` {#erasecurrentaccount}

**Erase the current account.**

Permanently erases the authenticated user's personal data (GDPR Art. 17): scrubs all PII from the account, removes the user from every organization, and best-effort deprovisions the external auth identity. Irreversible. Blocked (409) if the caller is the sole owner of a live organization.

#### Request body _(required)_

`application/json`

| Property | Type | Required | Description |
|---|---|---|---|
| `confirm_email` | string | Yes | The caller's current email, echoed to confirm the irreversible erasure (type-to-confirm guard). |


#### Responses

**204** — The account was erased.

**400** — The request was malformed or failed validation.

`application/json`

| Property | Type | Required | Description |
|---|---|---|---|
| `code` | string | Yes | Stable, snake_case token identifying the error condition. See ErrorCode for the api's canonical named vocabulary — this field is deliberately not restricted to it, since handlers may emit other ad-hoc codes not listed there (e.g. not_implemented). Examples: `invalid_argument`. |
| `field` | string | No | Optional hint identifying the request field the error refers to, in snake_case (e.g. "slug", "display_name", "token"). Set by handlers that validate multiple fields and want to enable field-targeted UX in clients. Absent when the error does not map to a single field. Examples: `slug`. |
| `message` | string | Yes | Human-readable description of the error. Examples: `limit must be between 1 and 100`. |


**401** — The request lacks valid credentials.

`application/json`

| Property | Type | Required | Description |
|---|---|---|---|
| `code` | string | Yes | Stable, snake_case token identifying the error condition. See ErrorCode for the api's canonical named vocabulary — this field is deliberately not restricted to it, since handlers may emit other ad-hoc codes not listed there (e.g. not_implemented). Examples: `invalid_argument`. |
| `field` | string | No | Optional hint identifying the request field the error refers to, in snake_case (e.g. "slug", "display_name", "token"). Set by handlers that validate multiple fields and want to enable field-targeted UX in clients. Absent when the error does not map to a single field. Examples: `slug`. |
| `message` | string | Yes | Human-readable description of the error. Examples: `limit must be between 1 and 100`. |


**409** — The request conflicts with the current state of the resource.

`application/json`

| Property | Type | Required | Description |
|---|---|---|---|
| `code` | string | Yes | Stable, snake_case token identifying the error condition. See ErrorCode for the api's canonical named vocabulary — this field is deliberately not restricted to it, since handlers may emit other ad-hoc codes not listed there (e.g. not_implemented). Examples: `invalid_argument`. |
| `field` | string | No | Optional hint identifying the request field the error refers to, in snake_case (e.g. "slug", "display_name", "token"). Set by handlers that validate multiple fields and want to enable field-targeted UX in clients. Absent when the error does not map to a single field. Examples: `slug`. |
| `message` | string | Yes | Human-readable description of the error. Examples: `limit must be between 1 and 100`. |


#### Security

bearer_jwt

---

