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

# Create Project User Role

> Create a project user role. A role grants editing only through a flag that says so; one created without permissions is view-only.



## OpenAPI

````yaml post /v1/api/projects/{projectId}/user-roles
openapi: 3.1.0
info:
  title: Upsolve API
  version: 1.5.0
servers:
  - url: https://api.upsolve.ai
security: []
tags: []
paths:
  /v1/api/projects/{projectId}/user-roles:
    post:
      summary: Create a project user role. A role grants editing…
      description: >-
        Create a project user role. A role grants editing only through a flag
        that says so; one created without permissions is view-only.
      operationId: PostV1ApiProjectsProjectIdUserRoles
      parameters:
        - name: projectId
          in: path
          required: true
          description: The project the role belongs to.
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
            description: The project the role belongs to.
      requestBody:
        description: POST /v1/api/projects/:projectId/user-roles Request body
        content:
          application/json:
            schema:
              type: object
              properties:
                apiKey:
                  type: string
                  minLength: 1
                  description: >-
                    Upsolve API key, generated under Account → Developer
                    settings in the Upsolve Hub. Keys are user-scoped: pass
                    organizationId alongside the key to select which org to act
                    on.
                  examples:
                    - up_embed_************
                organizationId:
                  description: >-
                    Your Upsolve organization's UUID — the org that owns the API
                    key and project. This is NOT a project organization: do not
                    pass a value registered via /projects/register-organization,
                    and do not pass an `externalId` (only
                    `projectOrganizationId` accepts those). Omit it when using
                    an org-bound API key — the org is read from the key and any
                    value sent here is ignored. Required only for user-scoped
                    API keys (created under Account → Developer settings) and
                    for the Supabase JWT path, where the org is ambiguous and
                    membership is verified against it.
                  examples:
                    - 123e4567-e89b-12d3-a456-426614174000
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                name:
                  type: string
                  minLength: 1
                  description: The role's name, unique in the project.
                permissions:
                  default: {}
                  type: object
                  properties:
                    addChart:
                      description: >-
                        Add existing charts to a dashboard. Grants editing.
                        Unset: on, for a role that grants editing.
                      type: boolean
                    addFilter:
                      description: >-
                        Add new filters to a dashboard. Grants editing. Using a
                        dashboard's existing filters needs no permission. Unset:
                        on, for a role that grants editing.
                      type: boolean
                    createChart:
                      description: >-
                        Create new charts in the chart builder. Grants editing.
                        Unset: on, for a role that grants editing.
                      type: boolean
                    createChartSQL:
                      description: >-
                        Write a chart's SQL by hand. No effect unless
                        createChart is on. Unset: off.
                      type: boolean
                    editCharts:
                      description: >-
                        Edit the charts on a dashboard. Grants editing. Unset:
                        off.
                      type: boolean
                    removeChart:
                      description: >-
                        Remove charts from a dashboard. Grants editing. Unset:
                        on, for a role that grants editing.
                      type: boolean
                    disableTabs:
                      description: 'Turn off the tabbed dashboard display. Unset: off.'
                      type: boolean
                    hideHeader:
                      description: 'Hide the dashboard header. Unset: off.'
                      type: boolean
                    hideDownloadButton:
                      description: 'Hide the dashboard''s PDF download button. Unset: off.'
                      type: boolean
                    aiCharts:
                      description: 'Create charts by asking AI. Unset: off.'
                      type: boolean
                    editMarketplace:
                      description: 'Legacy. Has no effect. Unset: off.'
                      type: boolean
                    readOnly:
                      description: >-
                        View only. Overrides every flag that grants editing: the
                        dashboard shows no editing tools, and the API refuses
                        the user's dashboard writes. Also turns off drill-down.
                        Unset: off.
                      type: boolean
                    aiInsight:
                      description: 'Open the AI insights chat sidebar. Unset: off.'
                      type: boolean
                    drillDown:
                      description: >-
                        Drill into a chart's data. Off whenever readOnly is on.
                        Unset: off.
                      type: boolean
                    enableScheduleReport:
                      description: >-
                        Show the Schedule Report button on the dashboard header,
                        where scheduled reports are enabled for the
                        organization. Unset: off.
                      type: boolean
                    canDuplicateDashboard:
                      description: >-
                        Duplicate a dashboard into a copy of the user's own.
                        Grants editing. Unset: on, for a role that grants
                        editing.
                      type: boolean
                    canSetDefaultDashboard:
                      description: 'Set a dashboard as the user''s default. Unset: on.'
                      type: boolean
                    canEditChartFromSession:
                      description: >-
                        Edit an AI-generated chart from the agent chat session.
                        Unset: on.
                      type: boolean
                    hideFilters:
                      description: 'Hide the dashboard''s filter bar. Unset: off.'
                      type: boolean
                    addDashboard:
                      description: >-
                        Create new dashboards. Grants editing. Unset: on, for a
                        role that grants editing.
                      type: boolean
                  description: >-
                    A project user role's permissions. A role grants editing
                    only through one of addChart, addFilter, createChart,
                    editCharts, removeChart, addDashboard or
                    canDuplicateDashboard set to true, and never while readOnly
                    is on. Any other role, `{}` included, is view-only, and so
                    is a project user with no role. An edit never changes the
                    shared dashboard: it is saved to the user's own copy.
              required:
                - name
            examples:
              example1:
                value:
                  apiKey: up_embed_************
                  organizationId: 123e4567-e89b-12d3-a456-426614174000
        required: true
      responses:
        '200':
          description: POST /v1/api/projects/:projectId/user-roles Positive response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    const: success
                  data:
                    type: object
                    properties:
                      projectUserRoleId:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                        description: The new role's id.
                    required:
                      - projectUserRoleId
                    additionalProperties: false
                required:
                  - status
                  - data
                additionalProperties: false
        '400':
          description: POST /v1/api/projects/:projectId/user-roles Negative response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    const: error
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      code:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                    required:
                      - message
                    additionalProperties: false
                required:
                  - status
                  - error
                additionalProperties: false
      security:
        - APIKEY_1: []
components:
  securitySchemes:
    APIKEY_1:
      type: apiKey
      in: query
      name: apiKey
      x-in-actual: body
      description: apiKey MUST be supplied within the request body instead of query

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.