# Register user

`POST https://api.cryptohopper.com/v1/user/register`

Part of [Users](https://www.cryptohopper.com/api-documentation/api-reference/users.md) in the Cryptohopper API reference.

Creates a new Cryptohopper account. The fields are read from the request headers listed below or from a JSON body. Needs no access token.

Only works from Cryptohopper's own apps: the User-Agent header must hold the username encrypted with a platform key, and failed checks count toward an IP block. With DeviceId and Platform ios or android the response also contains access_token.

## Headers

| Name | Type | Required | Description |
|---|---|---|---|
| `subscribe` | string | no | Any non-empty value subscribes the user to the newsletter. Alias of subscribe_newsletter. |
| `name` | string | yes | Full name, 3 to 255 characters. |
| `subscribe-newsletter` | string | no | Any non-empty value subscribes the user to the newsletter. Alias of subscribe_newsletter. |
| `password` | string | yes | Password; must meet the Cryptohopper password policy. |
| `email` | string | yes | Email address of the new account. |
| `username` | string | yes | Username, 3 to 255 characters. |
| `subscribe_newsletter` | string | no | Any non-empty value subscribes the user to the newsletter. |
| `Platform` | string | no | Platform of the client: web, ios or android. Required. |

## Example request

```bash
curl -X POST "https://api.cryptohopper.com/v1/user/register" \
  -H "access-token: YOUR_ACCESS_TOKEN" \
  -H "name: NAME" \
  -H "password: PASSWORD" \
  -H "email: EMAIL" \
  -H "username: USERNAME"
```

## Response

Example response (illustrative values):

```json
{
    "data": {
        "user_id": "123456",
        "message": "New user created.",
        "user_activation_needed": "1",
        "secret": "U2FsdGVkX1%2BexampleSecret"
    }
}
```

Status codes: 200. Errors return JSON with `status`, `error` and `message`, plus a numeric `code` when the error comes from the API itself rather than the gateway.
