Aysali logo

Web API

All POST Web API calls require an admin token unless noted otherwise (cron GET endpoints are the exception).

Sending the token

LocationExample
Request body"token": "your-admin-token"
HTTP headertoken: your-admin-token

The header is checked if token is missing from the body.

Obtaining a token

  1. Sign in to your Aysali Bot admin panel (Admin URL from the tenant portal).
  2. Open Users.
  3. Open the profile box of a user with type admin.
  4. Copy the token field.

If the token is missing or invalid, the API does not execute the requested function.

Success response

{
  "success": true,
  "response": {}
}
  • success — true when the call completed without a validation error.
  • response — return value: object, array, string, boolean, or number depending on the function.

Some functions return success: false with a string response code for validation errors (same HTTP 200).

Error response

Errors use HTTP status codes and a JSON body:

{
  "status": "error",
  "response": "error-code",
  "message": "Human-readable detail"
}
HTTPresponse codeMeaning
400missing-function-nameNo function in the request
400missing-argumentRequired parameter missing
400app-not-installedFunction needs an app that is not active
401token-not-foundNo admin token provided
401invalid-tokenToken is not an admin token
404function-not-foundUnknown function name

App-gated functions

Some functions require an installed channel or integration (for example SB_WHATSAPP, SB_MESSENGER, SB_WHATSAPP_AYSALI, SB_DIALOGFLOW). If the app is not active, you receive app-not-installed.

Check the Requires app note on each endpoint in the API reference.