---
title: "Close an account"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.nicer.travel/llms.txt
> Use this file to discover all available pages before exploring further.

# Close an account

Path: Nicer API › identity

`DELETE /identity/user/{id}`

URL: `https://api.nicer.travel/identity/user/{id}`

Closes a person's account everywhere: marks it deleted, removes their sign-in, frees their email and phone number, and publishes their removal from every agency they worked for, which leaves the travelers they served there for its admins to reassign. Answers the account as it was marked. A person may close their own account; an agency admin only the account of someone who belongs to the agency the request acts for and to no other; Nicer staff anyone's. Errors: 403 ERROR_UNAUTHORIZED for an account the caller may not close.

## Authentication

- `bearerAuth`, http bearer, header `Authorization`, format `JWT`

## Path parameters

- `id` (`identity.user.delete.path.id`; string, required)

## Code samples

### JavaScript SDK

```javascript
import { createClient } from "@nicertravel/sdk";

const nicer = createClient({
  baseUrl: "https://api.nicer.travel",
  token: process.env.NICER_TOKEN,
});

await nicer.identity.user.delete({
  "id": "string"
});
```

### Nicer CLI

```bash
nicer identity user delete --id 'string'
```

### cURL

```bash
curl --request DELETE \
  --url 'https://api.nicer.travel/identity/user/<id>' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/identity/user/<id>';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.nicer.travel/identity/user/<id>"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "avatar": "string",
  "biography": "string",
  "calendarUrl": "string",
  "companyName": "string",
  "deleted": true,
  "deletedAt": "string",
  "deletedBy": "string",
  "email": "string",
  "externalIntercomId": "string",
  "familyName": "string",
  "fullName": "string",
  "givenName": "string",
  "instagram": "string",
  "invitedAt": "string",
  "invitedBy": "string",
  "lastModifiedBy": "string",
  "location": {
    "address": "string",
    "city": "string",
    "country": "string",
    "countryCode": "string",
    "latitude": 0,
    "longitude": 0,
    "neighborhood": "string",
    "region": "string",
    "state": "string",
    "zipCode": "string"
  },
  "phoneNumber": "string",
  "registrationSource": "string",
  "role": "advisor",
  "searchKey": "string",
  "tenantOwner": true,
  "tourProgress": {
    "property1": {
      "completedAt": "string",
      "status": "completed"
    },
    "property2": {
      "completedAt": "string",
      "status": "completed"
    }
  },
  "username": "string",
  "zoneinfo": "string",
  "tenantId": "string",
  "userId": "string",
  "createdAt": "string",
  "type": "User",
  "updatedAt": "string"
}
```

- `familyName` (`identity.user.delete.response.200.familyName`; string, required) — The person's last name.
- `fullName` (`identity.user.delete.response.200.fullName`; any of, required) — givenName and familyName joined; null until the person has both.
  - any of the following: `string`, `null`
- `givenName` (`identity.user.delete.response.200.givenName`; string, required) — The person's first name.
- `role` (`identity.user.delete.response.200.role`; string, required) — The person's role in the agency they last switched into.
  - one of `"advisor"`, `"traveler"`, `"admin"`, `"superadmin"`
- `tenantId` (`identity.user.delete.response.200.tenantId`; string, required) — The partition the account is stored in: the userId for every account opened today.
- `userId` (`identity.user.delete.response.200.userId`; string, required) — The person's id, their sign-in subject.
- `createdAt` (`identity.user.delete.response.200.createdAt`; string, required) — When the account was opened.
- `type` (`identity.user.delete.response.200.type`; string, required)
- `updatedAt` (`identity.user.delete.response.200.updatedAt`; string, required) — When the account last changed.
- `avatar` (`identity.user.delete.response.200.avatar`; string, optional) — The person's photo: a URL, or the file's storage key in the answers of DELETE /identity/user/{userId} and of an admin's GET /identity/users.
- `biography` (`identity.user.delete.response.200.biography`; any of, optional) — What the person writes about themself.
  - any of the following: `string`, `null`
- `calendarUrl` (`identity.user.delete.response.200.calendarUrl`; any of, optional) — A link where people book time with the person.
  - any of the following: `string`, `null`
- `companyName` (`identity.user.delete.response.200.companyName`; any of, optional) — The agency the person last switched into; null, empty or absent on some older accounts.
  - any of the following: `string`, `null`
- `deleted` (`identity.user.delete.response.200.deleted`; boolean, optional) — True once the account is closed.
- `deletedAt` (`identity.user.delete.response.200.deletedAt`; any of, optional) — When the account was closed.
  - any of the following: `string`, `null`
- `deletedBy` (`identity.user.delete.response.200.deletedBy`; string, optional) — The user id of whoever closed the account.
- `email` (`identity.user.delete.response.200.email`; any of, optional) — The email the person signs in with; absent, or null on some older accounts, for a person who signed up by phone.
  - any of the following: `string`, `null`
- `externalIntercomId` (`identity.user.delete.response.200.externalIntercomId`; any of, optional) — A support-tool id some older accounts keep.
  - any of the following: `string`, `null`
- `instagram` (`identity.user.delete.response.200.instagram`; any of, optional) — The person's Instagram handle.
  - any of the following: `string`, `null`
- `invitedAt` (`identity.user.delete.response.200.invitedAt`; any of, optional) — When the person was invited, on some older accounts.
  - any of the following: `string`, `null`
- `invitedBy` (`identity.user.delete.response.200.invitedBy`; any of, optional) — The user id of whoever invited or referred the person.
  - any of the following: `string`, `null`
- `lastModifiedBy` (`identity.user.delete.response.200.lastModifiedBy`; string, optional) — The user id of whoever last changed the account.
- `location` (`identity.user.delete.response.200.location`; object, optional) — Where the person says they are.
  - `address` (`identity.user.delete.response.200.location.address`; string, optional)
  - `city` (`identity.user.delete.response.200.location.city`; string, optional)
  - `country` (`identity.user.delete.response.200.location.country`; string, optional)
  - `countryCode` (`identity.user.delete.response.200.location.countryCode`; string, optional)
  - `latitude` (`identity.user.delete.response.200.location.latitude`; number, optional)
  - `longitude` (`identity.user.delete.response.200.location.longitude`; number, optional)
  - `neighborhood` (`identity.user.delete.response.200.location.neighborhood`; string, optional)
  - `region` (`identity.user.delete.response.200.location.region`; string, optional)
  - `state` (`identity.user.delete.response.200.location.state`; string, optional)
  - `zipCode` (`identity.user.delete.response.200.location.zipCode`; string, optional)
- `phoneNumber` (`identity.user.delete.response.200.phoneNumber`; any of, optional) — The phone number the person signs in with; absent, or null on some older accounts, for a person who signed up by email.
  - any of the following: `string`, `null`
- `registrationSource` (`identity.user.delete.response.200.registrationSource`; string, optional) — How the account was opened, such as INVITATION_REGISTRATION.
- `searchKey` (`identity.user.delete.response.200.searchKey`; string, optional) — fullName in lowercase, which searches match.
- `tenantOwner` (`identity.user.delete.response.200.tenantOwner`; boolean, optional) — Set on some older accounts.
- `tourProgress` (`identity.user.delete.response.200.tourProgress`; map of object, optional) — The in-app product tours the person completed, skipped or dismissed, by tour id.
- `username` (`identity.user.delete.response.200.username`; string, optional) — The person's handle, made from their name, for referral links.
- `zoneinfo` (`identity.user.delete.response.200.zoneinfo`; any of, optional) — The person's time zone, an IANA name such as America/Bogota.
  - any of the following: `string`, `null`

### 400

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`identity.user.delete.response.400.errorCode`; string, required)
- `errorMessage` (`identity.user.delete.response.400.errorMessage`; string, required)

### 401

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`identity.user.delete.response.401.errorCode`; string, required)
- `errorMessage` (`identity.user.delete.response.401.errorMessage`; string, required)

### 403

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`identity.user.delete.response.403.errorCode`; string, required)
- `errorMessage` (`identity.user.delete.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/identity/identity.user.delete/index.md
