# Assign subscription

`POST https://api.cryptohopper.com/v1/subscription/assign`

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

Assigns one of the user's subscriptions to a bot. Use subscription_id 0 for the trial subscription and hopper_id 0 to unassign it.

OAuth scope: `read`, `manage`

## Headers

| Name | Type | Required | Description |
|---|---|---|---|
| `access-token` | string | yes | The OAuth access token of the user. |

## Example request

```bash
curl -X POST "https://api.cryptohopper.com/v1/subscription/assign" \
  -H "access-token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"subscription_id":466000,"hopper_id":987654}'
```

## Response

Example response (illustrative values):

```json
{
    "data": "Subscription has been reassigned."
}
```

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.
