> ## Documentation Index
> Fetch the complete documentation index at: https://arize-ax.mintlify.site/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a role

> Create a new custom role for the authenticated user's account.

**Payload Requirements**
- `name` is required and must be unique within the account.
- `permissions` is required and must contain at least one valid permission
  identifier (e.g. `PROJECT_READ`, `DATASET_CREATE`).
- System-managed fields (`id`, `created_at`, `updated_at`, `is_predefined`)
  are rejected if provided.

**Valid example**
```json
{
  "name": "Data Scientist",
  "description": "Can read and create datasets and experiments.",
  "permissions": ["PROJECT_READ", "DATASET_READ", "DATASET_CREATE"]
}
```

**Invalid example** (missing required `permissions`)
```json
{
  "name": "Data Scientist"
}
```

<Note>This endpoint is in beta, read more [here](https://arize.com/docs/ax/rest-reference#api-version-stages).</Note>




## OpenAPI

````yaml https://api.arize.com/v2/spec.yaml post /v2/roles
openapi: 3.0.3
info:
  title: Arize REST API
  version: 2.0.0
  description: |
    API specification for the backend data server. The API is hosted globally
    at https://api.arize.com/v2 or in your own environment.
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
  - description: Global
    url: https://api.arize.com
  - description: Regional
    url: https://api.{region}.arize.com
    variables:
      region:
        default: eu-west-1a
        enum:
          - eu-west-1a
          - ca-central-1a
  - description: Custom Host
    url: https://{host}
    variables:
      host:
        default: api.arize.com
security:
  - bearerAuth: []
tags:
  - name: AI Integrations
    description: |
      AI integrations configure access to external LLM providers (e.g. OpenAI,
      Azure OpenAI, AWS Bedrock, Vertex AI). Integrations can be scoped to the
      entire account, a specific organization, or a specific space.
  - name: Annotation Configs
    description: >
      Annotation configs allow you to define consistent annotation schemas that

      can be reused across your workspace, ensuring evaluations are structured
      and

      comparable over time.
  - name: Annotation Queues
    description: >
      Annotation queues help you organize and manage human evaluation workflows.

      Use queues to assign spans or examples to annotators for review and
      labeling.
  - name: API Keys
    description: >
      API keys are used to authenticate requests to the Arize API. List your
      keys

      to view metadata; the raw secret is never returned after creation.
  - name: Datasets
    description: |
      Datasets are structured, version-controlled example collections you use to
      run, evaluate, and track LLM experiments.
  - name: Evaluators
    description: >
      Evaluators are reusable evaluation configurations used to assess the
      quality

      of LLM outputs. They can be template-based (using LLM judges) or
      code-based.
  - name: Experiments
    description: >
      Experiments let you systematically test prompt/model changes using
      datasets,

      tasks, and evaluators.
  - name: Integrations
    description: >
      Integrations configure access to external LLM providers (e.g. OpenAI,

      Azure OpenAI, AWS Bedrock, Vertex AI), notifications services (e.g.
      PagerDuty, Slack), and

      your own agents. Integrations can be scoped to the entire account, a
      specific

      organization, or a specific space.
  - name: Organizations
    description: >
      Organizations are top-level containers within an Arize AX account for
      grouping spaces.
  - name: Projects
    description: |
      Projects represent LLM applications being monitored in Arize where you can
      observe traces and spans.
  - name: Prompts
    description: >
      Prompts are reusable, versioned templates for LLM interactions. Use
      prompts

      to standardize and manage how you interact with LLMs across your
      application.
  - name: Resource Restrictions
    description: |
      Endpoints for restricting and unrestricting resources (projects, models).
  - name: Role Bindings
    description: |
      Role bindings assign a role to a user on a resource. REST currently
      supports space- and project-scoped bindings.
  - name: Roles
    description: >
      Roles define sets of permissions that can be assigned to users within an

      account. Create custom roles to tailor access control to your team's
      needs.
  - name: Spaces
    description: >
      Spaces are containers within an organization for grouping related
      projects,

      datasets, and experiments, enabling collaboration or isolated
      experimentation

      with role-based access control.
  - name: Spans
    description: |
      Spans represent individual operations within a trace. A span captures the
      timing, status, and attributes of a single operation in your application.
  - name: Tasks
    description: |
      Tasks are configurable units of work that tie one or more evaluators to a
      data source (project or dataset). Use tasks to automate evaluation of LLM
      outputs, with support for continuous evaluation and backfill runs.
  - name: Users
    description: >
      Users represent members of an account. The Users endpoints allow creating,

      listing, updating (display name), and removing users from the account
      programmatically.
paths:
  /v2/roles:
    post:
      tags:
        - Roles
      summary: Create a role
      description: >
        Create a new custom role for the authenticated user's account.


        **Payload Requirements**

        - `name` is required and must be unique within the account.

        - `permissions` is required and must contain at least one valid
        permission
          identifier (e.g. `PROJECT_READ`, `DATASET_CREATE`).
        - System-managed fields (`id`, `created_at`, `updated_at`,
        `is_predefined`)
          are rejected if provided.

        **Valid example**

        ```json

        {
          "name": "Data Scientist",
          "description": "Can read and create datasets and experiments.",
          "permissions": ["PROJECT_READ", "DATASET_READ", "DATASET_CREATE"]
        }

        ```


        **Invalid example** (missing required `permissions`)

        ```json

        {
          "name": "Data Scientist"
        }

        ```


        <Note>This endpoint is in beta, read more
        [here](https://arize.com/docs/ax/rest-reference#api-version-stages).</Note>
      operationId: roles_create
      requestBody:
        $ref: '#/components/requestBodies/CreateRoleRequestBody'
      responses:
        '201':
          $ref: '#/components/responses/RoleCreated'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
components:
  requestBodies:
    CreateRoleRequestBody:
      description: Body containing role creation parameters.
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RoleCreate'
          examples:
            minimal:
              summary: Role with required fields only
              value:
                name: AI Engineer
                permissions:
                  - PROJECT_READ
                  - DATASET_READ
                  - DATASET_CREATE
            with_description:
              summary: Role with description
              value:
                name: AI Engineer
                description: >-
                  Can read and create datasets and experiments but cannot manage
                  spaces.
                permissions:
                  - PROJECT_READ
                  - DATASET_READ
                  - DATASET_CREATE
                  - EXPERIMENT_READ
                  - EXPERIMENT_CREATE
  responses:
    RoleCreated:
      description: Role successfully created.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Role'
          example:
            id: Um9sZToxOmFCY0Q=
            name: Data Scientist
            description: Can read and create datasets and experiments.
            permissions:
              - PROJECT_READ
              - DATASET_READ
              - DATASET_CREATE
            is_predefined: false
            created_at: '2024-06-01T10:00:00Z'
            updated_at: '2024-06-01T10:00:00Z'
    BadRequest:
      description: Invalid request
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            status: 400
            title: Invalid request parameters
            detail: The 'name' field is required and must be a non-empty string.
            instance: /resource
            type: https://arize.com/docs/ax/rest-reference/errors#invalid-request
    Unauthorized:
      description: Authentication is required
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            status: 401
            title: Authentication required
            detail: You must be authenticated to access this resource.
            instance: /resource
            type: >-
              https://arize.com/docs/ax/rest-reference/errors#authentication-required
    Forbidden:
      description: Insufficient permissions to access this resource
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            status: 403
            title: Access forbidden
            detail: You do not have permission to access this resource.
            instance: /resource/12345
            type: https://arize.com/docs/ax/rest-reference/errors#access-forbidden
    Conflict:
      description: Resource conflict
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            status: 409
            title: Resource conflict
            detail: A resource with the given identifier already exists.
            instance: /resource
            type: https://arize.com/docs/ax/rest-reference/errors#resource-conflict
    UnprocessableEntity:
      description: Unprocessable entity
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            status: 422
            title: Unprocessable Entity
            detail: Minimum score must be less than maximum score.
            instance: /annotation-configs
            type: >-
              https://arize.com/docs/ax/rest-reference/errors#unprocessable-entity
    RateLimitExceeded:
      description: Rate limit exceeded
      headers:
        Retry-After:
          description: |
            When throttled (429), how long to wait before retrying. Value is
            either a delta-seconds integer.
          schema:
            type: integer
            minimum: 0
          example: 42
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            status: 429
            title: Rate limit exceeded
            detail: >-
              You have exceeded the allowed number of requests. Please try again
              later.
            instance: /resource
            type: >-
              https://arize.com/docs/ax/rest-reference/errors#rate-limit-exceeded
  schemas:
    RoleCreate:
      type: object
      required:
        - name
        - permissions
      properties:
        name:
          type: string
          maxLength: 255
          description: Human-readable name for the role. Must be unique within the account.
          example: AI Engineer
        description:
          type: string
          maxLength: 1000
          description: >-
            Optional description of the role's purpose. Omitted from the
            response if empty.
          example: >-
            Can read and create datasets and experiments but cannot manage
            spaces.
        permissions:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Permission'
          description: >
            List of permissions to grant. At least one permission is required.
            Each value

            must be a valid permission identifier (e.g. `PROJECT_READ`,
            `DATASET_CREATE`).
          example:
            - PROJECT_READ
            - DATASET_READ
            - DATASET_CREATE
            - EXPERIMENT_READ
            - EXPERIMENT_CREATE
      additionalProperties: false
    Role:
      type: object
      required:
        - id
        - name
        - permissions
        - is_predefined
        - created_at
        - updated_at
      properties:
        id:
          type: string
          description: Unique identifier for the role.
        name:
          type: string
          description: Human-readable name of the role.
        description:
          type: string
          description: A brief description of the role's purpose.
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/Permission'
          description: >
            List of permissions granted by this role. Each value corresponds to
            a

            permission identifier (e.g. `PROJECT_READ`, `DATASET_CREATE`).
        is_predefined:
          type: boolean
          description: >
            Whether this role is a system-defined predefined role. Predefined
            roles

            cannot be updated or deleted.
        created_at:
          type: string
          format: date-time
          description: Timestamp when the role was created.
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the role was last updated.
      additionalProperties: false
    Problem:
      type: object
      description: RFC 9457 Problem Details
      properties:
        title:
          type: string
          description: A short, human-readable summary of the problem type
        status:
          type: integer
          description: >-
            The HTTP status code generated by the origin server for this
            occurrence of the problem
        type:
          type: string
          format: uri-reference
          description: A URI reference that identifies the problem type
        detail:
          type: string
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem
        instance:
          type: string
          format: uri-reference
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem
      required:
        - title
        - status
      additionalProperties: false
    Permission:
      type: string
      x-extensible-enum: true
      enum:
        - AI_PROVIDER_READ
        - ALYX_RUN
        - ANNOTATION_CONFIG_CREATE
        - ANNOTATION_CONFIG_DELETE
        - ANNOTATION_CONFIG_READ
        - ANNOTATION_CONFIG_UPDATE
        - CUSTOM_METRIC_CREATE
        - CUSTOM_METRIC_DELETE
        - CUSTOM_METRIC_READ
        - CUSTOM_METRIC_UPDATE
        - DASHBOARD_CREATE
        - DASHBOARD_DELETE
        - DASHBOARD_READ
        - DASHBOARD_UPDATE
        - DATASET_CREATE
        - DATASET_DELETE
        - DATASET_EXAMPLE_ANNOTATE
        - DATASET_EXAMPLE_CREATE
        - DATASET_EXAMPLE_DELETE
        - DATASET_EXAMPLE_READ
        - DATASET_EXAMPLE_UPDATE
        - DATASET_READ
        - DATASET_UPDATE
        - DATA_FABRIC_CONNECTOR_CREATE
        - DATA_FABRIC_CONNECTOR_DELETE
        - DATA_FABRIC_CONNECTOR_READ
        - DATA_FABRIC_CONNECTOR_UPDATE
        - EVALUATOR_CREATE
        - EVALUATOR_DELETE
        - EVALUATOR_READ
        - EVALUATOR_UPDATE
        - EXPERIMENT_CREATE
        - EXPERIMENT_DELETE
        - EXPERIMENT_EVAL_TASK_CREATE
        - EXPERIMENT_EVAL_TASK_DELETE
        - EXPERIMENT_EVAL_TASK_READ
        - EXPERIMENT_EVAL_TASK_UPDATE
        - EXPERIMENT_READ
        - EXPERIMENT_RUN_ANNOTATE
        - EXPERIMENT_RUN_READ
        - EXPERIMENT_UPDATE
        - FILE_IMPORT_CREATE
        - FILE_IMPORT_DELETE
        - FILE_IMPORT_READ
        - FILE_IMPORT_UPDATE
        - ML_MODEL_CREATE
        - ML_MODEL_DELETE
        - ML_MODEL_READ
        - ML_MODEL_UPDATE
        - MONITOR_CREATE
        - MONITOR_DELETE
        - MONITOR_READ
        - MONITOR_TRIGGER
        - MONITOR_UPDATE
        - ORGANIZATION_CREATE
        - ORGANIZATION_DELETE
        - ORGANIZATION_READ
        - ORGANIZATION_UPDATE
        - PLAYGROUND_RUN
        - PLAYGROUND_VIEW_CREATE
        - PLAYGROUND_VIEW_DELETE
        - PLAYGROUND_VIEW_READ
        - PLAYGROUND_VIEW_UPDATE
        - PROJECT_CREATE
        - PROJECT_DELETE
        - PROJECT_EVAL_TASK_CREATE
        - PROJECT_EVAL_TASK_DELETE
        - PROJECT_EVAL_TASK_READ
        - PROJECT_EVAL_TASK_UPDATE
        - PROJECT_READ
        - PROJECT_RESTRICT
        - PROJECT_SPAN_ANNOTATE
        - PROJECT_SPAN_CREATE
        - PROJECT_SPAN_DELETE
        - PROJECT_SPAN_READ
        - PROJECT_SPAN_UPDATE
        - PROJECT_UPDATE
        - PROMPT_CREATE
        - PROMPT_DELETE
        - PROMPT_OPTIMIZE_TASK_CREATE
        - PROMPT_OPTIMIZE_TASK_DELETE
        - PROMPT_OPTIMIZE_TASK_READ
        - PROMPT_OPTIMIZE_TASK_UPDATE
        - PROMPT_READ
        - PROMPT_UPDATE
        - QUEUE_CREATE
        - QUEUE_DELETE
        - QUEUE_READ
        - QUEUE_RECORD_ANNOTATE
        - QUEUE_RECORD_CREATE
        - QUEUE_RECORD_DELETE
        - QUEUE_RECORD_READ
        - QUEUE_RECORD_UPDATE
        - QUEUE_UPDATE
        - REMOTE_ENDPOINT_INTEGRATION_CREATE
        - REMOTE_ENDPOINT_INTEGRATION_DELETE
        - REMOTE_ENDPOINT_INTEGRATION_READ
        - REMOTE_ENDPOINT_INTEGRATION_UPDATE
        - ROLE_BINDING_CREATE
        - ROLE_BINDING_DELETE
        - ROLE_BINDING_READ
        - SERVICE_KEY_CREATE
        - SERVICE_KEY_DELETE
        - SERVICE_KEY_READ
        - SPACE_CREATE
        - SPACE_DELETE
        - SPACE_READ
        - SPACE_UPDATE
        - TAG_CREATE
        - TAG_DELETE
        - TAG_READ
        - TAG_UPDATE
        - TRACE_VIEW_CREATE
        - TRACE_VIEW_DELETE
        - TRACE_VIEW_READ
        - TRACE_VIEW_UPDATE
        - USER_CREATE
        - USER_DELETE
        - USER_PERMISSION_UPDATE
        - USER_READ
        - USER_UPDATE
      description: |
        A permission identifier following the pattern {RESOURCE}_{ACTION}.
        Auto-generated from proto/auth/protocol/permissions.proto.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: <api-key>
      description: >
        Most Arize AI endpoints require authentication. For those endpoints that
        require authentication, include your API key in the request header using
        the format

        ``` Authorization: Bearer <api-key>

        ```

````