Roles

Create a new role. If there is an existing role with the same name as the one specified in the request, will return the existing role unmodified

post/v1/role

Request

  • Base URL
    https://api.braintrust.dev
  • Auth
    • HTTP bearer
    • or none

Request body

namestring required

Name of the role

descriptionstring nullable

Textual description of the role

member_rolesstring[] nullable

Ids of the roles this role inherits from

An inheriting role has all the permissions contained in its member roles, as well as all of their inherited permissions

org_namestring nullable

For nearly all users, this parameter should be unnecessary. But in the rare case that your API key belongs to multiple organizations, you may specify the name of the organization the role belongs in.

Response

Returns the new role object

idstring uuid required

Unique identifier for the role

org_idstring uuid nullable

Unique id for the organization that the role belongs under

A null org_id indicates a system role, which may be assigned to anybody and inherited by any other role, but cannot be edited.

It is forbidden to change the org after creating a role

user_idstring uuid nullable

Identifies the user who created the role

createdstring date-time nullable

Date of role creation

namestring required

Name of the role

descriptionstring nullable

Textual description of the role

deleted_atstring date-time nullable

Date of role deletion, or null if the role is still active

member_rolesstring[] nullable

Ids of the roles this role inherits from

An inheriting role has all the permissions contained in its member roles, as well as all of their inherited permissions

Changes

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property // became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      removed the enum value ai_secret of the request property //

    • breaking

      removed the enum value dataset of the request property //

    • breaking

      removed the enum value experiment of the request property //

    • breaking

      removed the enum value group of the request property //

    • breaking

      removed the enum value org_account of the request property //

    • breaking

      removed the enum value org_ai_secret of the request property //

    • breaking

      removed the enum value org_audit_logs of the request property //

    • breaking

      removed the enum value org_member of the request property //

    • breaking

      removed the enum value org_project of the request property //

    • breaking

      removed the enum value organization of the request property //

    • breaking

      removed the enum value project of the request property //

    • breaking

      removed the enum value project_group of the request property //

    • breaking

      removed the enum value project_group_projects of the request property //

    • breaking

      removed the enum value project_log of the request property //

    • breaking

      removed the enum value prompt of the request property //

    • breaking

      removed the enum value prompt_session of the request property //

    • breaking

      removed the enum value role of the request property //

    • breaking

      the // request property type changed from string to no type

    • breaking

      the // response's property type changed from string to no type for status

    • info

      added subschema #2 to the // request property anyOf list

    • info

      added subschema #2 to the // response property anyOf list for the response status

    • info

      removed the ai_secret enum value from the // response property for the response status

    • info

      removed the dataset enum value from the // response property for the response status

    • info

      removed the experiment enum value from the // response property for the response status

    • info

      removed the group enum value from the // response property for the response status

    • info

      removed the org_account enum value from the // response property for the response status

    • info

      removed the org_ai_secret enum value from the // response property for the response status

    • info

      removed the org_audit_logs enum value from the // response property for the response status

    • info

      removed the org_member enum value from the // response property for the response status

    • info

      removed the org_project enum value from the // response property for the response status

    • info

      removed the organization enum value from the // response property for the response status

    • info

      removed the project enum value from the // response property for the response status

    • info

      removed the project_group enum value from the // response property for the response status

    • info

      removed the project_group_projects enum value from the // response property for the response status

    • info

      removed the project_log enum value from the // response property for the response status

    • info

      removed the prompt enum value from the // response property for the response status

    • info

      removed the prompt_session enum value from the // response property for the response status

    • info

      removed the role enum value from the // response property for the response status

    • warning

      added the new project_group_projects enum value to the // response property for the response status

    • info

      added the new project_group_projects enum value to the request property //