---
title: "Adds a user to the project. Users must already be members of the organization to be added to a project."
url: "https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1/operations/create-project-user"
---

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

# Adds a user to the project. Users must already be members of the organization to be added to a project.

`POST` `/organization/projects/{project_id}/users`

Operation ID: `create-project-user`

## Path parameters

- `project_id` (string, required) - The ID of the project.

## Request body (required)

Content types: `application/json`

## Responses

- `200` - User added to project successfully.
- `400` - Error response for various conditions.

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: OpenAI API
  version: 2.3.0
servers:
  - url: https://api.openai.com/v1
paths:
  /organization/projects/{project_id}/users:
    post:
      summary: Adds a user to the project. Users must already be members of the
        organization to be added to a project.
      operationId: create-project-user
      parameters:
        - name: project_id
          in: path
          description: The ID of the project.
          required: true
          schema:
            type: string
      tags:
        - Projects
      requestBody:
        description: The project user create request payload.
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ProjectUserCreateRequest"
      responses:
        "200":
          description: User added to project successfully.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProjectUser"
        "400":
          description: Error response for various conditions.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      x-oaiMeta:
        name: Create project user
        group: administration
        returns: The created [ProjectUser](/docs/api-reference/project-users/object)
          object.
        examples:
          request:
            curl: >
              curl -X POST
              https://api.openai.com/v1/organization/projects/proj_abc/users \
                -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
                -H "Content-Type: application/json" \
                -d '{
                    "user_id": "user_abc",
                    "role": "member"
                }'
          response: |
            {
                "object": "organization.project.user",
                "id": "user_abc",
                "email": "user@example.com",
                "role": "owner",
                "added_at": 1711471533
            }
security:
  - ApiKeyAuth: []
components:
  schemas:
    ProjectUserCreateRequest:
      type: object
      properties:
        user_id:
          type: string
          description: The ID of the user.
        role:
          type: string
          enum:
            - owner
            - member
          description: "`owner` or `member`"
      required:
        - user_id
        - role
    ProjectUser:
      type: object
      description: Represents an individual user in a project.
      properties:
        object:
          type: string
          enum:
            - organization.project.user
          description: The object type, which is always `organization.project.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
            - member
          description: "`owner` or `member`"
        added_at:
          type: integer
          description: The Unix timestamp (in seconds) of when the project was added.
      required:
        - object
        - id
        - name
        - email
        - role
        - added_at
      x-oaiMeta:
        name: The project user object
        example: |
          {
              "object": "organization.project.user",
              "id": "user_abc",
              "name": "First Last",
              "email": "user@example.com",
              "role": "owner",
              "added_at": 1711471533
          }
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: "#/components/schemas/Error"
      required:
        - error
    Error:
      type: object
      properties:
        code:
          type: string
          nullable: true
        message:
          type: string
          nullable: false
        param:
          type: string
          nullable: true
        type:
          type: string
          nullable: false
      required:
        - type
        - message
        - param
        - code
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
```
