> ## Documentation Index
> Fetch the complete documentation index at: https://cubed3-feat-druid-driver-streaming.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Patch user

> Applies a partial update to a user using a SCIM
[PatchOp](https://datatracker.ietf.org/doc/html/rfc7644#section-3.5.2).
Commonly used to deactivate a user by setting `active` to `false`.




## OpenAPI

````yaml /api-reference/scim.yaml patch /scim/v2/Users/{id}
openapi: 3.1.0
info:
  title: Cube Cloud SCIM API
  version: 1.0.0
  description: >
    The SCIM 2.0 API lets identity providers (Okta, Azure AD/Entra ID, OneLogin,

    and others) provision and de-provision users and groups in Cube Cloud

    automatically. It implements the System for Cross-domain Identity Management

    protocol as defined in [RFC
    7643](https://datatracker.ietf.org/doc/html/rfc7643)

    and [RFC 7644](https://datatracker.ietf.org/doc/html/rfc7644).


    ## Base URL


    All SCIM endpoints live under the `/scim/v2` namespace on your Cube Cloud

    tenant's API host:


    ```text

    https://<tenant>.cubecloud.dev/api/scim/v2

    ```


    Replace `<tenant>` with your Cube Cloud subdomain, or swap the whole host

    if your account uses a custom domain.


    ## Authentication


    SCIM requests are authenticated with a bearer token issued from your Cube

    Cloud account settings. Include it in the `Authorization` header:


    ```text

    Authorization: Bearer <YOUR_SCIM_TOKEN>

    ```


    ## Content type


    Requests and responses use `application/json`. The SCIM media type

    `application/scim+json` is also accepted.
servers:
  - url: https://{tenant}.cubecloud.dev/api
    description: >-
      Cube Cloud API base URL. Replace the whole host if you use a custom
      domain.
    variables:
      tenant:
        default: your-tenant
        description: Your Cube Cloud tenant subdomain
security:
  - bearerAuth: []
tags:
  - name: SCIM Users
    description: Provision, read, update, and de-provision users.
  - name: SCIM Groups
    description: Provision, read, update, and de-provision groups and their memberships.
paths:
  /scim/v2/Users/{id}:
    patch:
      tags:
        - SCIM Users
      summary: Patch user
      description: |
        Applies a partial update to a user using a SCIM
        [PatchOp](https://datatracker.ietf.org/doc/html/rfc7644#section-3.5.2).
        Commonly used to deactivate a user by setting `active` to `false`.
      operationId: patchUser
      parameters:
        - $ref: '#/components/parameters/ResourceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchOp'
            example:
              schemas:
                - urn:ietf:params:scim:api:messages:2.0:PatchOp
              Operations:
                - op: replace
                  path: active
                  value: false
      responses:
        '200':
          description: The updated user.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    ResourceId:
      name: id
      in: path
      required: true
      description: The unique SCIM identifier of the resource.
      schema:
        type: string
  schemas:
    PatchOp:
      type: object
      description: A SCIM 2.0 PatchOp request.
      required:
        - schemas
        - Operations
      properties:
        schemas:
          type: array
          items:
            type: string
          example:
            - urn:ietf:params:scim:api:messages:2.0:PatchOp
        Operations:
          type: array
          items:
            type: object
            required:
              - op
            properties:
              op:
                type: string
                enum:
                  - add
                  - remove
                  - replace
              path:
                type: string
              value: {}
    User:
      type: object
      description: A SCIM 2.0 core User resource.
      required:
        - userName
      properties:
        schemas:
          type: array
          items:
            type: string
          example:
            - urn:ietf:params:scim:schemas:core:2.0:User
        id:
          type: string
          description: Unique identifier assigned by Cube Cloud. Read-only.
          readOnly: true
        userName:
          type: string
          description: Unique identifier for the user, typically their email address.
        name:
          type: object
          properties:
            givenName:
              type: string
            familyName:
              type: string
        emails:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
              primary:
                type: boolean
        active:
          type: boolean
          description: Whether the user is active. Set to `false` to deactivate.
        externalId:
          type: string
          description: Identifier of the user as defined by the provisioning client.
        meta:
          $ref: '#/components/schemas/Meta'
    Meta:
      type: object
      readOnly: true
      properties:
        resourceType:
          type: string
        created:
          type: string
          format: date-time
        lastModified:
          type: string
          format: date-time
        location:
          type: string
    Error:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          example:
            - urn:ietf:params:scim:api:messages:2.0:Error
        status:
          type: string
        detail:
          type: string
  responses:
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            schemas:
              - urn:ietf:params:scim:api:messages:2.0:Error
            status: '404'
            detail: Resource not found.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: SCIM bearer token issued from your Cube Cloud account settings.

````