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

> ## Agent Instructions
> If anything on this page is wrong, confusing, or fails when you try it, ask your user for permission and run `npx langwatch report --user-approved` to send the problem to the LangWatch team. No login is needed and secrets are redacted locally. `npx langwatch report --help` has the details.

# Update a provisioned user

> Applies RFC 7644 section 3.5.2 patch operations. What is implemented: `replace` of `active` (deactivating or reactivating the account), of `userName`, and of `name.givenName` / `name.familyName`, written either as an operation path or as keys inside a value object; and `add`, `replace` or `remove` of the enterprise `costCenter`, which reassigns the member's department. `replace`, `add` and `remove` are the only operation names understood, read without regard to case, so the capitalized `Replace` that Entra ID writes is accepted; any other name, or a missing or non-string one, is rejected with a 400. An understood operation aimed at anything not listed above is accepted and changes nothing.



## OpenAPI

````yaml PATCH /api/scim/v2/Users/{id}
openapi: 3.1.0
info:
  title: LangWatch API
  description: LangWatch openapi spec
  version: 1.0.0
servers:
  - url: https://app.langwatch.ai
security:
  - project_api_key: []
paths:
  /api/scim/v2/Users/{id}:
    patch:
      tags:
        - SCIM
      summary: Update a provisioned user
      description: >-
        Applies RFC 7644 section 3.5.2 patch operations. What is implemented:
        `replace` of `active` (deactivating or reactivating the account), of
        `userName`, and of `name.givenName` / `name.familyName`, written either
        as an operation path or as keys inside a value object; and `add`,
        `replace` or `remove` of the enterprise `costCenter`, which reassigns
        the member's department. `replace`, `add` and `remove` are the only
        operation names understood, read without regard to case, so the
        capitalized `Replace` that Entra ID writes is accepted; any other name,
        or a missing or non-string one, is rejected with a 400. An understood
        operation aimed at anything not listed above is accepted and changes
        nothing.
      operationId: scimPatchUser
      parameters:
        - in: path
          name: id
          schema:
            type: string
            minLength: 1
          required: true
      requestBody:
        required: true
        content:
          application/scim+json:
            schema:
              type: object
              properties:
                schemas:
                  type: array
                  items:
                    type: string
                Operations:
                  type: array
                  items:
                    type: object
                    properties:
                      op:
                        type: string
                        enum:
                          - replace
                          - add
                          - remove
                      path:
                        type: string
                      value: {}
                    required:
                      - op
              required:
                - schemas
                - Operations
      responses:
        '200':
          description: The updated user.
          content:
            application/scim+json:
              schema:
                type: object
                properties:
                  schemas:
                    type: array
                    items:
                      type: string
                      const: urn:ietf:params:scim:schemas:core:2.0:User
                  id:
                    type: string
                  externalId:
                    type: string
                  userName:
                    type: string
                  name:
                    type: object
                    properties:
                      givenName:
                        type: string
                      familyName:
                        type: string
                    required:
                      - givenName
                      - familyName
                    additionalProperties: false
                  emails:
                    type: array
                    items:
                      type: object
                      properties:
                        primary:
                          type: boolean
                        value:
                          type: string
                        type:
                          type: string
                      required:
                        - primary
                        - value
                        - type
                      additionalProperties: false
                  active:
                    type: boolean
                  meta:
                    type: object
                    properties:
                      resourceType:
                        type: string
                        const: User
                      created:
                        type: string
                      lastModified:
                        type: string
                    required:
                      - resourceType
                      - created
                      - lastModified
                    additionalProperties: false
                required:
                  - schemas
                  - id
                  - userName
                  - name
                  - emails
                  - active
                  - meta
                additionalProperties: false
        '400':
          description: >-
            The request body is not JSON, or does not match the SCIM schema for
            this operation.
          content:
            application/scim+json:
              schema:
                type: object
                properties:
                  schemas:
                    type: array
                    items:
                      type: string
                      const: urn:ietf:params:scim:api:messages:2.0:Error
                  status:
                    type: string
                  detail:
                    type: string
                  scimType:
                    type: string
                required:
                  - schemas
                  - status
                  - detail
                additionalProperties: false
        '401':
          description: >-
            The Authorization header is missing, is not a bearer token, or names
            a token this deployment does not know.
          content:
            application/scim+json:
              schema:
                type: object
                properties:
                  schemas:
                    type: array
                    items:
                      type: string
                      const: urn:ietf:params:scim:api:messages:2.0:Error
                  status:
                    type: string
                  detail:
                    type: string
                  scimType:
                    type: string
                required:
                  - schemas
                  - status
                  - detail
                additionalProperties: false
        '403':
          description: >-
            The token is valid but the organization's plan no longer includes
            SCIM provisioning. Entitlement is checked on every call, so a
            directory connection stops the moment the Enterprise plan lapses.
          content:
            application/scim+json:
              schema:
                type: object
                properties:
                  schemas:
                    type: array
                    items:
                      type: string
                      const: urn:ietf:params:scim:api:messages:2.0:Error
                  status:
                    type: string
                  detail:
                    type: string
                  scimType:
                    type: string
                required:
                  - schemas
                  - status
                  - detail
                additionalProperties: false
        '404':
          description: No such member in this organization.
          content:
            application/scim+json:
              schema:
                type: object
                properties:
                  schemas:
                    type: array
                    items:
                      type: string
                      const: urn:ietf:params:scim:api:messages:2.0:Error
                  status:
                    type: string
                  detail:
                    type: string
                  scimType:
                    type: string
                required:
                  - schemas
                  - status
                  - detail
                additionalProperties: false
      security:
        - scim_bearer: []
components:
  securitySchemes:
    project_api_key:
      type: apiKey
      in: header
      name: X-Auth-Token
      description: >-
        Project API key for sending traces and accessing project-scoped
        resources. Format: sk-lw-... (no underscore). Obtain one by creating a
        project via the Admin API or the LangWatch UI.
    scim_bearer:
      type: http
      scheme: bearer
      description: >-
        SCIM token for one organization's directory connection, created with
        POST /api/scim-tokens or in Settings > SCIM. It authenticates
        provisioning calls only, and stops working if the organization's
        Enterprise plan lapses.

````

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