# Add Referral To Account

`POST https://api.torbox.app/v1/api/user/addreferral`

- Operation ID: `add_referral_to_account`
- Group: User
- Auth: API key, `Authorization: Bearer <api key>` (Sign in with TorBox gives the same key)

### Overview

Automatically adds a referral code to the user's account. This can be used for developers to automatically add their referral to user's accounts who use their service.

This will not override any referral a user already has. If they already have one, then it cannot be changed using this endpoint. It can only be done by the user on the [website](https://torbox.app/subscription).

### Authorization

Requires an API key using the Authorization Bearer Header. Use the user's API key, not your own.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `referral` | query | string | yes | A referral code. Must be UUID. |

## Responses

- `200` Successful Response
- `400` Bad Request
- `401` Unauthorized
- `403` Forbidden
- `404` Not Found
- `422` Validation Error
- `429` Too Many Requests
- `500` Internal Server Error
- `503` Service Unavailable
