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

# Update workspace role



## OpenAPI

````yaml /openapi.yaml patch /workspace_roles/{id}
openapi: 3.0.1
info:
  title: GetSpecs REST API
  description: REST API documentation for GetSpecs.
  version: 1.0.0
servers:
  - url: /v1
  - url: https://demo-api.getspecs.io/v1
security: []
paths:
  /workspace_roles/{id}:
    patch:
      tags:
        - WorkspaceRole
      summary: Update workspace role
      operationId: workspace_roles#update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestBodyWorkspaceRoleUpdate'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workspace_role'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
        - apiKey: []
          workspaceId: []
components:
  schemas:
    requestBodyWorkspaceRoleUpdate:
      type: object
      properties:
        name:
          type: string
        permissions:
          type: object
        field_access:
          type: object
          description: >-
            Partial update of the role's column restrictions: { item_fields: {
            slug => hidden|view|edit }, baseline_fields: { field =>
            hidden|view|edit } }. Only sent entries change; edit removes a
            restriction.
      required:
        - name
    workspace_role:
      type: object
      properties:
        id:
          type: integer
        slug:
          type: string
        name:
          type: string
        position:
          type: integer
        permissions:
          type: object
        field_access:
          type: object
          description: >-
            Per-column restrictions of the role. Only restricted columns are
            listed (hidden or view); an unlisted column is editable. Always
            empty for the owner role.
          properties:
            item_fields:
              type: object
              description: Item field slug => hidden | view
              additionalProperties:
                type: string
                enum:
                  - hidden
                  - view
            baseline_fields:
              type: object
              description: >-
                Baseline field => hidden | view. Fields: identifier, name,
                category, package_section, description, unit_type, supplier,
                image, quantity, unit_cost_price, cost_price, client_price
                (identifier, category and package_section can't be hidden).
              additionalProperties:
                type: string
                enum:
                  - hidden
                  - view
          required:
            - item_fields
            - baseline_fields
    error:
      type: object
      properties:
        error:
          type: string
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                nullable: true
              code:
                type: string
                nullable: true
              message:
                type: string
            required:
              - message
  securitySchemes:
    apiKey:
      type: apiKey
      name: authorization
      in: header
    workspaceId:
      type: apiKey
      name: X-Workspace-ID
      in: header

````

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