---
updatedAt: 2025-11-02T08:26:13.000Z
agentTools:
  projectIndex: https://docs.appery.io/llms.txt
---

# Register Device

Registering a device to receive Push Notification messages.

In order to send a **Push Notification** message to a device, the device has to register to receive messages. Device registration is done by creating a registration record inside the database **[Devices](https://docs.appery.io/docs/database-collections#devices)** built-in collection. Registration is done by making a request to the following endpoint:

```curl
https://api.appery.io/rest/push/reg
```

# Parameters

Registration supports the following parameters:

| Parameter            | Description                                                                                                                                                                                                                |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AppType              | App platform type (A – Android, I – iOS). **Required**.                                                                                                                                                                    |
| token                | Unique app instance identifier. **Required**.                                                                                                                                                                              |
| deviceId             | Unique device identifier. **Required**.                                                                                                                                                                                    |
| X-Appery-App-Id      | Unique identifier of Appery.io app. The app ID can be found in the App Builder URL. For example: [https://appery.io/app/project/***e51a...ad9***/edit](https://appery.io/app/project/***e51a...ad9***/edit). **Required**. |
| custom\_param\_name  | Name of custom field in **\_devices** table.                                                                                                                                                                               |
| custom\_param\_value | Value of custom\_param\_name field.                                                                                                                                                                                        |
| channels             | List of channelId channel identifiers.                                                                                                                                                                                     |

# Error responses

The endpoint might respond with the following error messages:

| HTTP Status | Code     | Description                                   |
| ----------- | -------- | --------------------------------------------- |
| 400         | PNDR002  | App ID is not specified                       |
| 400         | PNDR007  | Device ID must be a string                    |
| 400         | PNDR008  | Token must be a string                        |
| 400         | PNDR009  | Channels must be an array                     |
| 400         | PNDR0010 | Channel length can’t be more than 256 symbols |
| 400         | PNDR0011 | Type must be a string                         |
| 400         | PNDR0012 | Empty token/registrationID                    |
| 400         | PNDR0013 | Type must be A or I                           |
| 400         | PNDR0014 | Device ID can’t be more than 256 symbols      |
| 400         | PNDR0015 | Project GUID: `<appId>` not found             |
| 400         | PNDR0016 | Token can’t be more than 256 symbols          |
| 400         | PNDR0019 | Channel can’t be empty                        |
| 400         | PNDR0022 | Empty deviceID                                |
| 400         | PNDR960  | Specified brand is not valid                  |

## Example

You can provide values for other predefined or custom fields as well:

```curl
curl -X POST \
  -H "X-Appery-App-ID: e51f973c-aad9-4102-9f39-349c25264277" \
  -H "Content-Type: application/json" \
  -d '{
        "deviceID":"356843051801093;5879669fa11e863e",
        "token":"APA91bGZvocg3LT1sOpTEaW...He-QLxN6nFOFdS1Y77b3cpVBBgxPgRBsYQZRAdOA",
        "type":"A",
        "channels":[1,3,5],
        "category":"paid",
        "timeZone":"GMT+03:00"
    }' 
  https://api.appery.io/rest/push/reg
```

The server returns an **HTTP 200 OK** status and the registered device identifier, if the device was successfully registered.

<Callout icon="📘" theme="info">
  The **deviceId** and **token** parameters are automatically generated device-side. These values can’t be found anywhere except in the **[devices](https://docs.appery.io/docs/database-collections#devices)** collection of the [Appery.io](https://appery.io) **[Database](https://appery.io/database/)**. Information about the device (including the **deviceId** and **token** parameters) where the app is installed, will be saved in the **[devices](https://docs.appery.io/docs/database-collections#devices)** collection of the selected database as soon as the device is running the app.
</Callout>