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

# Delete a consumer role

`DELETE /apiops/projects/{projectName}/consumer-roles/{roleName}`

## Request

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

Deletes the role. A role that consumers, applications or API proxy authorization settings still hold is 409 dependencyConflict (reason roleInUse; params consumerCount, applicationCount, apiProxyCount) and nothing changes. With force=true the role is deleted the way the Consumer Roles screen deletes it: removed from those consumers, applications and API proxies, then undeployed. runtimeDeployment reports the gateway undeploy.

## Path parameters

- `projectName` string, required
- `roleName` string, required

## Query parameters

- `force` boolean

## 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)
