# Oauth-Providers

**Summary:** Endpoints for Oauth-Providers

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

<a id="get-api-v1-setting-oauth-providers"></a>
## Get all oauth providers of a tenant

`GET /api/v1/setting/oauth-providers`

**Authentication:** Bearer token (JWT)

### Responses

#### 200

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

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

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

### Example request

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

### Example response

200 · `application/json`

```json
[
  {
    "id": "string",
    "clientId": "string",
    "clientSecret": "<clientSecret>",
    "name": "string",
    "enabled": true
  }
]
```

<a id="post-api-v1-setting-oauth-providers"></a>
## Create a new oauth provider

`POST /api/v1/setting/oauth-providers`

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `name` (Required) | `string` |   |
| `clientId` (Required) | `string` |   |
| `clientSecret` (Required) | `string` |   |
| `enabled` | `boolean` |   |

**Example request body**

`application/json`

```json
{
  "name": "string",
  "clientId": "string",
  "clientSecret": "<clientSecret>",
  "enabled": true
}
```

### Responses

#### 201

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

| Name | Type | Description |
| --- | --- | --- |
| `id` (Required) | `string` |   |
| `clientId` (Required) | `string` |   |
| `clientSecret` (Required) | `string` |   |
| `name` (Required) | `string` |   |
| `enabled` (Required) | `boolean` |   |

#### 400

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

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

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

**Example response**

`application/json`

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

#### 500

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

internalServerError

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

### Example request

```bash
curl https://api.subrite.no/api/v1/setting/oauth-providers \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "string",
  "clientId": "string",
  "clientSecret": "<clientSecret>",
  "enabled": true
}'
```

### Example response

201 · `application/json`

```json
{
  "id": "string",
  "clientId": "string",
  "clientSecret": "<clientSecret>",
  "name": "string",
  "enabled": true
}
```

<a id="get-api-v1-setting-oauth-providers-id"></a>
## Get an oauth provider by id

`GET /api/v1/setting/oauth-providers/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Responses

#### 200

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

Same fields as [Create a new oauth provider (201)](https://www.subrite.no/developers/oauth-providers?md=true#post-api-v1-setting-oauth-providers).

#### 400

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

The id is not a uuid

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

**Example response**

`application/json`

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

#### 404

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

oauthProviderNotFound

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

#### 500

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

internalServerError

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

### Example request

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

### Example response

200 · `application/json`

```json
{
  "id": "string",
  "clientId": "string",
  "clientSecret": "<clientSecret>",
  "name": "string",
  "enabled": true
}
```

<a id="put-api-v1-setting-oauth-providers-id"></a>
## Update an oauth provider by id

`PUT /api/v1/setting/oauth-providers/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Request body

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

**Example request body**

`application/json`

```json
{}
```

### Responses

#### 200

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

Same fields as [Create a new oauth provider (201)](https://www.subrite.no/developers/oauth-providers?md=true#post-api-v1-setting-oauth-providers).

#### 400

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

Body validation failed, the id is not a uuid, or the new name is already taken

Same fields as [Create a new oauth provider (400)](https://www.subrite.no/developers/oauth-providers?md=true#post-api-v1-setting-oauth-providers).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

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

**Example response**

`application/json`

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

#### 404

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

oauthProviderNotFound

Same fields as [Get an oauth provider by id (404)](https://www.subrite.no/developers/oauth-providers?md=true#get-api-v1-setting-oauth-providers-id).

**Example response**

`application/json`

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

#### 500

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

internalServerError

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

### Example request

```bash
curl 'https://api.subrite.no/api/v1/setting/oauth-providers/{id}' \
  --request PUT \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
```

### Example response

200 · `application/json`

```json
{
  "id": "string",
  "clientId": "string",
  "clientSecret": "<clientSecret>",
  "name": "string",
  "enabled": true
}
```

<a id="delete-api-v1-setting-oauth-providers-id"></a>
## Delete an oauth provider by id

`DELETE /api/v1/setting/oauth-providers/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Responses

#### 200

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

#### 400

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

The id is not a uuid

Same fields as [Get an oauth provider by id (400)](https://www.subrite.no/developers/oauth-providers?md=true#get-api-v1-setting-oauth-providers-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 oauth providers of a tenant (403)](https://www.subrite.no/developers/oauth-providers?md=true#get-api-v1-setting-oauth-providers).

**Example response**

`application/json`

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

#### 404

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

oauthProviderNotFound

Same fields as [Get an oauth provider by id (404)](https://www.subrite.no/developers/oauth-providers?md=true#get-api-v1-setting-oauth-providers-id).

**Example response**

`application/json`

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

#### 500

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

internalServerError

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

### Example request

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

### Example response

200 · `application/json`

```json
true
```
