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

# Change a role

> Rename a role or change what it allows. Only roles below your own in the list can be changed, and no permission can be raised above your own role's. The owner role can't be changed.



## OpenAPI

````yaml /openapi.json patch /api/organizations/{org_id}/roles/{role_key}
openapi: 3.1.0
info:
  description: >

    The CodeCobra API drives the same product the dashboard does: create a

    project, open a task against it, watch the agent work, and merge what it

    builds.


    ## Authenticating


    Send a personal API key as a bearer token on every request:


    ```

    Authorization: Bearer cc_your_key_here

    ```


    Mint a key from **Settings → API keys** in the dashboard. A key carries the

    full access of the user who created it, including every organization they

    belong to, so treat it like a password and point automations at a user with

    the access they actually need.


    ## What is not here


    A few dashboard actions are deliberately absent, because an API key should
    not

    be able to widen its own reach or start a flow only a browser can finish:


    * signing in, signing up, password resets and two-factor enrolment;

    * creating, listing or revoking API keys — a leaked key cannot mint another;

    * linking or unlinking a Google or GitHub identity;

    * connecting or disconnecting a GitHub App installation, which needs an
    OAuth
      round-trip in a browser to restore.

    Everything else the dashboard can do is in this reference.


    ## Conventions


    Identifiers are UUIDs. Timestamps are ISO 8601 in UTC. Money is a decimal

    string in USD. A failed request returns its reason in the `detail` field
    with

    a conventional status code: `401` for a missing or invalid key, `403` when
    the

    key's user lacks access to the object, `404` when it does not exist, and
    `429`

    when a rate limit is in play.
  title: CodeCobra API
  version: 1.0.0
servers:
  - description: Production
    url: https://codecobra.ai
  - description: Staging
    url: https://staging.codecobra.ai
security:
  - ApiKeyBearer: []
tags:
  - description: >-
      The profile behind the API key, plus the app-wide configuration an
      integration needs before it can create anything: the Odoo versions on
      offer and the models a task may run on.
    name: Account
  - description: >-
      Projects are the unit of ownership. A project pins an Odoo version and
      edition, carries the GitHub repositories the agent works in, and holds
      every task underneath it. Deleting one removes its tasks, pods and stored
      files.
    name: Projects
  - description: >-
      A task is one conversation with the agent inside a project. These
      endpoints create tasks, drive the chat, stream the response, manage
      attachments, and start the pod the agent runs in.
    name: Tasks
  - description: >-
      The plan the agent writes before it builds, its revision history, and the
      files a task produces. Approving a plan is what releases the agent to
      start work.
    name: Plans & Artifacts
  - description: >-
      The pull requests a task opens: checking CI, asking the agent to fix a red
      build, choosing a merge target, and merging to a branch that deploys.
    name: Pull Requests & Deploys
  - description: >-
      Odoo databases a task can reach. Credentials are stored per project and
      activated per task; the probe endpoints validate a URL and login before
      anything is saved. Also covers the throwaway Odoo instance a task runs
      against.
    name: Odoo Connections
  - description: >-
      Shared accounts. A workspace owns projects on behalf of its members and is
      billed as one entity.
    name: Workspaces
  - description: >-
      Who belongs to a workspace and at what role, and the invitations that put
      them there.
    name: Members & Invitations
  - description: >-
      The GitHub App installations backing a personal or workspace account, and
      the repositories and branches they expose to projects. Connecting and
      disconnecting GitHub needs a browser round-trip and stays in the
      dashboard.
    name: GitHub
  - description: Balance, payment methods, invoices and auto-reload for a personal account.
    name: Billing
  - description: >-
      The same billing operations for a workspace, settled against the
      workspace's balance rather than a member's.
    name: Workspace Billing
  - description: >-
      What has been spent, broken down by task, project or workspace, and
      exportable over a date range for billing reconciliation.
    name: Usage
paths:
  /api/organizations/{org_id}/roles/{role_key}:
    patch:
      tags:
        - Members & Invitations
      summary: Change a role
      description: >-
        Rename a role or change what it allows. Only roles below your own in the
        list can be changed, and no permission can be raised above your own
        role's. The owner role can't be changed.
      operationId: update_role_api_organizations__org_id__roles__role_key__patch
      parameters:
        - in: path
          name: org_id
          required: true
          schema:
            format: uuid
            title: Org Id
            type: string
        - in: path
          name: role_key
          required: true
          schema:
            title: Role Key
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRoleRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    UpdateRoleRequest:
      properties:
        code_access:
          anyOf:
            - enum:
                - read
                - write
                - merge_staging
                - merge_production
              type: string
            - type: 'null'
          title: Code Access
        color:
          anyOf:
            - enum:
                - amber
                - blue
                - green
                - violet
                - rose
                - teal
                - orange
                - sky
                - pink
                - lime
                - indigo
                - slate
              type: string
            - type: 'null'
          title: Color
        delete_projects:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Delete Projects
        manage_connections:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Manage Connections
        manage_members:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Manage Members
        manage_projects:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Manage Projects
        manage_roles:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Manage Roles
        name:
          anyOf:
            - maxLength: 60
              minLength: 1
              type: string
            - type: 'null'
          title: Name
        odoo_max_tier:
          anyOf:
            - enum:
                - none
                - read
                - write
                - delete
              type: string
            - type: 'null'
          title: Odoo Max Tier
        usage_access:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Usage Access
      title: UpdateRoleRequest
      type: object
    RoleResponse:
      properties:
        billing_access:
          title: Billing Access
          type: boolean
        can_assign:
          default: false
          title: Can Assign
          type: boolean
        can_delete:
          default: false
          title: Can Delete
          type: boolean
        can_edit:
          default: false
          title: Can Edit
          type: boolean
        can_move:
          default: false
          title: Can Move
          type: boolean
        code_access:
          title: Code Access
          type: string
        color:
          default: slate
          title: Color
          type: string
        delete_blocked_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Delete Blocked Reason
        delete_projects:
          title: Delete Projects
          type: boolean
        is_builtin:
          title: Is Builtin
          type: boolean
        key:
          title: Key
          type: string
        locked:
          title: Locked
          type: boolean
        manage_connections:
          title: Manage Connections
          type: boolean
        manage_members:
          title: Manage Members
          type: boolean
        manage_projects:
          title: Manage Projects
          type: boolean
        manage_roles:
          title: Manage Roles
          type: boolean
        member_count:
          default: 0
          title: Member Count
          type: integer
        name:
          title: Name
          type: string
        odoo_max_tier:
          title: Odoo Max Tier
          type: string
        usage_access:
          title: Usage Access
          type: boolean
      required:
        - key
        - name
        - is_builtin
        - locked
        - billing_access
        - usage_access
        - odoo_max_tier
        - manage_connections
        - code_access
        - manage_roles
        - manage_members
        - manage_projects
        - delete_projects
      title: RoleResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    ApiKeyBearer:
      description: A personal API key from Settings → API keys.
      scheme: bearer
      type: http

````