# M2M-Clients

**Summary:** Endpoints for M2M-Clients

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

<a id="get-api-v1-setting-m2m-clients"></a>
## Get all M2m clients of a tenant

`GET /api/v1/setting/m2m-clients`

**Authentication:** Bearer token (JWT)

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `[].scopes` (Required when parent is present) | `array of M2MScopes` |   |
| `[].scopes[].sectionId` (Required when parent is present) | `string` | Allowed values: `"member"`, `"subscription"`, `"consent"`, `"push-subscription"`, `"push-content"`, `"content"`, `"communication"`, `"segment"`, `"custom-order"`, `"widget"`, `"plans_and_products"` |
| `[].scopes[].sectionName` | `string` |   |
| `[].scopes[].readPermission` (Required when parent is present) | `boolean` |   |
| `[].scopes[].updatePermission` (Required when parent is present) | `boolean` |   |
| `[].name` (Required when parent is present) | `string` |   |
| `[].description` (Required when parent is present) | `string` |   |
| `[].isActive` (Required when parent is present) | `boolean` |   |
| `[].id` (Required when parent is present) | `number` |   |
| `[].clientIdentifier` (Required when parent is present) | `string` |   |
| `[].createdAt` (Required when parent is present) | `string (date-time)` |   |
| `[].tokenSuffix` (Required when parent is present) | `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": [
    {}
  ]
}
```

#### 500

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

internalServerError

Same fields as [Get all M2m clients of a tenant (403)](https://www.subrite.no/developers/m2m-clients?md=true#get-api-v1-setting-m2m-clients).

### Example request

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

### Example response

200 · `application/json`

```json
[
  {
    "scopes": [],
    "name": "string",
    "description": "string",
    "isActive": true,
    "id": 0,
    "clientIdentifier": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "tokenSuffix": "string"
  }
]
```

<a id="post-api-v1-setting-m2m-clients"></a>
## Create a new M2M client for a tenant

`POST /api/v1/setting/m2m-clients`

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `name` (Required) | `string` |   |
| `scopes` (Required) | `array of M2MScopes` | `minItems`: `1` |
| `scopes[].sectionId` (Required when parent is present) | `string` | Allowed values: `"member"`, `"subscription"`, `"consent"`, `"push-subscription"`, `"push-content"`, `"content"`, `"communication"`, `"segment"`, `"custom-order"`, `"widget"`, `"plans_and_products"` |
| `scopes[].sectionName` | `string` |   |
| `scopes[].readPermission` (Required when parent is present) | `boolean` |   |
| `scopes[].updatePermission` (Required when parent is present) | `boolean` |   |
| `description` | `string` |   |
| `isActive` | `boolean` | Default: `true` |

### Responses

#### 201

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

| Name | Type | Description |
| --- | --- | --- |
| `scopes` (Required) | `array of M2MScopes` |   |
| `scopes[].sectionId` (Required when parent is present) | `string` | Allowed values: `"member"`, `"subscription"`, `"consent"`, `"push-subscription"`, `"push-content"`, `"content"`, `"communication"`, `"segment"`, `"custom-order"`, `"widget"`, `"plans_and_products"` |
| `scopes[].sectionName` | `string` |   |
| `scopes[].readPermission` (Required when parent is present) | `boolean` |   |
| `scopes[].updatePermission` (Required when parent is present) | `boolean` |   |
| `name` (Required) | `string` |   |
| `description` (Required) | `string` |   |
| `isActive` (Required) | `boolean` |   |
| `id` (Required) | `number` |   |
| `clientIdentifier` (Required) | `string` |   |
| `createdAt` (Required) | `string (date-time)` |   |
| `tokenSuffix` (Required) | `string` |   |
| `token` (Required) | `string` |   |

#### 400

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

Body validation failed, or the tenant already has a client with this name

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"badRequest"`, `"alreadyExists"` |
| `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 M2m clients of a tenant (403)](https://www.subrite.no/developers/m2m-clients?md=true#get-api-v1-setting-m2m-clients).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get all M2m clients of a tenant (403)](https://www.subrite.no/developers/m2m-clients?md=true#get-api-v1-setting-m2m-clients).

### Example request

```bash
curl https://api.subrite.no/api/v1/setting/m2m-clients \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "string",
  "scopes": [
    {}
  ],
  "description": "string",
  "isActive": true
}'
```

### Example response

201 · `application/json`

```json
{
  "scopes": [
    {}
  ],
  "name": "string",
  "description": "string",
  "isActive": true,
  "id": 0,
  "clientIdentifier": "string",
  "createdAt": "2019-08-24T14:15:22Z",
  "tokenSuffix": "string",
  "token": "<token>"
}
```

<a id="get-api-v1-setting-m2m-clients-scopes"></a>
## Get all M2m permission scopes

`GET /api/v1/setting/m2m-clients/scopes`

**Authentication:** Bearer token (JWT)

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `[].sectionId` (Required when parent is present) | `string` | Allowed values: `"member"`, `"subscription"`, `"consent"`, `"push-subscription"`, `"push-content"`, `"content"`, `"communication"`, `"segment"`, `"custom-order"`, `"widget"`, `"plans_and_products"` |
| `[].sectionName` | `string` |   |
| `[].readPermission` (Required when parent is present) | `boolean` |   |
| `[].updatePermission` (Required when parent is present) | `boolean` |   |

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get all M2m clients of a tenant (403)](https://www.subrite.no/developers/m2m-clients?md=true#get-api-v1-setting-m2m-clients).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get all M2m clients of a tenant (403)](https://www.subrite.no/developers/m2m-clients?md=true#get-api-v1-setting-m2m-clients).

### Example request

```bash
curl https://api.subrite.no/api/v1/setting/m2m-clients/scopes \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
[
  {
    "sectionId": "member",
    "sectionName": "string",
    "readPermission": true,
    "updatePermission": true
  }
]
```

<a id="get-api-v1-setting-m2m-clients-id"></a>
## Get a M2M client of a tenant by id

`GET /api/v1/setting/m2m-clients/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `scopes` (Required) | `array of M2MScopes` |   |
| `scopes[].sectionId` (Required when parent is present) | `string` | Allowed values: `"member"`, `"subscription"`, `"consent"`, `"push-subscription"`, `"push-content"`, `"content"`, `"communication"`, `"segment"`, `"custom-order"`, `"widget"`, `"plans_and_products"` |
| `scopes[].sectionName` | `string` |   |
| `scopes[].readPermission` (Required when parent is present) | `boolean` |   |
| `scopes[].updatePermission` (Required when parent is present) | `boolean` |   |
| `name` (Required) | `string` |   |
| `description` (Required) | `string` |   |
| `isActive` (Required) | `boolean` |   |
| `id` (Required) | `number` |   |
| `clientIdentifier` (Required) | `string` |   |
| `createdAt` (Required) | `string (date-time)` |   |
| `tokenSuffix` (Required) | `string` |   |

#### 400

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

The id is not an integer

| 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 M2m clients of a tenant (403)](https://www.subrite.no/developers/m2m-clients?md=true#get-api-v1-setting-m2m-clients).

**Example response**

`application/json`

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

#### 404

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

m2mClientNotFound

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"m2mClientNotFound"` |
| `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": "m2mClientNotFound",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

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

internalServerError

Same fields as [Get all M2m clients of a tenant (403)](https://www.subrite.no/developers/m2m-clients?md=true#get-api-v1-setting-m2m-clients).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/setting/m2m-clients/{id}' \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "scopes": [
    {}
  ],
  "name": "string",
  "description": "string",
  "isActive": true,
  "id": 0,
  "clientIdentifier": "string",
  "createdAt": "2019-08-24T14:15:22Z",
  "tokenSuffix": "string"
}
```

<a id="delete-api-v1-setting-m2m-clients-id"></a>
## Delete a M2M client of a tenant

`DELETE /api/v1/setting/m2m-clients/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Responses

#### 200

#### 400

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

The id is not an integer

Same fields as [Get a M2M client of a tenant by id (400)](https://www.subrite.no/developers/m2m-clients?md=true#get-api-v1-setting-m2m-clients-id).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get all M2m clients of a tenant (403)](https://www.subrite.no/developers/m2m-clients?md=true#get-api-v1-setting-m2m-clients).

**Example response**

`application/json`

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

#### 404

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

m2mClientNotFound

Same fields as [Get a M2M client of a tenant by id (404)](https://www.subrite.no/developers/m2m-clients?md=true#get-api-v1-setting-m2m-clients-id).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get all M2m clients of a tenant (403)](https://www.subrite.no/developers/m2m-clients?md=true#get-api-v1-setting-m2m-clients).

### Example request

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

<a id="patch-api-v1-setting-m2m-clients-id"></a>
## Update a M2M client of a tenant by id

`PATCH /api/v1/setting/m2m-clients/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `name` | `string` |   |
| `scopes` | `array of M2MScopes` | `minItems`: `1` |
| `scopes[].sectionId` (Required when parent is present) | `string` | Allowed values: `"member"`, `"subscription"`, `"consent"`, `"push-subscription"`, `"push-content"`, `"content"`, `"communication"`, `"segment"`, `"custom-order"`, `"widget"`, `"plans_and_products"` |
| `scopes[].sectionName` | `string` |   |
| `scopes[].readPermission` (Required when parent is present) | `boolean` |   |
| `scopes[].updatePermission` (Required when parent is present) | `boolean` |   |
| `description` | `string` |   |
| `isActive` | `boolean` | Default: `true` |

**Example request body**

`application/json`

```json
{
  "name": "string",
  "description": "string",
  "isActive": true
}
```

### Responses

#### 200

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

Same fields as [Get a M2M client of a tenant by id (200)](https://www.subrite.no/developers/m2m-clients?md=true#get-api-v1-setting-m2m-clients-id).

#### 400

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

Body validation failed, the id is not an integer, or the new name is already taken

Same fields as [Create a new M2M client for a tenant (400)](https://www.subrite.no/developers/m2m-clients?md=true#post-api-v1-setting-m2m-clients).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get all M2m clients of a tenant (403)](https://www.subrite.no/developers/m2m-clients?md=true#get-api-v1-setting-m2m-clients).

**Example response**

`application/json`

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

#### 404

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

m2mClientNotFound

Same fields as [Get a M2M client of a tenant by id (404)](https://www.subrite.no/developers/m2m-clients?md=true#get-api-v1-setting-m2m-clients-id).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get all M2m clients of a tenant (403)](https://www.subrite.no/developers/m2m-clients?md=true#get-api-v1-setting-m2m-clients).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/setting/m2m-clients/{id}' \
  --request PATCH \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "string",
  "scopes": [
    {}
  ],
  "description": "string",
  "isActive": true
}'
```

### Example response

200 · `application/json`

```json
{
  "scopes": [
    {}
  ],
  "name": "string",
  "description": "string",
  "isActive": true,
  "id": 0,
  "clientIdentifier": "string",
  "createdAt": "2019-08-24T14:15:22Z",
  "tokenSuffix": "string"
}
```
