> For the complete documentation index, see [llms.txt](https://docs.reveel.id/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.reveel.id/users-old.md).

# Users - old

The Users API allows you to create, fetch, update, disconnect, and disassociate users from your partner application. These users are the foundation for routing, identity, and transactions on Reveel PayID.

All endpoints require partner authentication.

***

### Authentication

```http
Authorization: Bearer your-api-key
Content-Type: application/json
Accept: application/json
```

***

### 1. Create user&#x20;

`POST /user/create`&#x20;

**Authentication**: Required

**Description**: Creates a new user and associates them with your partner account.

**Request Body**:

```json
{
  "email": "user@example.com",
  "twitterUsername": "username",
  "walletAddress": "0x123abc456def789ghi"
}
```

**Success Response – 201 Created**:

```json
{
  "message": "User created successfully",
  "user": {
    "id": "user-id",
    "email": "user@example.com",
    "twitterUsername": "username",
    "walletAddress": "0x123abc456def789ghi",
    "createdAt": "2023-03-01T00:00:00.000Z"
  }
}
```

**Error Responses**:

* 400 Bad Request

```json
{
  "error": "Validation error",
  "message": "Email is required"
}
```

* 401 Unauthorized

```json
{
  "error": "Unauthorized",
  "message": "Partner authentication required"
}
```

* 409 Conflict

```json
{
  "error": "User already exists",
  "message": "This user is already associated with your partner account",
  "userId": "existing-user-id"
}
```

* 500 Internal Server Error

```json
{
  "error": "Internal server error",
  "message": "Error message details"
}
```

***

### 2. Get All users&#x20;

&#x20;`GET /user/list`&#x20;

**Authentication**: Required

**Description**: Lists users associated with your partner.

**Query Parameters**:

* `page`: Page number (default: 1)
* `limit`: Users per page (default: 20)

**Success Response – 200 OK**:

```json
{
  "message": "Users retrieved successfully",
  "count": 2,
  "users": [
    {
      "id": "user-id-1",
      "email": "user1@example.com",
      "twitterUsername": "username1",
      "walletAddress": "0x123...",
      "createdAt": "2023-03-01T00:00:00.000Z",
      "payId": {
        "id": "payid-id-1",
        "name": "username1"
      }
    }
  ],
  "pagination": {
    "currentPage": 1,
    "totalPages": 1,
    "totalCount": 2,
    "perPage": 20
  }
}
```

**Error Responses**:

* 401 Unauthorized

```json
{
  "error": "Unauthorized",
  "message": "Partner authentication required"
}
```

* 500 Internal Server Error

```json
{
  "error": "Internal server error",
  "message": "Error message details"
}
```

***

### 3. Get a particular user by ID

&#x20;`GET /user/:id`&#x20;

**Authentication**: Required

**Description**: Fetches a user by ID if associated with your account.

**Success Response – 200 OK**:

```json
{
  "message": "User retrieved successfully",
  "user": {
    "id": "user-id-1",
    "email": "user1@example.com",
    "twitterUsername": "username1",
    "walletAddress": "0x123...",
    "createdAt": "2023-03-01T00:00:00.000Z",
    "payId": {
      "id": "payid-id-1",
      "name": "username1"
    }
  }
}
```

**Error Responses**:

* 401 Unauthorized

```json
{
  "error": "Unauthorized",
  "message": "Partner authentication required"
}
```

* 404 Not Found

```json
{
  "error": "User not found",
  "message": "This user does not exist or is not associated with your partner account"
}
```

* 500 Internal Server Error

```json
{
  "error": "Internal server error",
  "message": "Error message details"
}
```

***

### 4. Update user

&#x20; `PUT /user/:id`&#x20;

**Authentication**: Required

**Description**: Updates an existing user.

**Request Body**:

```json
{
  "email": "updated@example.com",
  "twitterUsername": "newusername",
  "walletAddress": "0x987zyx654wvu321tsr"
}
```

**Success Response – 200 OK**:

```json
{
  "message": "User updated successfully",
  "user": {
    "id": "user-id-1",
    "email": "updated@example.com",
    "twitterUsername": "newusername",
    "walletAddress": "0x987zyx654wvu321tsr",
    "updatedAt": "2023-03-10T00:00:00.000Z"
  }
}
```

**Error Responses**:

* 400 Bad Request

```json
{
  "error": "Validation error",
  "message": "Field validation failed"
}
```

* 401 Unauthorized

```json
{
  "error": "Unauthorized",
  "message": "Partner authentication required"
}
```

* 404 Not Found

```json
{
  "error": "User not found",
  "message": "This user does not exist or is not associated with your partner account"
}
```

* 409 Conflict

```json
{
  "error": "Update failed",
  "message": "The provided email is already associated with another user"
}
```

* 500 Internal Server Error

```json
{
  "error": "Internal server error",
  "message": "Error message details"
}
```

***

### 5. Disconnect Wallet

`POST /user/:id/disconnect-wallet`&#x20;

**Authentication**: Required

**Description**: Disconnects the wallet address of a user.

**Success Response – 200 OK**:

```json
{
  "message": "Wallet disconnected successfully",
  "user": {
    "id": "user-id-1",
    "walletAddress": null,
    "updatedAt": "2023-03-15T00:00:00.000Z"
  }
}
```

**Error Responses**:

* 400 Bad Request

```json
{
  "error": "Wallet disconnection failed",
  "message": "User does not have a connected wallet"
}
```

* 401 Unauthorized

```json
{
  "error": "Unauthorized",
  "message": "Partner authentication required"
}
```

* 404 Not Found

```json
{
  "error": "User not found",
  "message": "This user does not exist or is not associated with your partner account"
}
```

* 500 Internal Server Error

```json
{
  "error": "Internal server error",
  "message": "Error message details"
}
```

***

### 6. Delete user

`DELETE /user/:id`&#x20;

**Description**: Disassociates a user from your partner account (does not delete the user globally).

**Success Response – 200 OK**:

```json
{
  "message": "User disassociated from partner successfully"
}
```

**Error Responses**:

* 401 Unauthorized

```json
{
  "error": "Unauthorized",
  "message": "Partner authentication required"
}
```

* 404 Not Found

```json
{
  "error": "Association not found",
  "message": "No association between this user and partner found"
}
```

* 500 Internal Server Error

```json
{
  "error": "Internal server error",
  "message": "Error message details"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.reveel.id/users-old.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
