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

# Update user

> Update user permissions in the organization.



## OpenAPI

````yaml patch /organization/users/{user_id}
openapi: 3.0.3
info:
  version: 0.1.1
  title: Datagrid API
  description: Datagrid API
servers:
  - url: https://api.datagrid.com/v1
security:
  - BearerAuth: []
paths:
  /organization/users/{user_id}:
    patch:
      tags:
        - Users
      summary: Update user
      description: Update user permissions in the organization.
      operationId: Users.updateOrganizationUser
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
          description: The ID of the user
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrganizationUser'
      responses:
        '200':
          description: User updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationUser'
        '429':
          description: >-
            Rate limit exceeded. The request has been throttled because the rate
            limit for this endpoint has been reached. Check the `Retry-After`
            response header and retry after the specified number of seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Datagrid from 'datagrid-ai';


            const client = new Datagrid({
              apiKey: process.env['DATAGRID_API_KEY'], // This is the default and can be omitted
            });


            const organizationUser = await
            client.organization.users.update('user_id', { role: 'admin' });


            console.log(organizationUser.id);
        - lang: Python
          source: |-
            import os
            from datagrid_ai import Datagrid

            client = Datagrid(
                api_key=os.environ.get("DATAGRID_API_KEY"),  # This is the default and can be omitted
            )
            organization_user = client.organization.users.update(
                user_id="user_id",
                role="admin",
            )
            print(organization_user.id)
components:
  schemas:
    UpdateOrganizationUser:
      type: object
      description: Represents a user in an organization
      required:
        - role
      properties:
        role:
          type: string
          enum:
            - admin
            - member
          description: >-
            The role to assign to the user in the organization. Available roles:
            admin, member
    OrganizationUser:
      type: object
      description: Represents a user in an organization
      required:
        - id
        - email
        - first_name
        - last_name
        - permissions
      properties:
        id:
          type: string
          description: The unique identifier of the user
        email:
          type: string
          format: email
          description: The email address of the user
        first_name:
          type: string
          description: The first name of the user
        last_name:
          type: string
          description: The last name of the user
        permissions:
          $ref: '#/components/schemas/OrganizationUserPermissions'
          description: The roles assigned to the user in the organization
    RateLimitError:
      type: object
      description: >-
        Returned when the rate limit is exceeded. Rate limits are enforced per
        teamspace, endpoint path, and HTTP method over a 60-second sliding
        window. Each endpoint may have its own limit — check the
        X-RateLimit-Limit response header for the effective value.
      required:
        - error
        - message
        - retryable
        - status_code
      properties:
        status_code:
          type: integer
          description: The HTTP status code (429).
        statusCode:
          type: integer
          deprecated: true
          description: Deprecated. Use status_code instead.
        error:
          type: string
          enum:
            - rate_limit_exceeded
          description: The error code identifying this as a rate limit error.
        message:
          type: string
          description: A human-readable error message.
        mitigation:
          type: string
          description: Suggested action to resolve the error.
        retryable:
          type: boolean
          description: Whether the request can be retried after a delay.
        details:
          type: object
          properties:
            reason:
              type: string
              description: A detailed explanation of why the rate limit was exceeded.
    OrganizationUserPermissions:
      type: object
      description: Represents a permission assigned to a user
      required:
        - role
      properties:
        role:
          type: string
          enum:
            - owner
            - admin
            - member
            - contributor
            - collaborator
          description: >
            The role to assign to the user in the organization. Available roles:

            - **owner**: Organization owner. Can manage organization settings,
            users and create new teamspaces.

            - **admin**: Organization administrator. Can manage organization
            settings, users and create new teamspaces.

            - **member**: Standard organization member. Can create new
            teamspaces.

            - **contributor**: Limited access. Can read shared resources. Cannot
            create new teamspaces.

            - **collaborator**: Limited access. Cannot read shared resources.
            Cannot create new teamspaces.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````