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

# Create Account

> POST /v1/accounts — Open a client account; RebelFi emails the contact an activation link

> [!NOTE]
>
> **Endpoint:** `POST https://api.rebelfi.io/v1/accounts`

Open a [client account](https://docs.rebelfi.io/docs/guides/client-accounts.md) for one of your clients. RebelFi creates the account and emails the
contact an activation link. The response never carries the link: only the contact's inbox receives it, so only the
client can accept RebelFi's terms.

The account starts `PENDING_ACTIVATION`. Supply to its wallets is refused until the contact activates it in the
RebelFi Earn portal.

Creation is **idempotent** on `reference`: the same reference with the same contact email returns the existing account
and sends no second email.

> [!NOTE]
>
> Client accounts are enabled per organization by RebelFi. Without them, this call returns `403 CLIENT_ACCOUNTS_NOT_ENABLED`.
> Requires a profile-scoped key; an admin key is read-only.

### Request Body

| Field | Type | Required | Description |
| - | - | - | - |
| `reference` | `string` | Yes | Your own reference for this client, unique within your organization (max 255). It becomes the `userId` of the account's wallets |
| `organizationName` | `string` | Yes | The client organization's name (max 255) |
| `contact.firstName` | `string` | Yes | The contact's first name |
| `contact.lastName` | `string` | Yes | The contact's last name |
| `contact.email` | `string` | Yes | Where the activation email goes. Must not already belong to a RebelFi user or another client account |

### Example Request

```bash cURL theme={null}
curl -X POST "https://api.rebelfi.io/v1/accounts" \
  -H "x-api-key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "reference": "CLIENT-0042",
    "organizationName": "Example Capital LP",
    "contact": { "firstName": "Jane", "lastName": "Doe", "email": "jane@example.com" }
  }'
```

```typescript SDK theme={null}
const account = await client.accounts.create({
  reference: 'CLIENT-0042',
  organizationName: 'Example Capital LP',
  contact: { firstName: 'Jane', lastName: 'Doe', email: 'jane@example.com' }
});
```

### Example Response

```json theme={null}
{
  "accountId": 17,
  "reference": "CLIENT-0042",
  "organizationName": "Example Capital LP",
  "status": "PENDING_ACTIVATION",
  "createdAt": "2026-11-24T15:00:00.000Z",
  "wallets": []
}
```

### Response Fields

| Field | Type | Description |
| - | - | - |
| `accountId` | `number` | Client account ID. Pass it as `accountId` to [Register Wallet](https://docs.rebelfi.io/docs/api-reference/wallets/register.md) |
| `reference` | `string` | Your reference for this client |
| `organizationName` | `string` | The client organization's name |
| `status` | `string` | `PENDING_ACTIVATION`, `ACTIVE` or `SUSPENDED`. See [Account states](https://docs.rebelfi.io/docs/guides/client-accounts.md#account-states) |
| `createdAt` | `string` | Creation timestamp (ISO 8601) |
| `activatedAt` | `string?` | When the client accepted the terms (ISO 8601). Absent while pending |
| `wallets` | `Wallet[]` | The account's linked wallets, in the shape [Get Wallet](https://docs.rebelfi.io/docs/api-reference/wallets/get.md) returns. A profile-scoped key sees its own profile's wallets |

The activation link expires after 7 days. To send a new one, call [Resend Activation](https://docs.rebelfi.io/docs/api-reference/accounts/resend-activation.md).

### Errors

| Code | HTTP | Description |
| - | - | - |
| `CLIENT_ACCOUNTS_NOT_ENABLED` | 403 | Your organization doesn't open client accounts. Contact RebelFi |
| `FORBIDDEN` | 403 | An admin (read-only) key |
| `ACCOUNT_REFERENCE_CONFLICT` | 409 | This reference already names an account with another contact email. `details`: `{ reference, accountId }` |
| `CONTACT_EMAIL_UNAVAILABLE` | 409 | The contact email already belongs to a RebelFi user or another client account. Use another address |
| `VALIDATION_FAILED` | 400 | Invalid request body |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.