Skip to content
Primary navigation

Delete organization role

RoleDeleteResponse admin().organization().roles().delete(RoleDeleteParamsparams = RoleDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
DELETE/organization/roles/{role_id}

Deletes a custom role from the organization.

ParametersExpand Collapse
RoleDeleteParams params
Optional<String> roleId
ReturnsExpand Collapse
class RoleDeleteResponse:

Confirmation payload returned after deleting a role.

String id

Identifier of the deleted role.

boolean deleted

Whether the role was deleted.

JsonValue; object_ "role.deleted"constant"role.deleted"constant

Always role.deleted.

Delete organization role

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.admin.organization.roles.RoleDeleteParams;
import com.openai.models.admin.organization.roles.RoleDeleteResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        RoleDeleteResponse role = client.admin().organization().roles().delete("role_id");
    }
}
{
    "object": "role.deleted",
    "id": "role_01J1F8ROLE01",
    "deleted": true
}
Returns Examples
{
    "object": "role.deleted",
    "id": "role_01J1F8ROLE01",
    "deleted": true
}