---
title: "Create OAuth 2.0 configuration"
method: POST
path: "/oauth2-configurations"
tags: ["OAuth 2.0"]
---

# Create OAuth 2.0 configuration

`POST /oauth2-configurations`

Create a new OAuth 2.0 configuration. This is an asynchronous operation that returns a job_id immediately. Track progress using the Jobs API.

Note: Only one operation can run at a time per resource. When operation is completed, a restart of RabbitMQ is required for changes to be applied.

## Request body

- OAuth2ConfigurationCreate
  - `resource_server_id` string, required — Unique identifier for the resource server
  - `issuer` string, uri, required — OAuth 2.0 issuer URL (must be HTTPS)
  - `preferred_username_claims` string[] — JWT claim names to use for username
  - `additional_scopes_key` string[] — JWT claim keys containing additional scopes
  - `scope_prefix` string — Prefix to add to scopes
  - `scope_aliases` object — Map scope aliases to actual scopes (RabbitMQ 4.1.0+)
  - `verify_aud` boolean — Whether to verify audience claim in tokens
  - `oauth_client_id` string — Client ID for management interface
  - `oauth_scopes` string[] — Scopes required for management interface
  - `audience` string — OAuth 2.0 audience claim (required for Auth0 with RabbitMQ 4.1+). Typically matches resource_server_id
  - `oauth_disable_basic_auth` boolean — Disable static username/password management interface access, allowing only OAuth 2.0 authentication

## Response `200`

Configuration creation initiated

- JobIdResponse
  - `job_id` string, uuid — Job ID to track the asynchronous operation

## Other responses

- `400` — Invalid Content-Type
- `422` — Validation failed

---

[API](https://skmtc.dev/cloudamqp/apis/cloudamqp-instance-api.md) · [All operations](https://skmtc.dev/cloudamqp/apis/cloudamqp-instance-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cloudamqp/cloudamqp-instance-api/revisions/d04a3670170c/schema)
