---
title: "Modifies a user's role in the organization."
url: "https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1/operations/modify-user"
---

> Full API specification: https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1.md

# Modifies a user's role in the organization.

`POST` `/organization/users/{user_id}`

Operation ID: `modify-user`

## Path parameters

- `user_id` (string, required) - The ID of the user.

## Request body (required)

Content types: `application/json`

## Responses

- `200` - User role updated successfully.

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: OpenAI API
  version: 2.3.0
servers:
  - url: https://api.openai.com/v1
paths:
  /organization/users/{user_id}:
    post:
      summary: Modifies a user's role in the organization.
      operationId: modify-user
      tags:
        - Users
      parameters:
        - name: user_id
          in: path
          description: The ID of the user.
          required: true
          schema:
            type: string
      requestBody:
        description: The new user role to modify. This must be one of `owner` or `member`.
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UserRoleUpdateRequest"
      responses:
        "200":
          description: User role updated successfully.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/User"
      x-oaiMeta:
        name: Modify user
        group: administration
        returns: The updated [User](/docs/api-reference/users/object) object.
        examples:
          request:
            curl: >
              curl -X POST https://api.openai.com/v1/organization/users/user_abc
              \
                -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
                -H "Content-Type: application/json" \
                -d '{
                    "role": "owner"
                }'
          response: |
            {
                "object": "organization.user",
                "id": "user_abc",
                "name": "First Last",
                "email": "user@example.com",
                "role": "owner",
                "added_at": 1711471533
            }
security:
  - ApiKeyAuth: []
components:
  schemas:
    UserRoleUpdateRequest:
      type: object
      properties:
        role:
          type: string
          enum:
            - owner
            - reader
          description: "`owner` or `reader`"
      required:
        - role
    User:
      type: object
      description: Represents an individual `user` within an organization.
      properties:
        object:
          type: string
          enum:
            - organization.user
          description: The object type, which is always `organization.user`
          x-stainless-const: true
        id:
          type: string
          description: The identifier, which can be referenced in API endpoints
        name:
          type: string
          description: The name of the user
        email:
          type: string
          description: The email address of the user
        role:
          type: string
          enum:
            - owner
            - reader
          description: "`owner` or `reader`"
        added_at:
          type: integer
          description: The Unix timestamp (in seconds) of when the user was added.
      required:
        - object
        - id
        - name
        - email
        - role
        - added_at
      x-oaiMeta:
        name: The user object
        example: |
          {
              "object": "organization.user",
              "id": "user_abc",
              "name": "First Last",
              "email": "user@example.com",
              "role": "owner",
              "added_at": 1711471533
          }
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
```
