# Newsletter

**Summary:** Endpoints for Newsletter

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

<a id="get-api-v1-newsletters-providers"></a>
## Get all integrated providers

`GET /api/v1/newsletters/providers`

**Authentication:** Bearer token (JWT)

### Responses

#### 200

Content type: `application/json` · `array of object`

#### 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": [
    {}
  ]
}
```

#### 500

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

internalServerError

Same fields as [Get all integrated providers (403)](https://www.subrite.no/developers/newsletter?md=true#get-api-v1-newsletters-providers).

### Example request

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

### Example response

200 · `application/json`

```json
[
  {}
]
```

<a id="post-api-v1-newsletters-lists"></a>
## Get all newsletter by api key

`POST /api/v1/newsletters/lists`

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `provider` (Required) | `NewsletterProvider` | Allowed values: `"mailchimp"`, `"make"`, `"mailmojo"` |
| `apiKey` (Required) | `string` |   |
| `userName` (Required) | `string` |   |
| `password` (Required) | `string` |   |
| `integrationId` | `string` |   |

**Example request body**

`application/json`

```json
{
  "provider": "mailchimp",
  "apiKey": "<apiKey>",
  "userName": "<userName>",
  "password": "<password>",
  "integrationId": "string"
}
```

### Responses

#### 201

Content type: `application/json` · `array of NewsletterListsResponseDto`

| Name | Type | Description |
| --- | --- | --- |
| `[].id` (Required when parent is present) | `string` |   |
| `[].name` (Required when parent is present) | `string` |   |

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get all integrated providers (403)](https://www.subrite.no/developers/newsletter?md=true#get-api-v1-newsletters-providers).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get all integrated providers (403)](https://www.subrite.no/developers/newsletter?md=true#get-api-v1-newsletters-providers).

### Example request

```bash
curl https://api.subrite.no/api/v1/newsletters/lists \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "provider": "mailchimp",
  "apiKey": "<apiKey>",
  "userName": "<userName>",
  "password": "<password>",
  "integrationId": "string"
}'
```

### Example response

201 · `application/json`

```json
[
  {
    "id": "string",
    "name": "string"
  }
]
```

<a id="post-api-v1-newsletters"></a>
## Add a new newsletter provider

`POST /api/v1/newsletters`

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `name` (Required) | `string` |   |
| `provider` (Required) | `string` | Allowed values: `"mailchimp"`, `"make"`, `"mailmojo"` |
| `config` | `NewsletterConfig` |   |
| `config.id` (Required when parent is present) | `string` |   |
| `config.name` (Required when parent is present) | `string` |   |
| `config.listName` | `string` |   |
| `config.webhookSecret` (Required when parent is present) | `string` |   |
| `config.apiKey` (Required when parent is present) | `string` |   |
| `config.userName` (Required when parent is present) | `string` |   |
| `config.password` (Required when parent is present) | `string` |   |
| `config.accessToken` (Required when parent is present) | `string` |   |
| `config.refreshToken` (Required when parent is present) | `string` |   |
| `config.integrationId` (Required when parent is present) | `string` |   |

**Example request body**

`application/json`

```json
{
  "name": "string",
  "provider": "mailchimp",
  "config": {
    "id": "string",
    "name": "string",
    "listName": "string",
    "webhookSecret": "<webhookSecret>",
    "apiKey": "<apiKey>",
    "userName": "<userName>",
    "password": "<password>",
    "accessToken": "<accessToken>",
    "refreshToken": "<refreshToken>",
    "integrationId": "string"
  }
}
```

### Responses

#### 201

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

| Name | Type | Description |
| --- | --- | --- |
| `provider` (Required) | `string` | Allowed values: `"mailchimp"`, `"make"`, `"mailmojo"` |
| `name` (Required) | `string` |   |
| `tenantId` (Required) | `number` |   |
| `config` (Required) | `NewsletterConfig` |   |
| `config.id` (Required) | `string` |   |
| `config.name` (Required) | `string` |   |
| `config.listName` | `string` |   |
| `config.webhookSecret` (Required) | `string` |   |
| `config.apiKey` (Required) | `string` |   |
| `config.userName` (Required) | `string` |   |
| `config.password` (Required) | `string` |   |
| `config.accessToken` (Required) | `string` |   |
| `config.refreshToken` (Required) | `string` |   |
| `config.integrationId` (Required) | `string` |   |
| `tenant` (Required) | `Tenant` | Nested fields omitted: field limit. |
| `consents` (Required) | `array of Consent` |   |
| `consents[].integrationId` (Required when parent is present) | `string` |   |
| `consents[].title` (Required when parent is present) | `string` |   |
| `consents[].description` (Required when parent is present) | `string` |   |
| `consents[].image` (Required when parent is present) | `string` |   |
| `consents[].showOnCheckoutPage` (Required when parent is present) | `boolean` |   |
| `consents[].showOnMyPage` (Required when parent is present) | `boolean` |   |
| `consents[].status` (Required when parent is present) | `boolean` |   |
| `consents[].purpose` (Required when parent is present) | `string` | Allowed values: `"marketing_and_newsletter"`, `"consent"` |
| `consents[].frequency` (Required when parent is present) | `string` |   |
| `consents[].defaultSubscribed` (Required when parent is present) | `boolean` |   |
| `consents[].sortOrder` (Required when parent is present) | `number` |   |
| `consents[].visibility` (Required when parent is present) | `string` | Allowed values: `"subscriber"`, `"nonSubscriber"`, `"all"` |
| `consents[].newsletterProviderConfig` (Required when parent is present) | `NewsletterProviderConfig` |   |
| `consents[].newsletterProviderConfig.provider` (Required when parent is present) | `string` | Allowed values: `"mailchimp"`, `"make"`, `"mailmojo"` |
| `consents[].newsletterProviderConfig.name` (Required when parent is present) | `string` |   |
| `consents[].newsletterProviderConfig.tenantId` (Required when parent is present) | `number` |   |
| `consents[].newsletterProviderConfig.config` (Required when parent is present) | `NewsletterConfig` | Nested fields omitted: depth limit. |
| `consents[].newsletterProviderConfig.tenant` (Required when parent is present) | `Tenant` | Nested fields omitted: depth limit. |
| `consents[].newsletterProviderConfig.consents` (Required when parent is present) | `array of Consent` | Recursive schema; nested fields are not repeated. |
| `consents[].newsletterProviderConfig.id` (Required when parent is present) | `number` |   |
| `consents[].newsletterProviderConfig.createdAt` (Required when parent is present) | `string (date-time)` |   |
| `consents[].newsletterProviderConfig.updatedAt` (Required when parent is present) | `string (date-time)` |   |
| `consents[].newsletterProviderConfig.deletedAt` (Required when parent is present) | `string (date-time)` |   |
| `consents[].newsletterProviderConfig.metaData` (Required when parent is present) | `object` |   |
| `consents[].newsletterProviderConfigId` (Required when parent is present) | `number` |   |
| `consents[].tenantId` (Required when parent is present) | `number` |   |
| `consents[].tenant` (Required when parent is present) | `Tenant` | Nested fields omitted: field limit. |
| `consents[].communications` (Required when parent is present) | `array of Communication` | Nested fields omitted: field limit. |
| `consents[].id` (Required when parent is present) | `number` |   |
| `consents[].createdAt` (Required when parent is present) | `string (date-time)` |   |
| `consents[].updatedAt` (Required when parent is present) | `string (date-time)` |   |
| `consents[].deletedAt` (Required when parent is present) | `string (date-time)` |   |
| `consents[].metaData` (Required when parent is present) | `object` |   |
| `id` (Required) | `number` |   |
| `createdAt` (Required) | `string (date-time)` |   |
| `updatedAt` (Required) | `string (date-time)` |   |
| `deletedAt` (Required) | `string (date-time)` |   |
| `metaData` (Required) | `object` |   |

#### 400

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

shouldNotBeEmpty, invalidFormat, alreadyExists

Same fields as [Get all integrated providers (403)](https://www.subrite.no/developers/newsletter?md=true#get-api-v1-newsletters-providers).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get all integrated providers (403)](https://www.subrite.no/developers/newsletter?md=true#get-api-v1-newsletters-providers).

#### 500

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

internalServerError

Same fields as [Get all integrated providers (403)](https://www.subrite.no/developers/newsletter?md=true#get-api-v1-newsletters-providers).

### Example request

```bash
curl https://api.subrite.no/api/v1/newsletters \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "string",
  "provider": "mailchimp",
  "config": {
    "id": "string",
    "name": "string",
    "listName": "string",
    "webhookSecret": "<webhookSecret>",
    "apiKey": "<apiKey>",
    "userName": "<userName>",
    "password": "<password>",
    "accessToken": "<accessToken>",
    "refreshToken": "<refreshToken>",
    "integrationId": "string"
  }
}'
```

### Example response

201 · `application/json`

```json
{
  "provider": "mailchimp",
  "name": "string",
  "tenantId": 0,
  "config": {
    "id": "string",
    "name": "string",
    "listName": "string",
    "webhookSecret": "<webhookSecret>",
    "apiKey": "<apiKey>",
    "userName": "<userName>",
    "password": "<password>",
    "accessToken": "<accessToken>",
    "refreshToken": "<refreshToken>",
    "integrationId": "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": {}
  },
  "consents": [
    {
      "communications": [],
      "metaData": {}
    }
  ],
  "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-newsletters-id"></a>
## Delete a newsletter provider

`DELETE /api/v1/newsletters/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Responses

#### 200

#### 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 all integrated providers (403)](https://www.subrite.no/developers/newsletter?md=true#get-api-v1-newsletters-providers).

**Example response**

`application/json`

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

#### 404

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

notFound

Same fields as [Get all integrated providers (403)](https://www.subrite.no/developers/newsletter?md=true#get-api-v1-newsletters-providers).

#### 500

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

internalServerError

Same fields as [Get all integrated providers (403)](https://www.subrite.no/developers/newsletter?md=true#get-api-v1-newsletters-providers).

### Example request

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