# Push Notifications

**Summary:** Endpoints for Push Notifications

- Role: [Developers](https://www.subrite.no/developers)
- Source: https://www.subrite.no/developers/push-notifications-2
- Updated: 2026-10-13
- Markdown index: https://www.subrite.no/developers/llms.txt

<a id="get-api-v1-app-push-setup"></a>
## Get push notifications setup

`GET /api/v1/app-push/setup`

**Authentication:** Bearer token (JWT)

### Responses

#### 200

Content type: `application/json` · `PushSetupResponseDto`

| Name | Type | Description |
| --- | --- | --- |
| `id` (Required) | `number` |   |
| `createdAt` (Required) | `string (date-time)` |   |
| `updatedAt` (Required) | `string (date-time)` |   |
| `provider` (Required) | `string` | Allowed values: `"fcm"` |
| `providerCredentials` (Required) | `ProviderCredentials` |   |
| `providerCredentials.type` (Required) | `string` |   |
| `providerCredentials.project_id` (Required) | `string` |   |
| `providerCredentials.private_key_id` (Required) | `string` |   |
| `providerCredentials.private_key` (Required) | `string` |   |
| `providerCredentials.client_email` (Required) | `string` |   |
| `providerCredentials.client_id` (Required) | `string` |   |
| `providerCredentials.auth_uri` (Required) | `string` |   |
| `providerCredentials.token_uri` (Required) | `string` |   |
| `providerCredentials.auth_provider_x509_cert_url` (Required) | `string` |   |
| `providerCredentials.client_x509_cert_url` (Required) | `string` |   |
| `providerCredentials.universe_domain` (Required) | `string` |   |
| `tenantId` (Required) | `number` |   |
| `dataAttributes` (Required) | `array of PushDataAttributeSchema` |   |
| `dataAttributes[].name` (Required when parent is present) | `string` |   |
| `dataAttributes[].label` (Required when parent is present) | `Translation` |   |
| `dataAttributes[].label.en` (Required when parent is present) | `string` |   |
| `dataAttributes[].label.no` (Required when parent is present) | `string` |   |
| `dataAttributes[].label.sv` | `string` |   |
| `dataAttributes[].label.da` | `string` |   |
| `dataAttributes[].label.key` | `string` |   |
| `dataAttributes[].type` (Required when parent is present) | `string` |   |
| `dataAttributes[].required` (Required when parent is present) | `boolean` |   |
| `topics` (Required) | `array of PushTopic` |   |
| `topics[].slug` (Required when parent is present) | `string` |   |
| `topics[].label` (Required when parent is present) | `Translation` |   |
| `topics[].label.en` (Required when parent is present) | `string` |   |
| `topics[].label.no` (Required when parent is present) | `string` |   |
| `topics[].label.sv` | `string` |   |
| `topics[].label.da` | `string` |   |
| `topics[].label.key` | `string` |   |

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` |   |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 404

Content type: `application/json` · `ErrorResponse`

notFound

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl https://api.subrite.no/api/v1/app-push/setup \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "id": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "provider": "fcm",
  "providerCredentials": {
    "type": "string",
    "project_id": "string",
    "private_key_id": "string",
    "private_key": "<private_key>",
    "client_email": "string",
    "client_id": "string",
    "auth_uri": "string",
    "token_uri": "string",
    "auth_provider_x509_cert_url": "string",
    "client_x509_cert_url": "string",
    "universe_domain": "string"
  },
  "tenantId": 0,
  "dataAttributes": [
    {}
  ],
  "topics": [
    {}
  ]
}
```

<a id="post-api-v1-app-push-setup"></a>
## Setup push notifications

`POST /api/v1/app-push/setup`

**Authentication:** Bearer token (JWT)

### Request body

Content type: `application/json` · Required · `CreateFCMPushSetupRequestDto`

| Name | Type | Description |
| --- | --- | --- |
| `providerCredentials` (Required) | `string` |   |
| `dataAttributes` (Required) | `array of PushDataAttributeSchema` |   |
| `dataAttributes[].name` (Required when parent is present) | `string` |   |
| `dataAttributes[].label` (Required when parent is present) | `Translation` |   |
| `dataAttributes[].label.en` (Required when parent is present) | `string` |   |
| `dataAttributes[].label.no` (Required when parent is present) | `string` |   |
| `dataAttributes[].label.sv` | `string` |   |
| `dataAttributes[].label.da` | `string` |   |
| `dataAttributes[].label.key` | `string` |   |
| `dataAttributes[].type` (Required when parent is present) | `string` |   |
| `dataAttributes[].required` (Required when parent is present) | `boolean` |   |
| `topics` (Required) | `array of PushTopic` |   |
| `topics[].slug` (Required when parent is present) | `string` |   |
| `topics[].label` (Required when parent is present) | `Translation` |   |
| `topics[].label.en` (Required when parent is present) | `string` |   |
| `topics[].label.no` (Required when parent is present) | `string` |   |
| `topics[].label.sv` | `string` |   |
| `topics[].label.da` | `string` |   |
| `topics[].label.key` | `string` |   |

### Responses

#### 200

Content type: `application/json` · `PushSetupResponseDto`

Same fields as [Get push notifications setup (200)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl https://api.subrite.no/api/v1/app-push/setup \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "providerCredentials": "<providerCredentials>",
  "dataAttributes": [
    {}
  ],
  "topics": [
    {}
  ]
}'
```

### Example response

200 · `application/json`

```json
{
  "id": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "provider": "fcm",
  "providerCredentials": {
    "type": "string",
    "project_id": "string",
    "private_key_id": "string",
    "private_key": "<private_key>",
    "client_email": "string",
    "client_id": "string",
    "auth_uri": "string",
    "token_uri": "string",
    "auth_provider_x509_cert_url": "string",
    "client_x509_cert_url": "string",
    "universe_domain": "string"
  },
  "tenantId": 0,
  "dataAttributes": [
    {}
  ],
  "topics": [
    {}
  ]
}
```

<a id="patch-api-v1-app-push-setup"></a>
## Update push notifications setup

`PATCH /api/v1/app-push/setup`

**Authentication:** Bearer token (JWT)

### Request body

Content type: `application/json` · Required · `UpdateFCMPushSetupRequestDto`

| Name | Type | Description |
| --- | --- | --- |
| `providerCredentials` (Required) | `string` |   |
| `dataAttributes` (Required) | `array of PushDataAttributeSchema` |   |
| `dataAttributes[].name` (Required when parent is present) | `string` |   |
| `dataAttributes[].label` (Required when parent is present) | `Translation` |   |
| `dataAttributes[].label.en` (Required when parent is present) | `string` |   |
| `dataAttributes[].label.no` (Required when parent is present) | `string` |   |
| `dataAttributes[].label.sv` | `string` |   |
| `dataAttributes[].label.da` | `string` |   |
| `dataAttributes[].label.key` | `string` |   |
| `dataAttributes[].type` (Required when parent is present) | `string` |   |
| `dataAttributes[].required` (Required when parent is present) | `boolean` |   |
| `topics` (Required) | `array of PushTopic` |   |
| `topics[].slug` (Required when parent is present) | `string` |   |
| `topics[].label` (Required when parent is present) | `Translation` |   |
| `topics[].label.en` (Required when parent is present) | `string` |   |
| `topics[].label.no` (Required when parent is present) | `string` |   |
| `topics[].label.sv` | `string` |   |
| `topics[].label.da` | `string` |   |
| `topics[].label.key` | `string` |   |

### Responses

#### 200

Content type: `application/json` · `PushSetupResponseDto`

Same fields as [Get push notifications setup (200)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl https://api.subrite.no/api/v1/app-push/setup \
  --request PATCH \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "providerCredentials": "<providerCredentials>",
  "dataAttributes": [
    {}
  ],
  "topics": [
    {}
  ]
}'
```

### Example response

200 · `application/json`

```json
{
  "id": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "provider": "fcm",
  "providerCredentials": {
    "type": "string",
    "project_id": "string",
    "private_key_id": "string",
    "private_key": "<private_key>",
    "client_email": "string",
    "client_id": "string",
    "auth_uri": "string",
    "token_uri": "string",
    "auth_provider_x509_cert_url": "string",
    "client_x509_cert_url": "string",
    "universe_domain": "string"
  },
  "tenantId": 0,
  "dataAttributes": [
    {}
  ],
  "topics": [
    {}
  ]
}
```

<a id="post-api-v1-app-push-subscribe"></a>
## Subscribe to push notifications from app

`POST /api/v1/app-push/subscribe`

**Authentication:** Bearer token (JWT)

### Request body

Content type: `application/json` · Required · `SubscribeToPushRequestDto`

| Name | Type | Description |
| --- | --- | --- |
| `token` (Required) | `string` |   |
| `provider` (Required) | `string` | Allowed values: `"fcm"` |
| `topics` (Required) | `array of string` | `minItems`: `0` |

**Example request body**

`application/json`

```json
{
  "token": "<token>",
  "provider": "fcm",
  "topics": [
    "string"
  ]
}
```

### Responses

#### 201

Content type: `application/json` · `PushSubscriber`

| Name | Type | Description |
| --- | --- | --- |
| `token` (Required) | `string` |   |
| `provider` (Required) | `string` | Allowed values: `"fcm"` |
| `tenant` (Required) | `Tenant` |   |
| `tenant.market` (Required) | `string` | Operating market of the tenant (immutable post-install). · Allowed values: `"NO"`, `"SE"`, `"DK"` |
| `tenant.productName` | `string` | The product name of the tenant · Allowed values: `"enterprise"`, `"communication"`, `"custom"` |
| `tenant.additionalFeatures` | `array of string` | The additional features of the tenant · Allowed values: `"email"`, `"sms"`, `"push"`, `"podcasts"`, `"subscription"`, `"insights"`, `"dashboard"`, `"automation"`, `"export"`, `"accounting"`, `"invoices"`, `"ai"` |
| `tenant.disabledFeatures` | `array of string` | The disabled features of the tenant · Allowed values: `"email"`, `"sms"`, `"push"`, `"podcasts"`, `"subscription"`, `"insights"`, `"dashboard"`, `"automation"`, `"export"`, `"accounting"`, `"invoices"`, `"ai"` |
| `tenant.name` (Required) | `string` |   |
| `tenant.isActive` (Required) | `boolean` |   |
| `tenant.defaultLanguage` (Required) | `string` | Allowed values: `"en"`, `"no"`, `"sv"`, `"da"` |
| `tenant.hostName` (Required) | `string` |   |
| `tenant.logo` (Required) | `string` |   |
| `tenant.favicon` (Required) | `string` |   |
| `tenant.authLogo` (Required) | `string` |   |
| `tenant.authLogoHeight` (Required) | `number` |   |
| `tenant.siteUrl` (Required) | `string` |   |
| `tenant.termsUrl` (Required) | `string` |   |
| `tenant.privacyUrl` (Required) | `string` |   |
| `tenant.gtm` (Required) | `string` |   |
| `tenant.taxRates` | `array of number` |   |
| `tenant.smsOtp` (Required) | `boolean` |   |
| `tenant.emailProvider` (Required) | `string` | Allowed values: `"brevo"`, `"sendgrid"` |
| `tenant.tenantContact` (Required) | `string` |   |
| `tenant.registeredBusinessNo` (Required) | `string` |   |
| `tenant.bankAccountNo` (Required) | `string` |   |
| `tenant.swiftCode` (Required) | `string` |   |
| `tenant.iban` (Required) | `string` |   |
| `tenant.defaultLogoutURL` (Required) | `string` |   |
| `tenant.postalAddress` (Required) | `string` |   |
| `tenant.otpTemplateId` | `Translation` | Nested fields omitted: field limit. |
| `tenant.smsSenderId` (Required) | `number` |   |
| `tenant.emailSenderId` (Required) | `number` |   |
| `tenant.smsSender` (Required) | `CommunicationSender` | Nested fields omitted: field limit. |
| `tenant.emailSender` (Required) | `CommunicationSender` | Nested fields omitted: field limit. |
| `tenant.products` (Required) | `array of Product` | Nested fields omitted: field limit. |
| `tenant.users` (Required) | `array of User` | Nested fields omitted: field limit. |
| `tenant.members` (Required) | `array of Member` | Nested fields omitted: field limit. |
| `tenant.roles` (Required) | `array of Role` | Nested fields omitted: field limit. |
| `tenant.subscriptionPlans` (Required) | `array of SubscriptionPlan` | Nested fields omitted: field limit. |
| `tenant.packages` (Required) | `array of Package` | Nested fields omitted: field limit. |
| `tenant.invoices` (Required) | `array of Invoice` | Nested fields omitted: field limit. |
| `tenant.orders` (Required) | `array of Order` | Nested fields omitted: field limit. |
| `tenant.paymentProviders` (Required) | `array of PaymentProviderConfig` | Nested fields omitted: field limit. |
| `tenant.newslettersProviderConfig` (Required) | `array of NewsletterProviderConfig` | Nested fields omitted: field limit. |
| `tenant.paymentProviderConfigs` (Required) | `array of PaymentProviderConfig` | Nested fields omitted: field limit. |
| `tenant.oidcClients` (Required) | `array of OidcClient` | Nested fields omitted: field limit. |
| `tenant.oauthProviders` (Required) | `array of OauthProvider` | Nested fields omitted: field limit. |
| `tenant.activityLogs` (Required) | `array of ActivityLog` | Nested fields omitted: field limit. |
| `tenant.m2m_api_clients` (Required) | `array of M2MApiClient` | Nested fields omitted: field limit. |
| `tenant.customProperties` (Required) | `array of CustomProperty` | Nested fields omitted: field limit. |
| `tenant.consents` (Required) | `array of Consent` | Nested fields omitted: field limit. |
| `tenant.preference` (Required) | `Preference` | Nested fields omitted: field limit. |
| `tenant.settings` (Required) | `TenantSettings` | Nested fields omitted: field limit. |
| `tenant.communicationTemplates` (Required) | `array of CommunicationTemplate` | Nested fields omitted: field limit. |
| `tenant.additionalHostnames` (Required) | `array of TenantHostname` | Nested fields omitted: field limit. |
| `tenant.exportHistory` (Required) | `array of ExportHistory` | Nested fields omitted: field limit. |
| `tenant.arReportHistory` (Required) | `array of ArReportHistory` | Nested fields omitted: field limit. |
| `tenant.mypageCardsSettings` (Required) | `array of MypageCardsSettings` | Nested fields omitted: field limit. |
| `tenant.webhooks` (Required) | `array of Webhook` | Nested fields omitted: field limit. |
| `tenant.customOrders` (Required) | `array of CustomOrder` | Nested fields omitted: field limit. |
| `tenant.customOrderSources` (Required) | `array of CustomOrderSource` | Nested fields omitted: field limit. |
| `tenant.brandKits` (Required) | `array of BrandKit` | Nested fields omitted: field limit. |
| `tenant.communicationReceivers` (Required) | `array of CommunicationReceiver` | Nested fields omitted: field limit. |
| `tenant.id` (Required) | `number` |   |
| `tenant.createdAt` (Required) | `string (date-time)` |   |
| `tenant.updatedAt` (Required) | `string (date-time)` |   |
| `tenant.deletedAt` (Required) | `string (date-time)` |   |
| `tenant.metaData` (Required) | `object` |   |
| `tenantId` (Required) | `number` |   |
| `memberId` (Required) | `string` |   |
| `member` (Required) | `Member` | Nested fields omitted: field limit. |
| `topics` (Required) | `array of string` |   |
| `id` (Required) | `number` |   |
| `createdAt` (Required) | `string (date-time)` |   |
| `updatedAt` (Required) | `string (date-time)` |   |
| `deletedAt` (Required) | `string (date-time)` |   |
| `metaData` (Required) | `object` |   |

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl https://api.subrite.no/api/v1/app-push/subscribe \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "token": "<token>",
  "provider": "fcm",
  "topics": [
    "string"
  ]
}'
```

### Example response

201 · `application/json`

```json
{
  "token": "<token>",
  "provider": "fcm",
  "tenant": {
    "market": "NO",
    "productName": "enterprise",
    "additionalFeatures": [],
    "disabledFeatures": [],
    "name": "string",
    "isActive": true,
    "defaultLanguage": "en",
    "hostName": "string",
    "logo": "string",
    "favicon": "string",
    "authLogo": "string",
    "authLogoHeight": 0,
    "siteUrl": "string",
    "termsUrl": "string",
    "privacyUrl": "string",
    "gtm": "string",
    "taxRates": [],
    "smsOtp": true,
    "emailProvider": "brevo",
    "tenantContact": "string",
    "registeredBusinessNo": "string",
    "bankAccountNo": "string",
    "swiftCode": "string",
    "iban": "<iban>",
    "defaultLogoutURL": "string",
    "postalAddress": "<postalAddress>",
    "otpTemplateId": {},
    "smsSenderId": 0,
    "emailSenderId": 0,
    "smsSender": {
      "metaData": {}
    },
    "emailSender": {
      "metaData": {}
    },
    "products": [],
    "users": [],
    "members": [],
    "roles": [],
    "subscriptionPlans": [],
    "packages": [],
    "invoices": [],
    "orders": [],
    "paymentProviders": [],
    "newslettersProviderConfig": [],
    "paymentProviderConfigs": [],
    "oidcClients": [],
    "oauthProviders": [],
    "activityLogs": [],
    "m2m_api_clients": [],
    "customProperties": [],
    "consents": [],
    "preference": {
      "inputFieldConfig": [],
      "customFieldsOnMemberCard": [],
      "customFieldsOnInvoice": [],
      "visibleAdditionalFieldsOnMypage": [],
      "metaData": {}
    },
    "settings": {
      "aiResidency": {},
      "metaData": {}
    },
    "communicationTemplates": [],
    "additionalHostnames": [],
    "exportHistory": [],
    "arReportHistory": [],
    "mypageCardsSettings": [],
    "webhooks": [],
    "customOrders": [],
    "customOrderSources": [],
    "brandKits": [],
    "communicationReceivers": [],
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "tenantId": 0,
  "memberId": "string",
  "member": {
    "userId": 0,
    "memberNumber": 0,
    "tenantId": 0,
    "externalId": "string",
    "fullName": "<fullName>",
    "nickName": "string",
    "avatar": "string",
    "email": "string",
    "birthDate": "<birthDate>",
    "phone": "<phone>",
    "isCompany": true,
    "companyName": "string",
    "organizationNo": "string",
    "deleteAfterExpiration": true,
    "customPropertyValues": {},
    "productRecipients": [],
    "id": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "topics": [
    "string"
  ],
  "id": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "deletedAt": "2019-08-24T14:15:22Z",
  "metaData": {}
}
```

<a id="delete-api-v1-app-push-subscribe"></a>
## Unsubscribe from push notifications from app

`DELETE /api/v1/app-push/subscribe`

**Authentication:** Bearer token (JWT)

### Request body

Content type: `application/json` · Required · `UnsubscribeFromPushRequestDto`

| Name | Type | Description |
| --- | --- | --- |
| `token` (Required) | `string` |   |
| `provider` (Required) | `string` | Allowed values: `"fcm"` |

**Example request body**

`application/json`

```json
{
  "token": "<token>",
  "provider": "fcm"
}
```

### Responses

#### 200

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl https://api.subrite.no/api/v1/app-push/subscribe \
  --request DELETE \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "token": "<token>",
  "provider": "fcm"
}'
```

<a id="put-api-v1-app-push-linksubscriber"></a>
## Link subscriber to member

`PUT /api/v1/app-push/linksubscriber`

**Authentication:** Bearer token (JWT)

### Request body

Content type: `application/json` · Required · `LinkSubscriberToMemberRequestDto`

| Name | Type | Description |
| --- | --- | --- |
| `token` (Required) | `string` |   |
| `provider` (Required) | `string` | Allowed values: `"fcm"` |

**Example request body**

`application/json`

```json
{
  "token": "<token>",
  "provider": "fcm"
}
```

### Responses

#### 200

#### 401

Content type: `application/json` · `ErrorResponse`

unauthorized

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl https://api.subrite.no/api/v1/app-push/linksubscriber \
  --request PUT \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "token": "<token>",
  "provider": "fcm"
}'
```

<a id="put-api-v1-app-push-open"></a>
## Track opening of message

`PUT /api/v1/app-push/open`

**Authentication:** Bearer token (JWT)

### Request body

Content type: `application/json` · Required · `TrackOpenMessageRequestDto`

| Name | Type | Description |
| --- | --- | --- |
| `itemKey` (Required) | `string` |   |

**Example request body**

`application/json`

```json
{
  "itemKey": "<itemKey>"
}
```

### Responses

#### 200

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl https://api.subrite.no/api/v1/app-push/open \
  --request PUT \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "itemKey": "<itemKey>"
}'
```

<a id="post-api-v1-app-push-pushcontent"></a>
## Trigger dispatch of new push notification

`POST /api/v1/app-push/pushcontent`

**Authentication:** Bearer token (JWT)

### Request body

Content type: `application/json` · Required · `PushContentRequestDto`

| Name | Type | Description |
| --- | --- | --- |
| `title` (Required) | `string` |   |
| `body` (Required) | `string` |   |
| `topic` | `string` |   |
| `topics` | `array of string` |   |

**Example request body**

`application/json`

```json
{
  "title": "string",
  "body": "string",
  "topic": "string",
  "topics": [
    "string"
  ]
}
```

### Responses

#### 201

Content type: `application/json` · `PushContent`

| Name | Type | Description |
| --- | --- | --- |
| `title` (Required) | `string` |   |
| `body` (Required) | `string` |   |
| `data` (Required) | `object` |   |
| `tenantId` (Required) | `number` |   |
| `segmentId` (Required) | `number` |   |
| `status` (Required) | `string` | Allowed values: `"draft"`, `"scheduled"`, `"created"`, `"queuing"`, `"queued"`, `"failed"`, `"skipped"`, `"dispatching"`, `"dispatched"` |
| `scheduledAt` (Required) | `string (date-time)` |   |
| `topics` (Required) | `array of string` |   |
| `tenant` (Required) | `Tenant` |   |
| `tenant.market` (Required) | `string` | Operating market of the tenant (immutable post-install). · Allowed values: `"NO"`, `"SE"`, `"DK"` |
| `tenant.productName` | `string` | The product name of the tenant · Allowed values: `"enterprise"`, `"communication"`, `"custom"` |
| `tenant.additionalFeatures` | `array of string` | The additional features of the tenant · Allowed values: `"email"`, `"sms"`, `"push"`, `"podcasts"`, `"subscription"`, `"insights"`, `"dashboard"`, `"automation"`, `"export"`, `"accounting"`, `"invoices"`, `"ai"` |
| `tenant.disabledFeatures` | `array of string` | The disabled features of the tenant · Allowed values: `"email"`, `"sms"`, `"push"`, `"podcasts"`, `"subscription"`, `"insights"`, `"dashboard"`, `"automation"`, `"export"`, `"accounting"`, `"invoices"`, `"ai"` |
| `tenant.name` (Required) | `string` |   |
| `tenant.isActive` (Required) | `boolean` |   |
| `tenant.defaultLanguage` (Required) | `string` | Allowed values: `"en"`, `"no"`, `"sv"`, `"da"` |
| `tenant.hostName` (Required) | `string` |   |
| `tenant.logo` (Required) | `string` |   |
| `tenant.favicon` (Required) | `string` |   |
| `tenant.authLogo` (Required) | `string` |   |
| `tenant.authLogoHeight` (Required) | `number` |   |
| `tenant.siteUrl` (Required) | `string` |   |
| `tenant.termsUrl` (Required) | `string` |   |
| `tenant.privacyUrl` (Required) | `string` |   |
| `tenant.gtm` (Required) | `string` |   |
| `tenant.taxRates` | `array of number` |   |
| `tenant.smsOtp` (Required) | `boolean` |   |
| `tenant.emailProvider` (Required) | `string` | Allowed values: `"brevo"`, `"sendgrid"` |
| `tenant.tenantContact` (Required) | `string` |   |
| `tenant.registeredBusinessNo` (Required) | `string` |   |
| `tenant.bankAccountNo` (Required) | `string` |   |
| `tenant.swiftCode` (Required) | `string` |   |
| `tenant.iban` (Required) | `string` |   |
| `tenant.defaultLogoutURL` (Required) | `string` |   |
| `tenant.postalAddress` (Required) | `string` |   |
| `tenant.otpTemplateId` | `Translation` | Nested fields omitted: field limit. |
| `tenant.smsSenderId` (Required) | `number` |   |
| `tenant.emailSenderId` (Required) | `number` |   |
| `tenant.smsSender` (Required) | `CommunicationSender` | Nested fields omitted: field limit. |
| `tenant.emailSender` (Required) | `CommunicationSender` | Nested fields omitted: field limit. |
| `tenant.products` (Required) | `array of Product` | Nested fields omitted: field limit. |
| `tenant.users` (Required) | `array of User` | Nested fields omitted: field limit. |
| `tenant.members` (Required) | `array of Member` | Nested fields omitted: field limit. |
| `tenant.roles` (Required) | `array of Role` | Nested fields omitted: field limit. |
| `tenant.subscriptionPlans` (Required) | `array of SubscriptionPlan` | Nested fields omitted: field limit. |
| `tenant.packages` (Required) | `array of Package` | Nested fields omitted: field limit. |
| `tenant.invoices` (Required) | `array of Invoice` | Nested fields omitted: field limit. |
| `tenant.orders` (Required) | `array of Order` | Nested fields omitted: field limit. |
| `tenant.paymentProviders` (Required) | `array of PaymentProviderConfig` | Nested fields omitted: field limit. |
| `tenant.newslettersProviderConfig` (Required) | `array of NewsletterProviderConfig` | Nested fields omitted: field limit. |
| `tenant.paymentProviderConfigs` (Required) | `array of PaymentProviderConfig` | Nested fields omitted: field limit. |
| `tenant.oidcClients` (Required) | `array of OidcClient` | Nested fields omitted: field limit. |
| `tenant.oauthProviders` (Required) | `array of OauthProvider` | Nested fields omitted: field limit. |
| `tenant.activityLogs` (Required) | `array of ActivityLog` | Nested fields omitted: field limit. |
| `tenant.m2m_api_clients` (Required) | `array of M2MApiClient` | Nested fields omitted: field limit. |
| `tenant.customProperties` (Required) | `array of CustomProperty` | Nested fields omitted: field limit. |
| `tenant.consents` (Required) | `array of Consent` | Nested fields omitted: field limit. |
| `tenant.preference` (Required) | `Preference` | Nested fields omitted: field limit. |
| `tenant.settings` (Required) | `TenantSettings` | Nested fields omitted: field limit. |
| `tenant.communicationTemplates` (Required) | `array of CommunicationTemplate` | Nested fields omitted: field limit. |
| `tenant.additionalHostnames` (Required) | `array of TenantHostname` | Nested fields omitted: field limit. |
| `tenant.exportHistory` (Required) | `array of ExportHistory` | Nested fields omitted: field limit. |
| `tenant.arReportHistory` (Required) | `array of ArReportHistory` | Nested fields omitted: field limit. |
| `tenant.mypageCardsSettings` (Required) | `array of MypageCardsSettings` | Nested fields omitted: field limit. |
| `tenant.webhooks` (Required) | `array of Webhook` | Nested fields omitted: field limit. |
| `tenant.customOrders` (Required) | `array of CustomOrder` | Nested fields omitted: field limit. |
| `tenant.customOrderSources` (Required) | `array of CustomOrderSource` | Nested fields omitted: field limit. |
| `tenant.brandKits` (Required) | `array of BrandKit` | Nested fields omitted: field limit. |
| `tenant.communicationReceivers` (Required) | `array of CommunicationReceiver` | Nested fields omitted: field limit. |
| `tenant.id` (Required) | `number` |   |
| `tenant.createdAt` (Required) | `string (date-time)` |   |
| `tenant.updatedAt` (Required) | `string (date-time)` |   |
| `tenant.deletedAt` (Required) | `string (date-time)` |   |
| `tenant.metaData` (Required) | `object` |   |
| `segment` (Required) | `Segment` | Nested fields omitted: field limit. |
| `id` (Required) | `number` |   |
| `createdAt` (Required) | `string (date-time)` |   |
| `updatedAt` (Required) | `string (date-time)` |   |
| `deletedAt` (Required) | `string (date-time)` |   |
| `metaData` (Required) | `object` |   |

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl https://api.subrite.no/api/v1/app-push/pushcontent \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "title": "string",
  "body": "string",
  "topic": "string",
  "topics": [
    "string"
  ]
}'
```

### Example response

201 · `application/json`

```json
{
  "title": "string",
  "body": "string",
  "data": {},
  "tenantId": 0,
  "segmentId": 0,
  "status": "draft",
  "scheduledAt": "2019-08-24T14:15:22Z",
  "topics": [
    "string"
  ],
  "tenant": {
    "market": "NO",
    "productName": "enterprise",
    "additionalFeatures": [],
    "disabledFeatures": [],
    "name": "string",
    "isActive": true,
    "defaultLanguage": "en",
    "hostName": "string",
    "logo": "string",
    "favicon": "string",
    "authLogo": "string",
    "authLogoHeight": 0,
    "siteUrl": "string",
    "termsUrl": "string",
    "privacyUrl": "string",
    "gtm": "string",
    "taxRates": [],
    "smsOtp": true,
    "emailProvider": "brevo",
    "tenantContact": "string",
    "registeredBusinessNo": "string",
    "bankAccountNo": "string",
    "swiftCode": "string",
    "iban": "<iban>",
    "defaultLogoutURL": "string",
    "postalAddress": "<postalAddress>",
    "otpTemplateId": {},
    "smsSenderId": 0,
    "emailSenderId": 0,
    "smsSender": {
      "metaData": {}
    },
    "emailSender": {
      "metaData": {}
    },
    "products": [],
    "users": [],
    "members": [],
    "roles": [],
    "subscriptionPlans": [],
    "packages": [],
    "invoices": [],
    "orders": [],
    "paymentProviders": [],
    "newslettersProviderConfig": [],
    "paymentProviderConfigs": [],
    "oidcClients": [],
    "oauthProviders": [],
    "activityLogs": [],
    "m2m_api_clients": [],
    "customProperties": [],
    "consents": [],
    "preference": {
      "inputFieldConfig": [],
      "customFieldsOnMemberCard": [],
      "customFieldsOnInvoice": [],
      "visibleAdditionalFieldsOnMypage": [],
      "metaData": {}
    },
    "settings": {
      "aiResidency": {},
      "metaData": {}
    },
    "communicationTemplates": [],
    "additionalHostnames": [],
    "exportHistory": [],
    "arReportHistory": [],
    "mypageCardsSettings": [],
    "webhooks": [],
    "customOrders": [],
    "customOrderSources": [],
    "brandKits": [],
    "communicationReceivers": [],
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "segment": {
    "name": "string",
    "description": "string",
    "query": {
      "rules": []
    },
    "type": "static",
    "status": "draft",
    "adminUserId": 0,
    "adminUser": {
      "userRoles": [],
      "notes": [],
      "exportHistory": [],
      "userAccounts": [],
      "userSessions": [],
      "metaData": {}
    },
    "tenantId": 0,
    "tenant": {
      "additionalFeatures": [],
      "disabledFeatures": [],
      "taxRates": [],
      "products": [],
      "users": [],
      "members": [],
      "roles": [],
      "subscriptionPlans": [],
      "packages": [],
      "invoices": [],
      "orders": [],
      "paymentProviders": [],
      "newslettersProviderConfig": [],
      "paymentProviderConfigs": [],
      "oidcClients": [],
      "oauthProviders": [],
      "activityLogs": [],
      "m2m_api_clients": [],
      "customProperties": [],
      "consents": [],
      "communicationTemplates": [],
      "additionalHostnames": [],
      "exportHistory": [],
      "arReportHistory": [],
      "mypageCardsSettings": [],
      "webhooks": [],
      "customOrders": [],
      "customOrderSources": [],
      "brandKits": [],
      "communicationReceivers": [],
      "metaData": {}
    },
    "segmentMembers": [],
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "id": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "deletedAt": "2019-08-24T14:15:22Z",
  "metaData": {}
}
```

<a id="get-api-v1-app-push-pushcampaign"></a>
## Get all push campaigns

`GET /api/v1/app-push/pushcampaign`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `page` | query | `number` | Default: `1` · `minimum`: `1` |
| `take` | query | `number` | Default: `10` · `minimum`: `1`, `maximum`: `50` |
| `orderBy` | query | `string` | Allowed values: `"createdAt"`, `"id"`, `"updatedAt"` · Default: `"createdAt"` |
| `orderDirection` | query | `string` | Allowed values: `"asc"`, `"desc"` · Default: `"desc"` |

### Responses

#### 200

Content type: `application/json` · `PushCampaignResponseDtoPaginated`

| Name | Type | Description |
| --- | --- | --- |
| `items` (Required) | `array of PushCampaignResponseDto` |   |
| `items[].data` (Required when parent is present) | `object` | The data to be sent with the push notification |
| `items[].id` (Required when parent is present) | `number` |   |
| `items[].createdAt` (Required when parent is present) | `string (date-time)` |   |
| `items[].updatedAt` (Required when parent is present) | `string (date-time)` |   |
| `items[].title` (Required when parent is present) | `string` |   |
| `items[].body` (Required when parent is present) | `string` |   |
| `items[].tenantId` (Required when parent is present) | `number` |   |
| `items[].status` (Required when parent is present) | `string` | Allowed values: `"draft"`, `"scheduled"`, `"created"`, `"queuing"`, `"queued"`, `"failed"`, `"skipped"`, `"dispatching"`, `"dispatched"` |
| `items[].topics` (Required when parent is present) | `array of string` |   |
| `items[].segmentId` (Required when parent is present) | `number` |   |
| `items[].scheduledAt` (Required when parent is present) | `string (date-time)` |   |
| `meta` (Required) | `PageMeta` |   |
| `meta.page` (Required) | `number` |   |
| `meta.take` (Required) | `number` |   |
| `meta.count` (Required) | `number` |   |
| `meta.pageCount` (Required) | `number` |   |
| `meta.hasPreviousPage` (Required) | `boolean` |   |
| `meta.hasNextPage` (Required) | `boolean` |   |

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl https://api.subrite.no/api/v1/app-push/pushcampaign \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "items": [
    {
      "data": {},
      "topics": []
    }
  ],
  "meta": {
    "page": 0,
    "take": 0,
    "count": 0,
    "pageCount": 0,
    "hasPreviousPage": true,
    "hasNextPage": true
  }
}
```

<a id="post-api-v1-app-push-pushcampaign"></a>
## Save new push notification campaign draft

`POST /api/v1/app-push/pushcampaign`

**Authentication:** Bearer token (JWT)

### Request body

Content type: `application/json` · Required · `CreatePushCampaignDto`

| Name | Type | Description |
| --- | --- | --- |
| `title` (Required) | `string` | The title of the push notification · `minLength`: `1`, `maxLength`: `65` |
| `body` (Required) | `string` | The body of the push notification · `minLength`: `1`, `maxLength`: `240` |
| `data` (Required) | `object` | The data to be sent with the push notification |
| `topics` | `array of string` | The topics to send the push campaign to |
| `segmentId` | `number` | The ID of the segment to send the push campaign to |

**Example request body**

`application/json`

```json
{
  "title": "This is the title of the push notification",
  "body": "This is the body of the push notification",
  "data": {
    "key": "value"
  },
  "topics": [
    "topic1",
    "topic2"
  ],
  "segmentId": 1
}
```

### Responses

#### 201

Content type: `application/json` · `PushCampaignResponseDto`

| Name | Type | Description |
| --- | --- | --- |
| `data` (Required) | `object` | The data to be sent with the push notification |
| `id` (Required) | `number` |   |
| `createdAt` (Required) | `string (date-time)` |   |
| `updatedAt` (Required) | `string (date-time)` |   |
| `title` (Required) | `string` |   |
| `body` (Required) | `string` |   |
| `tenantId` (Required) | `number` |   |
| `status` (Required) | `string` | Allowed values: `"draft"`, `"scheduled"`, `"created"`, `"queuing"`, `"queued"`, `"failed"`, `"skipped"`, `"dispatching"`, `"dispatched"` |
| `topics` (Required) | `array of string` |   |
| `segmentId` (Required) | `number` |   |
| `scheduledAt` (Required) | `string (date-time)` |   |

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl https://api.subrite.no/api/v1/app-push/pushcampaign \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "title": "This is the title of the push notification",
  "body": "This is the body of the push notification",
  "data": {
    "key": "value"
  },
  "topics": [
    "topic1",
    "topic2"
  ],
  "segmentId": 1
}'
```

### Example response

201 · `application/json`

```json
{
  "data": {
    "key": "value"
  },
  "id": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "title": "string",
  "body": "string",
  "tenantId": 0,
  "status": "draft",
  "topics": [
    "string"
  ],
  "segmentId": 0,
  "scheduledAt": "2019-08-24T14:15:22Z"
}
```

<a id="get-api-v1-app-push-pushcampaign-id"></a>
## Get push campaign

`GET /api/v1/app-push/pushcampaign/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Responses

#### 200

Content type: `application/json` · `PushCampaignResponseDto`

Same fields as [Save new push notification campaign draft (201)](https://www.subrite.no/developers/push-notifications-2?md=true#post-api-v1-app-push-pushcampaign).

#### 400

Content type: `application/json` · `ErrorResponse`

badRequest

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"badRequest"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/app-push/pushcampaign/{id}' \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "data": {
    "key": "value"
  },
  "id": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "title": "string",
  "body": "string",
  "tenantId": 0,
  "status": "draft",
  "topics": [
    "string"
  ],
  "segmentId": 0,
  "scheduledAt": "2019-08-24T14:15:22Z"
}
```

<a id="delete-api-v1-app-push-pushcampaign-id"></a>
## Delete push campaign

`DELETE /api/v1/app-push/pushcampaign/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Responses

#### 200

Content type: `application/json` · `PushCampaignResponseDto`

Same fields as [Save new push notification campaign draft (201)](https://www.subrite.no/developers/push-notifications-2?md=true#post-api-v1-app-push-pushcampaign).

#### 400

Content type: `application/json` · `ErrorResponse`

badRequest

Same fields as [Get push campaign (400)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-pushcampaign-id).

**Example response**

`application/json`

```json
{
  "messageCode": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/app-push/pushcampaign/{id}' \
  --request DELETE \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "data": {
    "key": "value"
  },
  "id": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "title": "string",
  "body": "string",
  "tenantId": 0,
  "status": "draft",
  "topics": [
    "string"
  ],
  "segmentId": 0,
  "scheduledAt": "2019-08-24T14:15:22Z"
}
```

<a id="patch-api-v1-app-push-pushcampaign-id"></a>
## Update push campaign

`PATCH /api/v1/app-push/pushcampaign/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Request body

Content type: `application/json` · Required · `PushCampaignDraftUpdateDto`

| Name | Type | Description |
| --- | --- | --- |
| `title` | `string` | The title of the push notification · `minLength`: `1`, `maxLength`: `65` |
| `body` | `string` | The body of the push notification · `minLength`: `1`, `maxLength`: `240` |
| `data` (Required) | `object` | The data to be sent with the push notification |
| `topics` | `array of string` | The topics to send the push campaign to · Can be null |
| `segmentId` | `number` | The ID of the segment to send the push campaign to · Can be null |

**Example request body**

`application/json`

```json
{
  "title": "This is the title of the push notification",
  "body": "This is the body of the push notification",
  "data": {
    "key": "value"
  },
  "topics": [
    "topic1",
    "topic2"
  ],
  "segmentId": 1
}
```

### Responses

#### 200

Content type: `application/json` · `PushCampaignResponseDto`

Same fields as [Save new push notification campaign draft (201)](https://www.subrite.no/developers/push-notifications-2?md=true#post-api-v1-app-push-pushcampaign).

#### 400

Content type: `application/json` · `ErrorResponse`

badRequest

Same fields as [Get push campaign (400)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-pushcampaign-id).

**Example response**

`application/json`

```json
{
  "messageCode": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/app-push/pushcampaign/{id}' \
  --request PATCH \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "title": "This is the title of the push notification",
  "body": "This is the body of the push notification",
  "data": {
    "key": "value"
  },
  "topics": [
    "topic1",
    "topic2"
  ],
  "segmentId": 1
}'
```

### Example response

200 · `application/json`

```json
{
  "data": {
    "key": "value"
  },
  "id": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "title": "string",
  "body": "string",
  "tenantId": 0,
  "status": "draft",
  "topics": [
    "string"
  ],
  "segmentId": 0,
  "scheduledAt": "2019-08-24T14:15:22Z"
}
```

<a id="post-api-v1-app-push-pushcampaign-id-send"></a>
## Send push campaign

`POST /api/v1/app-push/pushcampaign/{id}/send`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Responses

#### 201

Content type: `application/json` · `PushCampaignResponseDto`

Same fields as [Save new push notification campaign draft (201)](https://www.subrite.no/developers/push-notifications-2?md=true#post-api-v1-app-push-pushcampaign).

#### 400

Content type: `application/json` · `ErrorResponse`

badRequest

Same fields as [Get push campaign (400)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-pushcampaign-id).

**Example response**

`application/json`

```json
{
  "messageCode": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/app-push/pushcampaign/{id}/send' \
  --request POST \
  --header 'Authorization: Bearer <token>'
```

### Example response

201 · `application/json`

```json
{
  "data": {
    "key": "value"
  },
  "id": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "title": "string",
  "body": "string",
  "tenantId": 0,
  "status": "draft",
  "topics": [
    "string"
  ],
  "segmentId": 0,
  "scheduledAt": "2019-08-24T14:15:22Z"
}
```

<a id="post-api-v1-app-push-pushcampaign-id-schedule"></a>
## Schedule push campaign

`POST /api/v1/app-push/pushcampaign/{id}/schedule`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Request body

Content type: `application/json` · Required · `SchedulePushCampaignDto`

| Name | Type | Description |
| --- | --- | --- |
| `title` | `string` | The title of the push notification · `minLength`: `1`, `maxLength`: `65` |
| `body` | `string` | The body of the push notification · `minLength`: `1`, `maxLength`: `240` |
| `data` (Required) | `object` | The data to be sent with the push notification |
| `topics` | `array of string` | The topics to send the push campaign to · Can be null |
| `segmentId` | `number` | The ID of the segment to send the push campaign to · Can be null |
| `scheduledAt` (Required) | `string (date-time)` |   |

**Example request body**

`application/json`

```json
{
  "title": "This is the title of the push notification",
  "body": "This is the body of the push notification",
  "data": {
    "key": "value"
  },
  "topics": [
    "topic1",
    "topic2"
  ],
  "segmentId": 1,
  "scheduledAt": "2019-08-24T14:15:22Z"
}
```

### Responses

#### 201

Content type: `application/json` · `PushCampaignResponseDto`

Same fields as [Save new push notification campaign draft (201)](https://www.subrite.no/developers/push-notifications-2?md=true#post-api-v1-app-push-pushcampaign).

#### 400

Content type: `application/json` · `ErrorResponse`

badRequest

Same fields as [Get push campaign (400)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-pushcampaign-id).

**Example response**

`application/json`

```json
{
  "messageCode": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/app-push/pushcampaign/{id}/schedule' \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "title": "This is the title of the push notification",
  "body": "This is the body of the push notification",
  "data": {
    "key": "value"
  },
  "topics": [
    "topic1",
    "topic2"
  ],
  "segmentId": 1,
  "scheduledAt": "2019-08-24T14:15:22Z"
}'
```

### Example response

201 · `application/json`

```json
{
  "data": {
    "key": "value"
  },
  "id": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "title": "string",
  "body": "string",
  "tenantId": 0,
  "status": "draft",
  "topics": [
    "string"
  ],
  "segmentId": 0,
  "scheduledAt": "2019-08-24T14:15:22Z"
}
```

<a id="post-api-v1-app-push-pushcampaign-id-cancel"></a>
## Cancel push campaign

`POST /api/v1/app-push/pushcampaign/{id}/cancel`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Responses

#### 201

Content type: `application/json` · `PushCampaignResponseDto`

Same fields as [Save new push notification campaign draft (201)](https://www.subrite.no/developers/push-notifications-2?md=true#post-api-v1-app-push-pushcampaign).

#### 400

Content type: `application/json` · `ErrorResponse`

badRequest

Same fields as [Get push campaign (400)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-pushcampaign-id).

**Example response**

`application/json`

```json
{
  "messageCode": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/app-push/pushcampaign/{id}/cancel' \
  --request POST \
  --header 'Authorization: Bearer <token>'
```

### Example response

201 · `application/json`

```json
{
  "data": {
    "key": "value"
  },
  "id": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "title": "string",
  "body": "string",
  "tenantId": 0,
  "status": "draft",
  "topics": [
    "string"
  ],
  "segmentId": 0,
  "scheduledAt": "2019-08-24T14:15:22Z"
}
```

<a id="get-api-v1-app-push-pushcampaign-id-receivers"></a>
## Get receivers for push campaign

`GET /api/v1/app-push/pushcampaign/{id}/receivers`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |
| `page` | query | `number` | Default: `1` · `minimum`: `1` |
| `take` | query | `number` | Default: `10` · `minimum`: `1`, `maximum`: `50` |
| `orderBy` | query | `string` | Allowed values: `"createdAt"`, `"id"`, `"updatedAt"` · Default: `"createdAt"` |
| `orderDirection` | query | `string` | Allowed values: `"asc"`, `"desc"` · Default: `"desc"` |

### Responses

#### 200

Content type: `application/json` · `PushSubscriberResponseDtoPaginated`

| Name | Type | Description |
| --- | --- | --- |
| `items` (Required) | `array of PushSubscriberResponseDto` |   |
| `items[].id` (Required when parent is present) | `number` | The ID of the push subscriber |
| `items[].createdAt` (Required when parent is present) | `string (date-time)` | The created at of the push subscriber |
| `items[].updatedAt` (Required when parent is present) | `string (date-time)` | The updated at of the push subscriber |
| `items[].metaData` (Required when parent is present) | `object` | The meta data of the push subscriber |
| `items[].provider` (Required when parent is present) | `string` | The provider of the push subscriber · Allowed values: `"fcm"` |
| `items[].memberId` (Required when parent is present) | `string` | The member id of the push subscriber |
| `items[].topics` (Required when parent is present) | `array of string` | The topics of the push subscriber |
| `items[].fullName` (Required when parent is present) | `string` | The first name of the member · Can be null |
| `items[].email` (Required when parent is present) | `string` | The email of the member · Can be null |
| `items[].status` (Required when parent is present) | `string` | Allowed values: `"queued"`, `"dispatching"`, `"dispatched"`, `"failed"` · Can be null |
| `items[].sentAt` (Required when parent is present) | `string (date-time)` | Can be null |
| `items[].openedAt` (Required when parent is present) | `string (date-time)` | Can be null |
| `meta` (Required) | `PageMeta` |   |
| `meta.page` (Required) | `number` |   |
| `meta.take` (Required) | `number` |   |
| `meta.count` (Required) | `number` |   |
| `meta.pageCount` (Required) | `number` |   |
| `meta.hasPreviousPage` (Required) | `boolean` |   |
| `meta.hasNextPage` (Required) | `boolean` |   |

#### 400

Content type: `application/json` · `ErrorResponse`

badRequest

Same fields as [Get push campaign (400)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-pushcampaign-id).

**Example response**

`application/json`

```json
{
  "messageCode": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/app-push/pushcampaign/{id}/receivers' \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "items": [
    {
      "metaData": {},
      "topics": []
    }
  ],
  "meta": {
    "page": 0,
    "take": 0,
    "count": 0,
    "pageCount": 0,
    "hasPreviousPage": true,
    "hasNextPage": true
  }
}
```

<a id="post-api-v1-app-push-pushcampaign-id-test"></a>
## Send test push

`POST /api/v1/app-push/pushcampaign/{id}/test`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Responses

#### 201

Content type: `application/json` · `SendTestPushResponse`

| Name | Type | Description |
| --- | --- | --- |
| `success` (Required) | `boolean` |   |
| `error` | `string` |   |
| `invalidToken` | `boolean` |   |

#### 400

Content type: `application/json` · `ErrorResponse`

badRequest

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

#### 404

Content type: `application/json` · `ErrorResponse`

notFound

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/app-push/pushcampaign/{id}/test' \
  --request POST \
  --header 'Authorization: Bearer <token>'
```

### Example response

201 · `application/json`

```json
{
  "success": true,
  "error": "string",
  "invalidToken": true
}
```

<a id="get-api-v1-app-push-pushcampaign-id-stats"></a>
## Get push campaign stats

`GET /api/v1/app-push/pushcampaign/{id}/stats`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Responses

#### 200

Content type: `application/json` · `PushStats`

| Name | Type | Description |
| --- | --- | --- |
| `total` (Required) | `number` |   |
| `sending` (Required) | `number` |   |
| `sent` (Required) | `number` |   |
| `failed` (Required) | `number` |   |
| `opened` (Required) | `number` |   |

#### 400

Content type: `application/json` · `ErrorResponse`

badRequest

Same fields as [Get push campaign (400)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-pushcampaign-id).

**Example response**

`application/json`

```json
{
  "messageCode": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get push notifications setup (403)](https://www.subrite.no/developers/push-notifications-2?md=true#get-api-v1-app-push-setup).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/app-push/pushcampaign/{id}/stats' \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "total": 0,
  "sending": 0,
  "sent": 0,
  "failed": 0,
  "opened": 0
}
```
