CreateProjectRole - Add a project role
Updated at:
|
Applicable editions |
Central edition, Region edition |
Service endpoint and authorization
- Get the service endpoint: Replace {domain} in the API request syntax.
- Get a personal access token.
- Get the organization ID: Required only for Central edition. Go to organization settings > Basic Information.
|
Product |
Resource |
Required permissions |
|
Project Collaboration |
project role |
Read/Write |
Request syntax
Central edition
POST https://{domain}/oapi/v1/projex/organizations/{organizationId}/projects/{id}/roles
Region edition
POST https://{domain}/oapi/v1/projex/projects/{id}/roles
Request headers
|
Parameter |
Type |
Required |
Description |
Example |
|
x-yunxiao-token |
string |
Yes |
Your personal access token. |
pt-0fh3****0fbG_35af****0484 |
Request parameters
|
Parameter |
Type |
Location |
Required |
Description |
Example |
|
id |
string |
path |
Yes |
The project's unique identifier. |
589c53d622cc8521793e08**** |
|
organizationId |
string |
path |
|
The organization ID. |
|
| - |
object |
body |
No |
|
|
| roleIds |
array[string] |
body |
Yes |
A list of role IDs. |
["project.participant"] |
Request examples
Central edition
curl -X 'POST' \
'https://{domain}/oapi/v1/projex/organizations/{organizationId}/projects/589c53d622cc8521793e08****/roles' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"roleIds": ["project.participant"]
}'
Region edition
curl -X 'POST' \
'https://{domain}/oapi/v1/projex/projects/589c53d622cc8521793e08****/roles' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"roleIds": ["project.participant"]
}'
Response parameters
This operation does not return any parameters.
Error codes
For API-specific error codes, see the Error Code Center.
Is this page helpful?