Skip to main content

Project management API

Last updated 11/12/2026

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​

Note

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 nameExample valueParameter typeRequiredDescription
tokenxxxStringYesQuery key
loginNametest007StringYesLogin 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 nameExample valueParameter typeDescription
data-ObjectReturned data
data.companyId1IntegerCompany ID
data.projectId2IntegerProject ID
data.projectNameInternal beta projectStringProject name
data.projectType0Integer

Project type

  • 0: Regular project
  • 1: Chinese DEMO project
  • 2: English DEMO project
data.remark-StringProject remarks
data.roleNamerootStringRole name
return_code0IntegerReturn code
return_messagesuccessStringReturn message

Error response example

{
"return_code": -1999,
"return_message": "Invalid user"
}
Parameter nameExample valueParameter typeDescription
return_code-1999IntegerReturn code
return_messageInvalid userStringReturn message

2. Update project information​

Note

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 nameExample valueParameter typeRequiredDescription
tokenxxxStringYesQuery key
projectId2IntegerYesProject ID

Request body parameters

{
"projectName": "New project name"
}
Parameter nameExample valueParameter typeRequiredDescription
projectNameNew project nameStringYesProject name

Success response example

{
"return_code": 0,
"return_message": "success"
}
Parameter nameExample valueParameter typeDescription
return_code0IntegerReturn code
return_messagesuccessStringReturn 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 nameExample valueParameter typeDescription
return_code-1006IntegerReturn code
return_messageYou don't have permission for this operation. Check whether the token value is correctStringReturn message

3. Create a project and generate an appId​

Note
  • 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 nameExample valueParameter typeRequiredDescription
tokenxxxStringYesQuery key
projectNametest007StringYesProject name
loadHistory1IntegerYes

Whether to turn on historical data import mode

  • 0: Off
  • 1: On

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 nameExample valueParameter typeDescription
data-ObjectReturned data
data.appid2ec39af5e0db4be2a1371b44a7cbedc5Stringappid
data.projectId2535IntegerProject ID
return_code0IntegerReturn code
return_messagesuccessStringReturn message

Error response example

{
"return_code": -1015,
"return_message": "test007 already exists"
}
Parameter nameExample valueParameter typeDescription
return_code-1015IntegerReturn code
return_messagetest007 already existsStringReturn 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

ParameterTypeRequiredDescription
authUsersArrayYesNon-empty list of accounts. List elements must not be null.
authUsers[].loginNameStringYesThe 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[].rolesArrayYesThe account's complete list of analytics roles in the target project. Must not be empty or contain null elements.
authUsers[].roles[].projectIdIntegerYesAn 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[].roleDescStringYesNon-empty display name of an existing analytics role available in the target project, not its internal identifier. Duplicate roles are deduplicated.
authUsers[].dataPowersArrayNoData 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[].projectIdIntegerYesMust 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[].dataPowerNameStringOne of twoThe 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[].allDataBooleanOne of twoOnly 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.

Was this page helpful?