# Register a push installation

`POST /v1/contacts/{id}/installations`

Requires an API key with the `contacts:write` scope. [About keys and scopes](/docs/api/authentication)

Registers a device or browser subscription against a contact so push can reach it. Re-registering the same token updates the existing installation rather than creating a duplicate.

## Path parameters

- `id` (string, required, uuid)

## Returns

Returns `200 OK` with a `PushInstallation` in `data`. Otherwise returns an error; [Errors](/docs/api/errors) lists every code and which to retry.

- `id` (string, required, uuid)
- `contactId` (string, required, uuid)
- `pushAppId` (string, required, uuid)
- `externalInstallationId` (string, required) — Your own id for the device, as registered.
- `platform` (string, required, one of `ios`, `android`, `web`)
- `environment` (string, required, one of `sandbox`, `production`)
- `permission` (string, required, one of `granted`, `denied`)
- `active` (boolean, required) — False once the device is disabled or its token is refused.
- `invalidatedAt` (string | null, required, date-time) — When the provider refused the token or the device was disabled.
- `lastSeenAt` (string, required, date-time) — When the device last registered or refreshed.
- `sdk` (string | null, required) — The Kirora SDK and version that last registered it; null from a server.
- `createdAt` (string, required, date-time)

## Example

```bash
curl -X POST https://api.kirora.io/v1/contacts/018f2a4e-6b1c-7d3e-9f40-37386ae05a6b/installations \
  -H "Authorization: Bearer $KIRORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "pushAppId": "018f2a4e-6b1c-7d3e-9f40-7967f0395a6b",
    "externalInstallationId": "externalInstallationId_example",
    "permission": "granted",
    "targetKind": "apns_token",
    "target": "target_example"
  }'
```

Response `200`:

```json
{
  "data": {
    "id": "018f2a4e-6b1c-7d3e-9f40-37386ae05a6b",
    "contactId": "018f2a4e-6b1c-7d3e-9f40-4db757ce5a6b",
    "pushAppId": "018f2a4e-6b1c-7d3e-9f40-7967f0395a6b",
    "externalInstallationId": "externalInstallationId_example",
    "platform": "ios",
    "environment": "sandbox",
    "permission": "granted",
    "active": true,
    "invalidatedAt": "2030-03-14T09:30:00Z",
    "lastSeenAt": "2030-03-14T09:30:00Z",
    "sdk": "sdk_example",
    "createdAt": "2030-03-14T09:30:00Z"
  }
}
```
