The User Service is a part of a NestJS application that handles user-related operations such as creating, retrieving, updating, and deleting users.
If th used authorization key is
tenant-scoped
thenX-Stencil-Tenantid
is also required as a header specifying the tenant to be used
POST /user
POST /user/:id
string
{"active" : boolean, "additionalData" ?: "string", "membership" : string[], "userData" : UserDataDto, "email" : "string"}
Code | Description |
---|---|
200 | The request was successful. The response will contain a JSON body. |
400 | The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid Auth Service license is required and is not present. |
401 | You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty |
404 | The object you are trying to update doesn’t exist. The response will be empty. |
500 | There was an internal error. A stack trace is provided and logged in the Auth Service log files. The response will be empty. |
GET /user/:id
id
: string - The unique identifier of the userheaders
: object - The request headersstring
string
Code | Description |
---|---|
200 | The request was successful. The response will contain a JSON body. |
400 | The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid Auth Service license is required and is not present. |
401 | You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty |
404 | The object you are trying to update doesn’t exist. The response will be empty. |
500 | There was an internal error. A stack trace is provided and logged in the Auth Service log files. The response will be empty. |
Sample cURL:
```sh
curl -X GET http://localhost:3000/user/
Sample HTTPie:
```sh
http GET http://localhost:3000/user/
POST /user/:id
string
{"active" : boolean, "additionalData" ?: "string", "membership" : string[], "userData" : UserDataDto}
string
Code | Description |
---|---|
200 | The request was successful. The response will contain a JSON body. |
400 | The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid Auth Service license is required and is not present. |
401 | You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty |
404 | The object you are trying to update doesn’t exist. The response will be empty. |
500 | There was an internal error. A stack trace is provided and logged in the Auth Service log files. The response will be empty. |
Sample cURL:
```sh
curl -X POST http://localhost:3000/user/
Sample HTTPie:
```sh
http POST http://localhost:3000/user/
POST /user/:id
string
boolean
string
Code | Description |
---|---|
200 | The request was successful. The response will contain a JSON body. |
400 | The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid Auth Service license is required and is not present. |
401 | You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty |
404 | The object you are trying to update doesn’t exist. The response will be empty. |
500 | There was an internal error. A stack trace is provided and logged in the Auth Service log files. The response will be empty. |
Sample cURL:
```sh
curl -X POST http://localhost:3000/user/
Sample HTTPie:
```sh
http POST http://localhost:3000/user/
The User Registration Service is part of a NestJS application that handles user registration operations, including creating, retrieving, updating, and deleting user registrations. It also provides functionality to create both a user and their registration in a single operation.
POST /registration/:userId
string
{"generateAuthenticationToken" ?: boolean, "applicationId" : string, "data" ?: string, "registrationId" ?: string}
string
Code | Description |
---|---|
200 | The request was successful. The response will contain a JSON body. |
400 | The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid Auth Service license is required and is not present. |
401 | You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty |
404 | The object you are trying to update doesn’t exist. The response will be empty. |
500 | There was an internal error. A stack trace is provided and logged in the Auth Service log files. The response will be empty. |
Sample cURL:
```sh
curl -X POST http://localhost:3000/registration/
Sample HTTPie:
```sh
http POST http://localhost:3000/registration/
GET registration/:userId/:applicationId
string
string
string
Code | Description |
---|---|
200 | The request was successful. The response will contain a JSON body. |
400 | The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid Auth Service license is required and is not present. |
401 | You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty |
404 | The object you are trying to update doesn’t exist. The response will be empty. |
500 | There was an internal error. A stack trace is provided and logged in the Auth Service log files. The response will be empty. |
Sample cURL:
```sh
curl -X GET http://localhost:3000/registration/
Sample HTTPie:
```sh
http GET http://localhost:3000/registration/
PATCH /registration/:userId/:applicationId
string
{"data" ?: UserRegistrationData, "roles" : string[]}
string
string
Code | Description |
---|---|
200 | The request was successful. The response will contain a JSON body. |
400 | The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid Auth Service license is required and is not present. |
401 | You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty |
404 | The object you are trying to update doesn’t exist. The response will be empty. |
500 | There was an internal error. A stack trace is provided and logged in the Auth Service log files. The response will be empty. |
Sample cURL:
```sh
curl -X PATCH http://localhost:3000/registration/
Sample HTTPie:
```sh
http PATCH http://localhost:3000/registration/
DELETE /registration/:userId/:applicationId
string
string
string
Code | Description |
---|---|
200 | The request was successful. The response will contain a JSON body. |
400 | The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid Auth Service license is required and is not present. |
401 | You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty |
404 | The object you are trying to update doesn’t exist. The response will be empty. |
500 | There was an internal error. A stack trace is provided and logged in the Auth Service log files. The response will be empty. |
Sample cURL:
```sh
curl -X DELETE http://localhost:3000/registration/
Sample HTTPie:
```sh
http DELETE http://localhost:3000/registration/
POST /registration/combined
string
CreateUserAndUserRegistration
string
Code | Description |
---|---|
200 | The request was successful. The response will contain a JSON body. |
400 | The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid Auth Service license is required and is not present. |
401 | You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty |
404 | The object you are trying to update doesn’t exist. The response will be empty. |
500 | There was an internal error. A stack trace is provided and logged in the Auth Service log files. The response will be empty. |
Sample cURL:
```sh
curl -X POST http://localhost:3000/registration/combined
-H “Content-Type: application/json”
-H “Authorization: Basic
Sample HTTPie:
```sh
http POST http://localhost:3000/registration/combined
Authorization:”Basic
All endpoints are protected by authorization headers which requires authorization and x-stencil-tenanid values to be passed in headers, which are verified using the HeaderAuthService
.
The service uses standard NestJS exceptions to handle errors:
UnauthorizedException
: Thrown when authorization fails.BadRequestException
: Thrown when required parameters are missing or invalid.InternalServerErrorException
: Thrown when a server error occurs during an operation.All endpoints return a standardized response object containing:
success
: Boolean indicating operation successmessage
: Descriptive message about the operation resultdata
: The requested or manipulated data (when applicable)