# Creating a user The steps below explain how to create a new user. | Step | Name | Endpoint | Details | | --- | --- | --- | --- | | 1. | [List companies](/docs/openapi/companyapi/companies/listcompanies) | `/v2/companies/` | List all the companies that are part of the TMC. Use this endpoint to find the `companyId` of the company for which a new user needs to be created. **Request body requires:** The `companyRole` must be set to `ORG`. **Response will contain:** An `elements` array containing company objects. Each element includes an `id` (company ID) and `name` (company name). Also includes `length` and `totalNumResults` fields. **Sample Response:** ```json { "length": 1, "elements": [ { "id": "abc5b835-8001-430c-98f8-abcedefba4cf", "name": "Spotnana Technology Ltd." } ], "totalNumResults": 1 } ``` | | 1. | [List legal entities](/docs/openapi/companyapi/legal-entities/listlegalentities) | `/v2/companies/{companyId}/legal-entities` | List all legal entities that are part of a company. **URL path requires:** `companyId` from step 1. **Response will contain:** The list of all legal entity `ids` along with their `names`. **Other APIs will use:** The `id` of the legal entity under which the user needs to be created. | | 1. | [Create user](/docs/openapi/usersapi/users/createuser) | `/v2/users/` | Create a new user profile on the Spotnana platform. **Request body requires:** The `persona` of the user, `businessInfo` > `legalEntityRef` > `id` from step 2, and `organizationRef` > `id` from step 1. These are the only mandatory fields that must be populated when creating a new user. All the other fields in the `/v2/users/` API are optional and can be updated later using the [update user](/docs/openapi/usersapi/users/updateuser) endpoint. **Note:** The `companyId` retrieved from step 1 can be used as the `orgId` in this endpoint. **Response will contain:** The `userId` of the user. You can use this identifier to update other user details via the [update user](/docs/openapi/usersapi/users/updateuser) API. |