---
title: "Create a consumer role"
method: POST
path: "/apiops/projects/{projectName}/consumer-roles"
tags: ["Consumer Role"]
---

# Create a consumer role

`POST /apiops/projects/{projectName}/consumer-roles`

## Request

- Base URL: `http://167.86.118.166:32080`
- URL: `http://167.86.118.166:32080/apiops/projects/{projectName}/consumer-roles`
- Auth: none declared
- TypeScript: <https://skmtc.dev/apinizer/apis/apinizer-management-apis/docs/apiops/projects/:projectName/consumer-roles/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates the role (name required, oauthScope optional) and deploys it. A name another role of the project or of the administration project holds is 409 duplicateName; an invalid or already used OAuth scope name is 400.

## Path parameters

- `projectName` string, required

## Request body

- ApiOpsConsumerRoleWriteDTO
  - `name` string
  - `oauthScope` string

## Response `200`

OK

- ApiOpsMutationResponseApiOpsResponseConsumerRole
  - `status` 'SUCCESS' | 'FAILURE'
  - `resourceVersion` integer
  - `runtimeDeployment` ApiOpsRuntimeDeploymentDTO
    - `state` 'IN_SYNC' | 'DEGRADED'
    - `environments` Environment[]
      - `name` string
      - `acknowledged` boolean
      - `detail` string
  - `result` ApiOpsResponseConsumerRole
    - `name` string
    - `oauthScope` string

---

[API](https://skmtc.dev/apinizer/apis/apinizer-management-apis.md) - [All operations](https://skmtc.dev/apinizer/apis/apinizer-management-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/apinizer/apis/apinizer-management-apis/revisions/e083046b24cd?raw)
