Project management API
For how to call the API, see the calling method described in the Open API document.
We recommend that you first read the AE user guide to learn about the project management features: Project management
1. List user projects
Get the project list of a user by login name
Endpoint URL
/open/project-list?token=xxx&loginName=test007
Request method
POST
Content-Type
application/json
Request query parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
| loginName | test007 | String | Yes | Login name |
Success response example
{
"data": [
{
"companyId": 1,
"projectId": 2,
"projectName": "Internal beta project",
"projectType": 0,
"remark": "",
"roleName": "root"
},
{
"companyId": 1,
"projectId": 6,
"projectName": "thinkinggame official website (live)",
"projectType": 0,
"remark": "",
"roleName": "root"
}
],
"return_code": 0,
"return_message": "success"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| data | - | Object | Returned data |
| data.companyId | 1 | Integer | Company ID |
| data.projectId | 2 | Integer | Project ID |
| data.projectName | Internal beta project | String | Project name |
| data.projectType | 0 | Integer | Project type
|
| data.remark | - | String | Project remarks |
| data.roleName | root | String | Role name |
| return_code | 0 | Integer | Return code |
| return_message | success | String | Return message |
Error response example
{
"return_code": -1999,
"return_message": "Invalid user"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | -1999 | Integer | Return code |
| return_message | Invalid user | String | Return message |
2. Update project information
Update project information. Currently, only the project name can be updated
Endpoint URL
/open/project/update-project-info?token=xxx&projectId=2
Request method
POST
Content-Type
application/json
Request query parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
| projectId | 2 | Integer | Yes | Project ID |
Request body parameters
{
"projectName": "New project name"
}
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| projectName | New project name | String | Yes | Project name |
Success response example
{
"return_code": 0,
"return_message": "success"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | 0 | Integer | Return code |
| return_message | success | String | Return message |
Error response example
{
"return_code": -1006,
"return_message": "You don't have permission for this operation. Check whether the token value is correct"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | -1006 | Integer | Return code |
| return_message | You don't have permission for this operation. Check whether the token value is correct | String | Return message |
3. Create a project and generate an appId
- Checks whether the project name already exists. If it does, creation fails and the result shown in the error response example is returned
Endpoint URL
/open/project/generate-project-app-id?token=xxx&projectName=test007&loadHistory=1
Request method
POST
Content-Type
application/json
Request query parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
| projectName | test007 | String | Yes | Project name |
| loadHistory | 1 | Integer | Yes | Whether to turn on historical data import mode
|
curl example
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' 'http://ta2:8992/open/project/generate-project-app-id?token=YOUR_TOKEN&projectName=test1222&loadHistory=1'
Success response example
{
"data": {
"appid": "2ec39af5e0db4be2a1371b44a7cbedc5",
"projectId": 2535
},
"return_code": 0,
"return_message": "success"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| data | - | Object | Returned data |
| data.appid | 2ec39af5e0db4be2a1371b44a7cbedc5 | String | appid |
| data.projectId | 2535 | Integer | Project ID |
| return_code | 0 | Integer | Return code |
| return_message | success | String | Return message |
Error response example
{
"return_code": -1015,
"return_message": "test007 already exists"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | -1015 | Integer | Return code |
| return_message | test007 already exists | String | Return message |
4. Batch Create Accounts and Set Analytics Roles for One Project
Batch create accounts, add members, and replace their complete analytics role sets for one project. Data permissions for that project can be specified in the same request. This API supports private deployments that use a project token to synchronize accounts, roles, and data permissions. SaaS is not supported.
Prerequisites
Use the target project's project token or a company token for the company that owns the project. User tokens, temporary tokens, and tokens for other projects or companies are not accepted. For token generation and the service address, see the Open API instructions linked at the beginning of this page.
POST /open/batch-set-project-roles?token=<TOKEN>
Content-Type: application/json
Alternatively, omit the token query parameter and send the Authorization: Bearer <TOKEN> request header. Set Content-Type to application/json.
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| authUsers | Array | Yes | Non-empty list of accounts. List elements must not be null. |
| authUsers[].loginName | String | Yes | The login name. Its format follows the batch user creation API. Names must be unique within a request; names differing only in case are treated as duplicates. |
| authUsers[].roles | Array | Yes | The account's complete list of analytics roles in the target project. Must not be empty or contain null elements. |
| authUsers[].roles[].projectId | Integer | Yes | An existing, non-negative project ID. All projectId values across all accounts and roles in the request must be identical. No additional projectId query parameter is needed. |
| authUsers[].roles[].roleDesc | String | Yes | Non-empty display name of an existing analytics role available in the target project, not its internal identifier. Duplicate roles are deduplicated. |
| authUsers[].dataPowers | Array | No | Data permission settings for this account. Omission, null, or an empty array preserves existing data permissions. New accounts or new project members retain the default access to all data when no permission is specified. Array elements must not be null. |
| authUsers[].dataPowers[].projectId | Integer | Yes | Must equal the target project ID in this account’s roles. The same project must not be configured more than once for an account. |
| authUsers[].dataPowers[].dataPowerName | String | One of two | The full original name of an existing custom data permission in the project. It must match exactly and uniquely. Do not pass an internal ID. Fuzzy matching and automatic creation are not supported. Even a custom name meaning All Data is resolved as a custom permission. When selecting a name, omit allData or set it to null. |
| authUsers[].dataPowers[].allData | Boolean | One of two | Only true is allowed. It explicitly grants access to all data, regardless of the request language. Omit dataPowerName or set it to null. false, a blank name, neither selection, or both selections are rejected. |
Request Example
This example sets the complete analytics role sets for two accounts in project 57. It assigns a custom data permission to api_user_1 and explicitly grants all data to api_user_2. API Analyst, API Viewer, and API Data Scope are example names; replace them with existing role and data permission names in the target project. Omit dataPowers to set roles only.
{
"authUsers": [
{
"loginName": "api_user_1",
"roles": [
{
"projectId": 57,
"roleDesc": "API Analyst"
},
{
"projectId": 57,
"roleDesc": "API Viewer"
}
],
"dataPowers": [
{
"projectId": 57,
"dataPowerName": "API Data Scope"
}
]
},
{
"loginName": "api_user_2",
"roles": [
{
"projectId": 57,
"roleDesc": "API Viewer"
}
],
"dataPowers": [
{
"projectId": 57,
"allData": true
}
]
}
]
}
Behavior
- If an account does not exist, it is created in the company that owns the target project, with the initial password ta2020. Existing accounts that are not project members are added to the project. Newly added members join the default user group.
- For existing members, the target project's analytics roles are replaced in full, not appended. For example, if a member has roles A and B and the request contains only B, only B remains after success. Always supply the complete set of roles to retain. An empty list cannot be used to remove members.
- Only the explicitly specified target project data permission is changed. Omitting dataPowers, null, or an empty array preserves existing data permissions. A missing or duplicate custom permission name, or a name that exists only in another project, fails the entire batch without falling back to all data. Roles in other projects or platforms, passwords, and account lock states remain unchanged. If the company has disabled account creation within projects, new accounts cannot be created, but roles can still be set for existing accounts.
- Protected identities such as Root, project owner, and system administrator cannot be assigned. Accounts with protected identities in the target company or project cannot be modified. Accounts from other companies, deleted identities, and roles from other projects, companies, or platforms are rejected.
- The batch is applied as a whole. Any parameter, permission, role, or data permission validation failure prevents all changes. A write failure rolls back accounts, roles, default group membership, and data permissions together. Partial success is not returned.
- After a request completes successfully, repeating the same request reuses the accounts and sets the same roles, without creating duplicate accounts or accumulating roles. Send batches for the same project sequentially; the execution order and final role sets of concurrent requests are not guaranteed.
Response
Successful response example:
{
"return_code": 0,
"return_message": "success"
}
A return_code of 0 indicates success; any other value indicates failure, with details in return_message. Common causes include empty or duplicate parameters, multiple projects in one request, insufficient token permissions, unavailable roles, accounts belonging to another company or deleted identities, and attempts to modify protected identities.

