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

# Set consumer permissions

> Sets what members with the Consumer account role (and guests from other Devic accounts) can do in a shared workspace. **Workspace owner only**, acting as a person: an API key without `X-Devic-User` acts as a manager and is refused with `WORKSPACE_OWNER_REQUIRED`.

The body is a complete replacement: send all 14 keys. `revision` is the workspace's `policyRevision`; a stale one returns `409 WORKSPACE_REVISION_CONFLICT`. Missing or unknown keys return `400 INVALID_CONSUMER_PERMISSIONS`. Personal workspaces have no policy.

An action the policy turns off is refused with `403` and `{ error: "WORKSPACE_CONSUMER_PERMISSION_DENIED", permission: "<key>" }`.



## OpenAPI

````yaml PATCH /v1/workspaces/{wid}/consumer-permissions
openapi: 3.0.0
info:
  title: Devic.ai Public API
  description: >-
    Devic.ai is an AI platform that allows you to create, manage, and use AI
    agents for various tasks.
  version: 1.0.0
  contact:
    name: Devic.ai Support
    url: https://devic.ai
  x-logo:
    url: https://devic.ai/logo.png
    altText: Devic.ai Logo
  x-summary: Public API for interacting with Devic.ai platform
servers:
  - url: https://api.devic.ai
    description: Production server
  - url: https://staging-api.devic.ai
    description: Staging server
security:
  - bearerAuth: []
tags:
  - name: Environments
    description: >-
      The machine an agent works on and everything it may reach: sandbox,
      snapshot, knowledge, tools and encrypted variables
  - name: Sandboxes
    description: >-
      Start a real Linux machine on an environment, run commands and files on
      it, and save its snapshot
  - name: Projects
    description: Group agents, assistants, documents and costs into projects
  - name: Documents
    description: >-
      Knowledge base documents: create, version, attach and index markdown
      content for RAG
  - name: Document Folders
    description: Organise knowledge base documents into folders and attach them in bulk
  - name: Files
    description: Upload files and obtain shareable download URLs to attach to messages
  - name: Agents
    description: Endpoints related to AI agents and their operations
  - name: Assistants
    description: Endpoints for interacting with assistants and their specializations
  - name: Tool Servers
    description: Endpoints for managing tool servers and their tool definitions
  - name: Health
    description: API health check endpoints
  - name: Documentation
    description: Endpoints for retrieving markdown documentation
  - name: Integrations
    description: Connect third-party apps and turn them into tools
  - name: Triggers
    description: Start an agent or an assistant from an app event
  - name: Tenant Integrations
    description: Apps that each end user connects for themselves
  - name: Memory
    description: What an assistant remembers between conversations
  - name: Skills
    description: Reusable instruction packs for agents and assistants
  - name: Speech to Text
    description: Audio transcription
  - name: Tenants
    description: Tenants, subtenants and their usage
  - name: MCP Gateway
    description: One MCP endpoint over many servers, with visibility per user
  - name: Tenant Sessions
    description: Tokens that prove which end user is calling
  - name: Workspaces
    description: Shared spaces where people and assistants work in threads
  - name: Workspace Threads
    description: Threads, messages, read state and assistant runs
  - name: Workspace Files
    description: Files and documents of workspaces and threads
  - name: Workspace Configuration
    description: Members, assistants, knowledge, skills and rules
  - name: Workspace Memory
    description: Core memory of the assistants of a workspace
  - name: Workspace Automations
    description: Scheduled and triggered work of a workspace
  - name: Workspace Integrations
    description: >-
      App accounts a workspace can use, and connecting a new one through an
      authorization link.
paths:
  /v1/workspaces/{wid}/consumer-permissions:
    patch:
      tags:
        - Workspaces
      summary: Set consumer permissions
      description: >-
        Sets what members with the Consumer account role (and guests from other
        Devic accounts) can do in a shared workspace. **Workspace owner only**,
        acting as a person: an API key without `X-Devic-User` acts as a manager
        and is refused with `WORKSPACE_OWNER_REQUIRED`.


        The body is a complete replacement: send all 14 keys. `revision` is the
        workspace's `policyRevision`; a stale one returns `409
        WORKSPACE_REVISION_CONFLICT`. Missing or unknown keys return `400
        INVALID_CONSUMER_PERMISSIONS`. Personal workspaces have no policy.


        An action the policy turns off is refused with `403` and `{ error:
        "WORKSPACE_CONSUMER_PERMISSION_DENIED", permission: "<key>" }`.
      operationId: setWorkspaceConsumerPermissions
      parameters:
        - $ref: '#/components/parameters/XDevicUser'
        - name: wid
          in: path
          required: true
          description: Workspace id
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkspaceConsumerPermissionsInput'
            example:
              revision: 7
              consumerPermissions:
                write: true
                createThreads: false
                uploadFiles: true
                editCanvas: true
                editThreadRules: false
                editCoreMemory: false
                useSharedConnections: true
                usePersonalConnections: true
                editWorkspaceRules: false
                manageAssistants: false
                manageSkills: false
                manageAutomations: false
                manageSharedConnections: false
                inviteMembers: false
      responses:
        '200':
          description: 'Success — wrapped as `{ success: true, data }`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/WorkspaceSummary'
        '400':
          description: >-
            `INVALID_CONSUMER_PERMISSIONS` — a key is missing, unknown or not a
            boolean; or a personal workspace
        '401':
          description: Unauthorized — missing or invalid credential
        '403':
          description: >-
            `WORKSPACE_OWNER_REQUIRED` — only the workspace owner, as a person,
            can change the policy
        '404':
          description: Not found
        '409':
          description: >-
            `WORKSPACE_REVISION_CONFLICT` — `revision` is not the current
            `policyRevision`
      security:
        - bearerAuth: []
components:
  parameters:
    XDevicUser:
      name: X-Devic-User
      in: header
      required: false
      schema:
        type: string
      description: >-
        Only with an **API key**: the userUID or email of a person of the key's
        account to act as, with that person's permissions. Without it, an API
        key acts as the account integration ("API"), which sees shared
        workspaces only. A person's token cannot name someone else.
  schemas:
    WorkspaceConsumerPermissionsInput:
      type: object
      required:
        - revision
        - consumerPermissions
      properties:
        revision:
          type: integer
          description: The workspace's current `policyRevision` (not `revision`).
        consumerPermissions:
          $ref: '#/components/schemas/WorkspaceConsumerPermissions'
    WorkspaceSummary:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        kind:
          type: string
          enum:
            - personal
            - shared
        visibility:
          type: string
        archived:
          type: boolean
        revision:
          type: integer
        members:
          type: array
          items:
            type: object
            additionalProperties: true
        assistants:
          type: array
          items:
            type: object
            additionalProperties: true
        summary:
          type: object
          description: >-
            With `withSummary=true`: threadCount, unreadCount, documentCount,
            lastActivityAt…
          additionalProperties: true
        policyRevision:
          type: integer
          description: >-
            Revision of the workspace's policies; send it to `PATCH
            /v1/workspaces/{wid}/consumer-permissions`.
        consumerPermissions:
          $ref: '#/components/schemas/WorkspaceConsumerPermissions'
        capabilities:
          type: object
          additionalProperties: true
          description: >-
            What the caller may do here. `manageConsumerPermissions` is true
            only for the workspace owner; `permissions` is the consumer policy
            that applies to the caller, when one does.
          properties:
            manageConsumerPermissions:
              type: boolean
            permissions:
              $ref: '#/components/schemas/WorkspaceConsumerPermissions'
    WorkspaceConsumerPermissions:
      type: object
      description: >-
        What members and viewers whose account role is `consumer`, and guests
        from other accounts, may do in a shared workspace. Owners and managers
        keep their role's permissions; viewers stay read-only.
      required:
        - write
        - createThreads
        - uploadFiles
        - editCanvas
        - editThreadRules
        - editCoreMemory
        - useSharedConnections
        - usePersonalConnections
        - editWorkspaceRules
        - manageAssistants
        - manageSkills
        - manageAutomations
        - manageSharedConnections
        - inviteMembers
      additionalProperties: false
      properties:
        write:
          type: boolean
          default: true
          description: Participate in threads and run assistants. Every other key needs it
        createThreads:
          type: boolean
          default: true
          description: Create threads
        uploadFiles:
          type: boolean
          default: true
          description: Upload, publish and remove thread files
        editCanvas:
          type: boolean
          default: true
          description: Edit the thread canvas
        editThreadRules:
          type: boolean
          default: false
          description: Edit thread rules
        editCoreMemory:
          type: boolean
          default: false
          description: Edit assistants' shared core memory
        useSharedConnections:
          type: boolean
          default: true
          description: Use the workspace's shared integrations
        usePersonalConnections:
          type: boolean
          default: true
          description: Connect and use their own integrations
        editWorkspaceRules:
          type: boolean
          default: false
          description: Edit workspace rules (internal members only)
        manageAssistants:
          type: boolean
          default: false
          description: Create and configure workspace assistants (internal members only)
        manageSkills:
          type: boolean
          default: false
          description: Manage workspace skills (internal members only)
        manageAutomations:
          type: boolean
          default: false
          description: Manage workspace automations (internal members only)
        manageSharedConnections:
          type: boolean
          default: false
          description: Manage shared integrations and MCP servers (internal members only)
        inviteMembers:
          type: boolean
          default: false
          description: Invite members and viewers (internal members only)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API key from your Devic console, sent as `Authorization: Bearer
        <key>`. An embedded front end sends a tenant-session token instead, so
        no API key reaches the browser, and an OAuth integration sends its
        access token. Missing, invalid or expired credentials get a `401`. See
        [Authentication](/api-reference/introduction#authentication).

````

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