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

# Update Member Role

> ⚠️ SECURITY: Only OWNERS and ADMINS can change member roles. The OWNER role cannot be changed or transferred.

Updates a member's role within the organization.

## Permissions

User must be **owner** or **admin** to update roles.

## Role Hierarchy

* **Owner**: Cannot be changed or removed (permanent)
* **Admin**: Can manage members and settings
* **Member**: Basic organization access

## Restrictions

* Owner role cannot be transferred or removed
* Only one owner per organization
* Cannot demote yourself if you're the only admin

## Example

```bash theme={null}
curl -X PUT http://localhost:3001/api/organizations/550e8400-e29b-41d4-a716-446655440000/members/123/role \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "role": "admin"
  }'
```

## Events Published

* `MemberRoleUpdatedEvent` - Triggers audit log creation


## OpenAPI

````yaml PUT /organizations/{id}/members/{memberId}/role
openapi: 3.1.0
info:
  title: Timbrix API
  description: >-
    REST API with OAuth2 server for managing organizations, members, and
    webhooks
  version: '1.0'
  contact: {}
servers:
  - url: http://sandbox.mintlify.com
    description: Sandbox environment
  - url: http://localhost:3001/api
    description: Local development
security: []
tags:
  - name: organizations
    description: Organization management endpoints
  - name: oauth
    description: OAuth2 authentication and authorization
  - name: webhooks
    description: Webhook configuration and delivery
  - name: users
    description: User information endpoints
  - name: api-keys
    description: API Keys management and validation
paths:
  /organizations/{id}/members/{memberId}/role:
    put:
      tags:
        - organizations
      summary: Update member role (owner/admin only)
      description: >-
        ⚠️ SECURITY: Only OWNERS and ADMINS can change member roles. The OWNER
        role cannot be changed or transferred.
      operationId: OrganizationsController_updateRole
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: memberId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMemberRoleDto'
      responses:
        '200':
          description: Member role updated successfully.
        '400':
          description: Invalid role value. Must be "admin" or "member".
        '401':
          description: Authentication required. Provide a valid bearer token.
        '403':
          description: >-
            Access denied. Either insufficient permissions or attempting to
            change the owner role.
        '404':
          description: Organization or member not found.
      security:
        - bearer: []
components:
  schemas:
    UpdateMemberRoleDto:
      type: object
      properties:
        role:
          type: string
          description: New role for the member
          enum:
            - admin
            - member
          example: admin
      required:
        - role
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````