Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation
Theme

Delete organization role

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

Deletes a custom role from the organization.

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);
Response example
{
    "object": "role.deleted",
    "id": "role_01J1F8ROLE01",
    "deleted": true
}
Parameters
roleID: string
Returns
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.

Returns Examples
Response example
{
    "object": "role.deleted",
    "id": "role_01J1F8ROLE01",
    "deleted": true
}