Skip to main content

Open API

Last updated 10/03/2026

This document covers advanced AE features and involves many technical details. It's intended as a reference for users who are experienced with the related features. If you have questions about the content, contact your data consultant for one-on-one assistance.

In addition to its powerful UI for analysis, AE provides a complete set of APIs.

How to call​

Generate a query key​

To use the Open API, first generate a project key. There are two types of project keys, and the commands that generate them must be run in ta-tool

Log in to any AE server, run the su - ta command to switch to the ta user, and then run ta-tool

Generate a root key

ta-tool generate_root_secret
  • This key applies to all projects

Generate a key for a single project

ta-tool generate_api_secret -appid TEST-APPID
  • The parameter you pass in is the APPID of the project, and the key applies only to that project
  • Special case: When you use a single-project key to call the custom data query API, you can query the data of all projects by default. To restrict this, contact ThinkingAI staff

Note: If you run the command to generate a key for the same project or the root key again, a new key is generated and the previous key becomes invalid

API call rules​

API call requests are submitted with the HTTP GET or POST method. The call URL is:

http://$HOST:28992/$API_PATH?token=$API_SECRET

Here, $HOST is the address of the private deployment cluster, usually ta1, and only intranet calls are supported by default. $API_PATH is the specific API path, such as open/event-analyze. $API_SECRET is the key.

API call requests are submitted with the GET or POST method. The body of a POST request is in JSON format. For the specific parameter configuration, see the related documents.

The response body is in JSON format, with the following basic structure:

{
"return_code": 0,
"return_message": "success",
"data": {...},
"stackMessage": "",
"showStackMessage": false
}
FieldDescription
return_codeReturn code. 0 means success, and any other value means failure (see the table below for details)
return_messageReturn message
dataResult data of the call
stackMessageException stack on failure
showStackMessageUsed by the AE product frontend (can be ignored for OpenAPI calls). Indicates whether to show the copy button for the exception stack

return_code details

Return codeDescription
0Success
-1Failed
-1001Not logged in
-10012Login failed
-10013Logout failed
-1002Your account has been locked. Contact your administrator
-1003Incorrect username or password. Check them and log in again
-1004Something seems to have gone wrong with the system. Try again later or contact us
-1005Too many requests. Try again later
-1006You don't have permission to perform this operation
-1007SSO login failed
-1008Invalid parameters
-1009Username doesn't exist
-1010Illegal operation
-1011Data isn't ready yet
-1012Current query has no data
-1013Data is being prepared
-1014Invalid access
-1015Already exists
-1020Invalid phone number
-1021A member is already in this project
-1022Request canceled
-1023Target object no longer exists
-1099Custom event expression is incomplete or invalid
-1100Exceeded the number of objects that can be created
-1999Invalid user
-2000Unregistered user. Settings take effect after registration and activation
-2001Registered user. Settings take effect at the next login after activation
-2002The user is already in the project
-2003The operator's permissions can't be lower than those of the user being operated on
-2004Missing parameters. Contact your administrator
-2005You don't have permission for this operation
-2006Data has already been updated
-3000License authentication failed
-3001License verification failed. Contact ThinkingAI customer service
-3004Invalid project
-3005MFA verification failed. The MFA code is incorrect or expired
-3006Your company requires MFA virtual device login verification. Enable MFA
-3007The current user has already bound an MFA virtual device and can't bind another one
-3008The current user has enabled MFA virtual device login verification, but the MFA code is missing
-3009Operation not supported
Was this page helpful?