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

# Create User

> **/user/**

<Note>
  This endpoint requires authentication. Include your Bearer token in the Authorization header.
</Note>

## Description

**/user/**

**Description:**\
The `/user/` endpoint allows the creation of a single user by providing their details, such as first name, last name, nickname, user type, and email address.

**Method:**\
`POST`

**Request Payload:**

| Parameter                  | Type    | Description                                                    |
| -------------------------- | ------- | -------------------------------------------------------------- |
| firstName                  | string  | The first name of the user.                                    |
| lastName                   | string  | The last name of the user.                                     |
| nickName                   | string  | The nickname of the user.                                      |
| userType                   | string  | The type of user (e.g., Artist, Manager).                      |
| email                      | string  | The email address of the user.                                 |
| ipi *(Optional)*           | string  | The IPI (Interested Parties Information) of the user.          |
| role                       | string  | The role of the user in the workspace                          |
| phone *(Optional)*         | string  | The user's phone number.                                       |
| country *(Optional)*       | string  | The user's country.                                            |
| sendEmail *(Optional)*     | boolean | This sends an invite email to the user, by default it is true. |
| redirect\_url *(Optional)* | string  | The URL to redirect the user to after the creation.            |
| message *(Optional)*       | string  | For passing the invite email custom message.                   |

## Code Examples

<CodeGroup>
  ```javascript Node.js theme={null}
  const response = await fetch('https://api.royalti.io/user/', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      "firstName": "sample-firstName",
      "lastName": "sample-lastName",
      "nickName": "sample-nickName",
      "email": "sample-email",
      "ipi": "sample-ipi",
      "role": "sample-role",
      "phone": "sample-phone",
      "country": "sample-country",
      "sendEmail": true,
      "redirect_url": "sample-redirect_url",
      "message": "sample-message"
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
    'https://api.royalti.io/user/',
    headers={
      'Authorization': f'Bearer {token}'
    },
    json={"firstName":"sample-firstName","lastName":"sample-lastName","nickName":"sample-nickName","email":"sample-email","ipi":"sample-ipi","role":"sample-role","phone":"sample-phone","country":"sample-country","sendEmail":true,"redirect_url":"sample-redirect_url","message":"sample-message"}
  )

  data = response.json()
  print(data)
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.royalti.io/user/ \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"firstName":"sample-firstName","lastName":"sample-lastName","nickName":"sample-nickName","email":"sample-email","ipi":"sample-ipi","role":"sample-role","phone":"sample-phone","country":"sample-country","sendEmail":true,"redirect_url":"sample-redirect_url","message":"sample-message"}'

  ```
</CodeGroup>


## OpenAPI

````yaml post /user/
openapi: 3.0.0
info:
  title: Royalti.io API
  description: "# Royalti API\r\n\r\nThis is the Royalti music royalty management platform API server.\r\n\r\n## Overview\r\n\r\nThe Royalti API provides comprehensive music royalty management services including:\r\n- Music publishing and writer management\r\n- Royalty processing and analytics\r\n- DDEX integration for music industry standards\r\n- File processing and pattern recognition\r\n- Payment processing and distribution\r\n\r\n## Authentication\r\n\r\nThe API uses JWT-based authentication with multiple protection levels:\r\n- Public endpoints for basic operations\r\n- Protected endpoints requiring valid JWT tokens\r\n- Admin endpoints for administrative functions\r\n\r\n## Features\r\n\r\n- Multi-dimensional royalty analytics\r\n- CWR (Collective Works Registration) support\r\n- DDEX integration for music metadata\r\n- Advanced file processing with pattern recognition\r\n- Real-time data processing with queue system"
  version: 2.6.0
  contact:
    name: Royalti.io Support
    email: support@royalti.io
    url: https://royalti.io
  license:
    name: Proprietary
    url: https://royalti.io/terms
servers:
  - url: https://api.royalti.io
    description: Production server
  - url: https://api-dev.royalti.io
    description: Development server
  - url: http://localhost:8084
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Accounting
    description: Accounting and financial transaction operations
  - name: DDEX
    description: DDEX operations (ERN/MEAD, messages, delivery, providers)
  - name: Label
    description: Label management operations
  - name: Internal Webhooks
    description: Internal system webhooks for royalty processing and downloads
  - name: Payment Webhooks
    description: Payment processor webhook endpoints
  - name: Billing Webhooks
    description: Stripe billing and subscription webhooks
  - name: Infrastructure Webhooks
    description: Cloudflare domain and SSL webhooks
  - name: Distribution Webhooks
    description: Digital distribution platform webhooks (FUGA)
paths:
  /user/:
    post:
      tags:
        - User
      summary: Create User
      description: >-
        **/user/**


        **Description:**  

        The `/user/` endpoint allows the creation of a single user by providing
        their details, such as first name, last name, nickname, user type, and
        email address.


        **Method:**  

        `POST`


        **Request Payload:**


        | Parameter | Type | Description |

        | --- | --- | --- |

        | firstName | string | The first name of the user. |

        | lastName | string | The last name of the user. |

        | nickName | string | The nickname of the user. |

        | userType | string | The type of user (e.g., Artist, Manager). |

        | email | string | The email address of the user. |

        | ipi _(Optional)_ | string | The IPI (Interested Parties Information)
        of the user. |

        | role | string | The role of the user in the workspace |

        | phone _(Optional)_ | string | The user's phone number. |

        | country _(Optional)_ | string | The user's country. |

        | sendEmail _(Optional)_ | boolean | This sends an invite email to the
        user, by default it is true. |

        | redirect_url _(Optional)_ | string | The URL to redirect the user to
        after the creation. |

        | message _(Optional)_ | string | For passing the invite email custom
        message. |
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                firstName:
                  type: string
                  description: The first name of the user
                lastName:
                  type: string
                  description: The last name of the user
                nickName:
                  type: string
                  description: The nickname of the user
                userType:
                  oneOf:
                    - type: string
                    - type: array
                      items:
                        type: string
                  description: >-
                    The type of user (e.g., Artist, Manager). Can be a string or
                    array of strings.
                email:
                  type: string
                  format: email
                  description: The email address of the user
                ipi:
                  type: string
                  description: The IPI (Interested Parties Information) of the user
                role:
                  type: string
                  description: The role of the user in the workspace
                phone:
                  type: string
                  description: The user's phone number
                country:
                  type: string
                  description: The user's country
                sendEmail:
                  type: boolean
                  description: >-
                    This sends an invite email to the user, by default it is
                    true
                  default: true
                redirect_url:
                  type: string
                  description: The URL to redirect the user to after the creation
                message:
                  type: string
                  description: For passing the invite email custom message
              required:
                - firstName
                - lastName
                - nickName
                - userType
                - role
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  fullName:
                    type: string
                  id:
                    type: string
                  isVerified:
                    type: boolean
                  isActive:
                    type: boolean
                  firstName:
                    type: string
                  lastName:
                    type: string
                  TenantUsers:
                    type: array
                    items:
                      type: object
                  email:
                    type: string
                  updatedAt:
                    type: string
                    format: date-time
                  createdAt:
                    type: string
                    format: date-time
                  externalId:
                    type: string
                    nullable: true
                  phone:
                    type: string
                    nullable: true
                  country:
                    type: string
                    nullable: true
                  ipi:
                    type: string
                    nullable: true
                  role:
                    type: string
                    nullable: true
              example:
                fullName: Emmanuel Royalti
                phone: '+1234567890'
                country: Nigeria
                message: Welcome to Royalti!
                sendEmail: true
                redirect_url: https://app.royalti.io/welcome
                id: 3d5c9971-451e-4711-8874-ff498d55e601
                isVerified: false
                isActive: false
                firstName: Emmanuel
                lastName: Royalti
                TenantUsers:
                  - UserId: 3d5c9971-451e-4711-8874-ff498d55e601
                    TenantId: 1
                    nickName: iEmmanuel104
                    userType:
                      - Artist
                    paymentSettings: null
                    lastLogin: null
                    permissions: null
                email: emmanuel@royalti.io
                updatedAt: '2023-02-19T11:26:45.512Z'
                createdAt: '2023-02-19T11:26:45.512Z'
                externalId: null
                ipi: null
                role: null
        '400':
          description: Error - Prior Email Association with workspace
          content:
            application/json:
              schema:
                type: object
                properties:
                  msg:
                    type: string
              example:
                msg: User Email provided already associated with workspace!
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: array
              items:
                type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Authorization header using the Bearer scheme. Format: "Bearer
        {token}"

````