# Create a new API user Creates a new API user (also known as a machine user) that your application can use to authenticate with Spotnana APIs. Each API user is scoped to a specific TMC and role, giving you control over what level of access the credentials grant. Use this endpoint to: - Generate a dedicated clientId and clientSecret pair that your backend services can use to obtain access tokens. - Assign either a TMC admin or a company admin role to scope what the API user can do across your organization. Next steps: - Use the clientId and clientSecret in the POST /v2/auth/oauth2-token endpoint to obtain an access token. Notes: - Store the clientSecret securely. It is only returned once at creation and cannot be retrieved later. - You can create up to 5 API users per TMC. To increase this limit, contact your Spotnana representative. - Only a TMC admin can use this endpoint to create API users. Endpoint: POST /v2/api-users Version: v2 ## Request fields (application/json): - `tmcId` (string) Tmc id Example: "ecc5b835-8001-430c-98f8-fedeccebe4cf" - `orgId` (string) Org id Example: "ecc5b835-8001-430c-98f8-fedeccebe4cf" - `role` (string) Roles supported for api user creation Enum: "TMC_ADMIN", "COMPANY_ADMIN" ## Response 200 fields (application/json): - `clientId` (string) Api user client id Example: "1ddj3hs95to28iag7m4hl9lv2" - `clientSecret` (string) Api user client secret Example: "1hgea74sii6os6vlkk1c7krlfgniaphbn2c56pml" ## Response 401 fields (application/json): - `debugIdentifier` (string) Link to debug the error internally. - `errorMessages` (array) - `errorMessages.errorCode` (string) Error code to identify the specific errors. - `errorMessages.message` (string) Message containing details of error. - `errorMessages.errorParameters` (array) Error message parameters. - `errorMessages.errorParameters.name` (string) Parameter name - `errorMessages.errorParameters.value` (string) Parameter value - `errorMessages.errorDetail` (string) More details about the error. ## Response 403 fields (application/json): - `debugIdentifier` (string) Link to debug the error internally. - `errorMessages` (array) - `errorMessages.errorCode` (string) Error code to identify the specific errors. - `errorMessages.message` (string) Message containing details of error. - `errorMessages.errorParameters` (array) Error message parameters. - `errorMessages.errorParameters.name` (string) Parameter name - `errorMessages.errorParameters.value` (string) Parameter value - `errorMessages.errorDetail` (string) More details about the error. ## Response 409 fields