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

# Update workspace membership

> Update a member's role in the workspace. Requires admin role. Cannot demote yourself as owner.



## OpenAPI

````yaml /swagger.json patch /v1/workspaces/{workspace_id}/memberships/{id}
openapi: 3.0.1
info:
  title: Scute API
  version: v1
  description: API for managing users in Scute applications
servers:
  - url: https://{defaultHost}
    variables:
      defaultHost:
        default: api.scute.io
  - url: http://localhost:3333
    description: Development server
security:
  - apiSecret: []
    userAccess: []
paths:
  /v1/workspaces/{workspace_id}/memberships/{id}:
    parameters:
      - name: workspace_id
        in: path
        description: Workspace ID
        required: true
        schema:
          type: string
      - name: id
        in: path
        description: Membership ID
        required: true
        schema:
          type: string
    patch:
      tags:
        - Workspace Memberships
      summary: Update workspace membership
      description: >-
        Update a member's role in the workspace. Requires admin role. Cannot
        demote yourself as owner.
      operationId: updateWorkspaceMembership
      parameters: []
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  membership:
                    type: object
                    properties:
                      id:
                        type: string
                      user_id:
                        type: string
                      workspace_id:
                        type: string
                      role:
                        type: string
                      status:
                        type: string
                      invitation_token:
                        type: string
                        nullable: true
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
                      user:
                        type: object
                        properties:
                          id:
                            type: string
                          email:
                            type: string
                          name:
                            type: string
                  workspace_membership:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: string
                      role:
                        type: string
                      status:
                        type: string
                      created_at:
                        type: string
                        format: date-time
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '422':
          description: unprocessable entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Cannot demote yourself as an owner
      security:
        - userAccess: []
components:
  securitySchemes:
    apiSecret:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: API Secret token
    userAccess:
      type: apiKey
      name: X-Authorization
      in: header
      description: User Access token

````