Skip to main content

Add Client

This API allows adding a new client to the system.

Endpoint

POST /api/client/add

info

Make sure you have the appropriate API key to authenticate this request. Without it, the request will fail.

Request

Headers

KeyValue
Content-Typeapplication/json
tip

The Content-Type header is required and should always be set to application/json for this endpoint.

Body

{
"appName": "ExampleApp",
"appUrl": "example.com",
"appDescription": "A sample app",
"preferredSmsGateway": "AlphaSMS",
"isHost": true
}

Description of Request Body

ParameterTypeDescriptionRequired
appNamestringName of the applicationYes
appUrlstringURL of the applicationYes
appDescriptionstringBrief description of the applicationNo
preferredSmsGatewaystringPreferred SMS gatewayNo
isHostbooleanIndicates if the client is a hostYes

Response

Success Response

{
"status": 200,
"results": {
"appDescription": "your app description",
"appUrl": "your application url",
"secretKey": "secretkey generated by the server",
"preferredSmsGateway": "AlphaSMS",
"preferredEmailGateway": null,
"preferredPushNotificationGateway": null,
"isHost": true,
"smsConfig": null
}
}

Error Response

{
"status": 400,
"error": "Invalid request"
}

Check the status code in the response to handle success or errors appropriately in your application.

Example Usage

cURL Command

curl --request POST \
--url https://your-base-url/api/client/add \
--header 'Content-Type: application/json' \
--data '{
"appName": "ExampleApp",
"appUrl": "example.com",
"appDescription": "A sample app",
"preferredSmsGateway": "AlphaSMS",
"isHost": true
}'