Sections below contain API details used by LetsDecide partners to perform various administrative activities programmatically through Partner API.


Prerequisites & Guidelines:

  • You will need a partner key to access all REST API calls. 
    • When a partner key is generated, it is associated with one or more license types that can be used by partners to create new tribes.
    • Please contact us at contact@letsdecide.ai to get one.
  • Every request must set the Authorization request header with the value: LetsDecide <partner key>.
  • Unless specified, all request parameters are mandatory.
  • All request responses are in the standard JSON format. Make sure Content-Type is set to application/json.



Create a new TribePUT /partner/tribe
Request
{
  "externalId": "string",    
  "licenseType": "string",
  "name": "string"
}
  • externalId: Unique id for the tribe as maintained in the partner system. Typically, a company or team id.
  • licenseType: A license type that you would like to associate with the tribe.
  • name: A unique readable name for the tribe.
Response (200)
{
  "externalId": "string",
  "statusMessage": "string",
  "tribeId": "string"
}
  • externalId: Unique id for the tribe as maintained in the partner system. This is the same value as sent in the request.
  • tribeId: Id of the newly created tribe. This value must be stored in the partner system and must be passed to all other REST API calls related to that tribe.
  • statusMessage: Empty if the call was successful, otherwise it contains an error message.
Possible Errors400 - Partner not found, invalid license type.
401 - Invalid or missing partner key
500 - Tribe name is not unique.




Update a TribePOST /partner/tribe
Request
{
  "name": "string",
  "tribeId": "string"
}
  • name: Name of the tribe.
  • tribeId: Tribe that is being updated
Response(200)
{
  "name": "string",
  "statusMessage": "string",
  "tribeId": "string"
}
  • name: New name for the tribe
  • tribeId: Id of the tribe which was updated.
  • statusMessage: Empty if the call was successful, otherwise it contains an error message.
Possible Errors400 - Partner not owner, invalid license type, missing one or more values in the request payload
401 - Invalid or missing partner key




Get tribe detailsGET /partner/tribe/{tribeId}
RequesttribeId - tribe's Id, pass it as part of the URI.
Response(200)
{
  "externalId": "string",
  "name": "string",
  "statusMessage": "string",
  "tribeId": "string"
}
  • externalId: Unique id for the tribe as maintained in the partner system.
  • tribeId: Id of the requested tribe. 
  • name: Tribe's name
  • statusMessage: Empty if the call was successful, otherwise it contains an error message.
Possible Errors400 - Partner not owner
401 - Invalid or missing partner key




Remove tribeDELETE /partner/tribe/{tribeId}
RequesttribeId - tribe's Id, pass it as part of the URI.
Response(200)
{
  "statusMessage": "string",
  "tribeId": "string"
}
  • tribeId: Id of the requested tribe. 
  • statusMessage: Empty if the call was successful, otherwise it contains an error message.
Possible Errors400 - Partner not owner
401 - Invalid or missing partner key




Create a new user in the tribePUT /partner/user
Request
{
  "email": "string",
  "firstName": "string",
  "lastName": "string",
  "tribeId": "string"
}
  • email: Email Id of the user. This is mapped to the username on LetsDecide.
  • firstName: First name of the user.
  • lastName: Last name of the user.
  • tribeId: Id of the tribe where this user should be created.
Response(200)
{
  "statusMessage": "string",
  "tribeId": "string",
  "userId": "string"
}
  • tribeId: Id of the tribe where the user was created.
  • userId: Id of the newly created user. This value must be stored in the partner system and must be passed to all other REST API calls related to that user.
  • statusMessage: Empty if the call was successful, otherwise it contains an error message.
Possible Errors400 - Partner not owner, user already exists in that tribe, missing one or more values in the request payload
401 - Invalid or missing partner key



Update user detailsPOST /partner/user
Request
{
  "firstName": "string",
  "lastName": "string",
  "userId": "string"
}
  • firstName: First name of the user.
  • lastName: Last name of the user.
  • userId: Id of the updated user.

Response(200)
{
  "email": "string",
  "firstName": "string",
  "lastName": "string",
  "statusMessage": "string",
  "userId": "string",
  "isActive": bool
}
  • firstName: First name of the user.
  • lastName: Last name of the user.
  • userId: Id of the user.
  • email: Email Id of the user.
  • isActive: true if the user is active, false otherwise.
  • statusMessage: Empty if the call was successful, otherwise it contains an error message.

Possible Errors400 - Partner not owner, missing one or more values in the request payload
401 - Invalid or missing partner key



Activate/Deactivate userPOST /partner/user/active
Request
{
  "userId": "string",
  "isActive": bool
}
  • userId: Id of the updated user.
  • isActive: true if the user should be active, false otherwise.

Response(200)
{
  "email": "string",
  "firstName": "string",
  "lastName": "string",
  "statusMessage": "string",
  "userId": "string",
  "isActive": bool
  • firstName: First name of the user.
  • lastName: Last name of the user.
  • userId: Id of the user.
  • email: Email Id of the user.
  • isActive: true if the user is active, false otherwise.
  • statusMessage: Empty if the call was successful, otherwise it contains an error message.

Possible Errors400 - Partner not owner, missing one or more values in the request payload
401 - Invalid or missing partner key




Get user detailsGET /partner/user/{userId}
RequestuserId - user's Id, pass it as part of the URI.
Response(200)
{
  "email": "string",
  "firstName": "string",
  "lastName": "string",
  "statusMessage": "string",
  "userId": "string",
  "isActive": bool
}
  • firstName: First name of the user.
  • lastName: Last name of the user.
  • userId: Id of the user.
  • email: Email Id of the user.
  • isActive: true if the user is active, false otherwise.
  • statusMessage: Empty if the call was successful, otherwise it contains an error message.

Possible Errors400 - Partner not owner
401 - Invalid or missing partner key




Remove user from tribeDELETE /partner/user/{userId}
RequestuserId - user's Id, pass it as part of the URI.
Response(200)
{
  "statusMessage": "string",
  "tribeId": "string",
  "userId": "string"
}
  • tribeId: Id of the tribe in which the user was removed from.
  • userId: Id of the removed user.
  • statusMessage: Empty if the call was successful, otherwise it contains an error message.


400 - Partner not owner
401 - Invalid or missing partner key




Generate user login URLPOST /partner/user/login
Request
{
  "userId": "string"
}
  • userId: Id of the user. This Id was previously created when the user was created in the tribe.
Response(200)
{
  "statusMessage": "string",
  "url": "string"
}
  • url: A fully formed login URL. Navigate in the browser to complete the login process.
  • statusMessage: Empty if the call was successful, otherwise it contains an error message.
Possible Errors400 - Partner not found
401 - Invalid or missing partner key, invalid user