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

# Change a member's role in this workspace



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/workspaces/members/{id}
openapi: 3.0.0
info:
  title: PlugKit API
  description: >-
    One API to publish, schedule and message across Instagram, Facebook,
    Threads, WhatsApp, TikTok, Telegram, YouTube, X, LinkedIn and Bluesky — and
    to run Meta and Google ads.
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.plugkit.co
security: []
tags: []
paths:
  /v1/workspaces/members/{id}:
    patch:
      tags:
        - workspaces
      summary: Change a member's role in this workspace
      operationId: WorkspacesController_setRole
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetMemberRoleDto'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      Human-readable confirmation. Informative only: do not
                      parse.
                    example: Done
                  member:
                    $ref: '#/components/schemas/WorkspaceMember'
                required:
                  - message
                  - member
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - api-key: []
components:
  schemas:
    SetMemberRoleDto:
      type: object
      properties:
        role:
          type: string
          enum:
            - member
            - admin
          example: admin
          description: >-
            `member` : la portée de données du workspace, sans la facturation.
            `admin` : tout ce que le propriétaire peut faire — abonnement,
            plafond de dépense X, invitations. Le propriétaire lui-même n'a pas
            de rôle : il ne peut pas être retiré.
      required:
        - role
    WorkspaceMember:
      type: object
      properties:
        id:
          type: string
        email:
          type: string
        role:
          type: string
          enum:
            - admin
            - member
        status:
          type: string
        invitedAt:
          type: string
          format: date-time
          example: '2026-11-10T09:30:00.000Z'
        acceptedAt:
          type: string
          format: date-time
          example: '2026-11-10T09:30:00.000Z'
          nullable: true
      required:
        - id
        - email
        - role
        - status
        - invitedAt
    Error:
      type: object
      description: >-
        Every error response has this shape. The request id is returned in the
        `x-request-id` header, not in the body.
      properties:
        error:
          type: string
          description: >-
            Human-readable message (English). Informative only: branch on `type`
            and `code`.
          example: scheduledFor must be a future date.
        type:
          type: string
          description: Error class, for programmatic branching.
          example: invalid_request_error
          enum:
            - invalid_request_error
            - authentication_error
            - permission_error
            - not_found
            - rate_limit_error
            - platform_error
            - billing_error
            - api_error
        code:
          type: string
          description: >-
            Stable machine code for the precise case (e.g. `validation_failed`,
            `post_not_found`, `rate_limited`, `subscription_required`).
          example: scheduled_in_past
        param:
          type: string
          description: Request field at fault, when there is one.
          example: scheduledFor
        platform:
          type: string
          description: >-
            Upstream platform (meta, tiktok, x…) when `type` is
            `platform_error`.
          example: meta
        platformError:
          type: object
          additionalProperties: true
          description: Raw error payload from the platform, passed through verbatim.
        details:
          type: object
          additionalProperties: true
          description: >-
            Extra structured context. Validation errors carry `details.fields`
            (one message per invalid field); billing errors carry
            `details.action_url`; rate limits carry `details.retryAfter`.
      required:
        - error
        - type
        - code
  responses:
    BadRequest:
      description: >-
        Invalid request. `code` is `validation_failed` for body/query validation
        (one message per field in `details.fields`), or a specific code
        (`invalid_reference`, `unsupported_for_platform`…).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 2 validation errors on the request.
            type: invalid_request_error
            code: validation_failed
            details:
              fields:
                - content should not be empty
                - accountIds must be an array
    Unauthorized:
      description: Missing, invalid or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Invalid API key.
            type: authentication_error
            code: unauthorized
    NotFound:
      description: The resource does not exist, or does not belong to the caller.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: No post found with id 'cm3post000001'.
            type: not_found
            code: post_not_found
            details:
              id: cm3post000001
    RateLimited:
      description: >-
        Too many requests (PlugKit per-minute quota, or the shared platform
        quota nearly exhausted). Wait `retry-after` seconds.
      headers:
        retry-after:
          description: Seconds to wait before retrying.
          schema:
            type: integer
        x-ratelimit-limit:
          description: Requests allowed per minute in this bucket.
          schema:
            type: integer
        x-ratelimit-remaining:
          schema:
            type: integer
        x-ratelimit-reset:
          description: Unix time (seconds) when the window resets.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 'Rate limit exceeded: 60 write requests per minute. Retry in 12s.'
            type: rate_limit_error
            code: rate_limited
            details:
              limit: 60
              bucket: write
              retryAfter: 12
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: sk_...
      type: http

````

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