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

# Create or Update a User



## OpenAPI

````yaml post /v3/users
openapi: 3.0.2
info:
  title: Captain Data's Public API
  description: Captain Data's API v3
  version: 3.0.0
servers: []
security:
  - APIKeyHeader: []
    ProjectIdHeader: []
tags:
  - name: Workspace
    description: Endpoints related to workspace management
  - name: Users
    description: Endpoints related to users management
  - name: Integrations
    description: Endpoints related to integration accounts management
  - name: Workflows
    description: Endpoints related to running Workflows
  - name: Runs
    description: Endpoints related to fetching Run's Results & details
  - name: Inputs
    description: Endpoints related to fetching Run's Inputs
  - name: Webhooks
    description: Endpoints related to Webhooks management
paths:
  /v3/users:
    post:
      tags:
        - Users
      summary: Create or Update a User
      operationId: v3_create_update_user
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUpdateUser'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
              example:
                user:
                  uid: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
                  email: example@example.com
                  first_name: John
                  last_name: Doe
                  full_name: John Doe
                  country: US
                  project_uid: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
                  accounts: []
                message: User created.
        '422':
          description: >-
            Unprocessable Entity: The request contains invalid or improperly
            formatted data.
          content:
            application/json:
              schema: {}
              example:
                message: >-
                  Country code is not formatted correctly. Please use ISO 3166-1
                  alpha-2 codes (e.g., 'us' or 'US' for United States)
      security:
        - APIKeyHeader: []
          ProjectIdHeader: []
components:
  schemas:
    CreateUpdateUser:
      title: Create or Update User
      type: object
      properties:
        email:
          type: string
          description: The email address of the user.
        full_name:
          type: string
          description: The full name of the user.
        country:
          type: string
          description: >-
            ISO 3166-1 alpha-2 country code, e.g., 'us' or 'US' for United
            States.
        timezone:
          type: string
          description: The user's timezone.
        uid:
          type: string
          description: >-
            Leave empty to create a new user; provide a UID to update an
            existing user.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        The Authorization header must include 'x-api-key' followed by your API
        key (e.g., 'Authorization: x-api-key YOUR_API_KEY').
    ProjectIdHeader:
      type: apiKey
      in: header
      name: x-project-id
      description: Workspace UID required to identify the workspace.

````