Skip to content
Primary navigation

Delete organization role

client.admin.organization.roles.delete(stringroleID, RequestOptionsoptions?): RoleDeleteResponse { id, deleted, object }
DELETE/organization/roles/{role_id}

Deletes a custom role from the organization.

ParametersExpand Collapse
roleID: string
ReturnsExpand Collapse
RoleDeleteResponse { id, deleted, object }

Confirmation payload returned after deleting a role.

id: string

Identifier of the deleted role.

deleted: boolean

Whether the role was deleted.

object: "role.deleted"

Always role.deleted.

Delete organization role

import OpenAI from 'openai';

const client = new OpenAI({
  adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted
});

const role = await client.admin.organization.roles.delete('role_id');

console.log(role.id);
{
    "object": "role.deleted",
    "id": "role_01J1F8ROLE01",
    "deleted": true
}
Returns Examples
{
    "object": "role.deleted",
    "id": "role_01J1F8ROLE01",
    "deleted": true
}