---
title: "Delete a custom role"
method: DELETE
path: "/api/v3/roles/{role_id}"
tags: ["Roles"]
---

# Delete a custom role

`DELETE /api/v3/roles/{role_id}`

## Request

- Base URL: `https://embedded.improvado.io`
- URL: `https://embedded.improvado.io/api/v3/roles/{role_id}`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/improvado/apis/improvado-embedded-api-v3/docs/api/v3/roles/:role_id/delete.ts> (a function with typed inputs; its response is checked against the schema)

Delete an agency-scoped custom role. **Users currently assigned to it are atomically
reassigned to the system Viewer role**; the response returns how many were moved.
System roles cannot be deleted.

## Path parameters

- `role_id` integer, required

## Response `200`

Role deleted; affected users reassigned to Viewer.

- DeleteRoleResponse
  - `reassigned_users_count` integer, required: Number of users that were reassigned to the Viewer system role as part of the delete.

## Other responses

- `403`: System roles cannot be deleted.
- `404`: Role not found.

---

[API](https://skmtc.dev/improvado/apis/improvado-embedded-api-v3.md) - [All operations](https://skmtc.dev/improvado/apis/improvado-embedded-api-v3/llms.txt) - [OpenAPI document](https://skmtc.dev/improvado/apis/improvado-embedded-api-v3/revisions/a881099bd6c4?raw)
