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

# Update Organization Member Role

> Updates an organization member's role. Accepts either the coarse `role` (admin/viewer) or a `role_id` — a system role or one of your organization's custom roles (see `GET /api/v1/roles`); provide exactly one. Requires a global API key. Cannot modify the API key's owning user or the organization owner. Cannot demote the last remaining admin.



## OpenAPI

````yaml /api-reference/openapi.json patch /api/v1/organizations/members/{user_id}
openapi: 3.1.0
info:
  title: AthenaHQ API
  description: >-
    AthenaHQ API provides programmatic access to manage your websites and
    prompts for AI-powered content optimization.
  version: 1.0.0
  contact:
    email: support@athenahq.ai
servers:
  - url: https://api.athenahq.ai
    description: Production server
security:
  - apiKey: []
tags:
  - name: Basics
    description: Core API operations for managing websites and prompts
  - name: Metrics
    description: Metrics and analytics endpoints for tracking AI visibility
  - name: Billing
    description: Billing and credits endpoints for managing usage
  - name: Team Management
    description: Endpoints for managing team members and invitations
  - name: Groups
    description: Endpoints for managing groups of websites
  - name: Content
    description: >-
      Endpoints for accessing Content Hub data — tabs, tracked URLs, and per-URL
      prompt breakdowns.
  - name: Pitch Workspace
    description: >-
      Endpoints for accessing pitch workspace reports — org-scoped pitch runs
      with competitors, prompts, attributes, and aggregate metrics.
  - name: Knowledge Base
    description: >-
      Endpoints for reading the brand Knowledge Base — approved brand facts and
      the pillars that organize them.
paths:
  /api/v1/organizations/members/{user_id}:
    parameters:
      - name: user_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: The unique identifier of the target user
    patch:
      tags:
        - Team Management
      summary: Update Organization Member Role
      description: >-
        Updates an organization member's role. Accepts either the coarse `role`
        (admin/viewer) or a `role_id` — a system role or one of your
        organization's custom roles (see `GET /api/v1/roles`); provide exactly
        one. Requires a global API key. Cannot modify the API key's owning user
        or the organization owner. Cannot demote the last remaining admin.
      operationId: updateOrgMemberRole
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrgMemberRoleRequest'
      responses:
        '200':
          description: Member role updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  member:
                    type: object
                    required:
                      - user_id
                      - org_id
                      - role
                      - role_id
                    properties:
                      user_id:
                        type: string
                        format: uuid
                        description: Unique identifier of the user
                      org_id:
                        type: string
                        format: uuid
                        description: Unique identifier of the organization
                      role:
                        type: string
                        description: >-
                          Slug of the assigned role (e.g. 'admin', 'viewer', or
                          a custom role's slug)
                        example: admin
                      role_id:
                        type: string
                        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: >-
                          ID of the assigned role (a system role ID or a custom
                          role ID)
                required:
                  - success
                  - member
        '400':
          description: Bad request - Invalid body or path parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Forbidden - Not a global key, self-modification, or owner
            modification
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            Not found - Organization member does not exist, or the requested
            `role_id` does not exist in your organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Conflict - Cannot demote the last remaining admin
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Cannot demote the last admin of the organization
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    UpdateOrgMemberRoleRequest:
      type: object
      description: >-
        Request body for updating an organization member's role. Provide exactly
        one of `role` or `role_id`.
      properties:
        role:
          type: string
          enum:
            - admin
            - viewer
          description: Coarse role to assign. Mutually exclusive with `role_id`.
          example: admin
        role_id:
          type: string
          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: >-
            Assign any role by ID — a system role or one of your organization's
            custom roles (see `GET /api/v1/roles`). Mutually exclusive with
            `role`. Returns 404 if the role does not exist or belongs to another
            organization. System role IDs are GUID-shaped sentinels (e.g.
            `00000000-0000-0000-0000-000000000001`), not RFC 4122 UUIDs.
          example: 789e0123-e89b-12d3-a456-426614174000
    Error:
      type: object
      description: Error response object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message describing what went wrong
          example: Unauthorized
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. You can create one
        [here](https://app.athenahq.ai/organization?tab=api).

````