Skip to content

Create Organization

Permissions

The Identity Management API is authorized at the application level. Before calling the API, you need to set API permissions for different applications. For details, see API Permissions.

Permission CodeDescription
org_allRead/Write permission for organization management APIs
allRead/Write permission for all APIs

Request Description

Request Headers

Parameter NameChinese NameRequiredTypeDescription
AuthorizationAuthorizationYesStringFormat: Bearer {access_token}
Content-TypeContent TypeYesStringFixed value: application/json; charset=utf-8

Request Example

json
{ 
	"code": "TestOrg2", 
	"name": "Test Organization 2", 
	"parent_id": "",
	"category": "department", 
	"sequence": 5,
	"extension": {
		"uid": "123"
	}
}

Request Parameters

Parameter NameChinese NameRequiredTypeDescription
codeOrganization codeYesStringOrganization code
nameOrganization nameYesStringOrganization name
parent_idParent node IDNoStringParent node ID
categoryOrganization typeNoStringOrganization type code
sequenceDisplay sequenceNointDisplay sequence
extensionExtension attributesNoMapExtension attributes; extended attributes need to be defined in the enterprise

Response Example

Success Example

HTTP/1.1 201 Created

json
{
	"org_id": "20220412142914549-1E50-B49C521A4" 
}

Error Example

HTTP/1.1 400 Bad Request

json
{ 
	"error_code": "ORG.0008", 
	"error_msg": "The parent organization does not exist" 
}

Response Parameters

Parameter NameChinese NameTypeDescription
org_idCreated organization IDStringAuto-generated by the system

Error Codes

Status CodeError CodeChinese Error MessageEnglish Error MessageResolution
400ORG.0008父级组织不存在The parent organization does not existPlease check whether the parent organization exists
400ORG.0011组织类型不能为空Organization type cannot be emptyPlease check whether the organization type in the request parameters is empty
400ORG.0012组织编码不能为空Organization code cannot be emptyPlease check whether the organization code in the request parameters is empty
400ORG.0013组织名称不能为空Organization name cannot be emptyPlease check whether the organization name in the request parameters is empty
400ORG.0015组织编码已存在Organization code already existsThe current organization code already exists; please change it to a value that does not exist
400ORG.0016组织名称已存在Organization name already existsThe current organization name already exists; please change it to a value that does not exist
400ORG.0017组织编码不符合校验规则Organization code does not meet verification rulesPlease check whether the organization code field in the request parameters complies with the verification rules in 【Enterprise Center - User - Organization Attribute Definition】
400ORG.0018组织名称不符合校验规则Organization name does not meet verification rulesPlease check whether the organization name field in the request parameters complies with the verification rules in 【Enterprise Center - User - Organization Attribute Definition】
400ORG.0028组织层级不能超过{0}层The organization level cannot exceed {0} levelPlease check whether the organization level exceeds {0} levels
400ORG.0030上级组织不能为空The parent organization cannot be emptyPlease check whether the parent organization in the request parameters is empty
400ORG.0032显示顺序不能为空Organization sequence number cannot be emptyPlease check whether the display sequence in the request parameters is empty
400ORG.0035扩展属性[{0}]不能为空Extension attribute [{0}] cannot be emptyPlease check whether the extension attribute [{0}] field in the request parameters is empty
400ORG.0039扩展属性[{0}]已存在Extension attribute [{0}] already existsThe value of extension attribute [{0}] already exists; please change it to a value that does not exist
400ORG.0040组织全名不符合校验规则Organization full name does not meet verification rulesPlease check whether the organization full name field in the request parameters complies with the verification rules in 【Enterprise Center - User - Organization Attribute Definition】
400ORG.0041组织类型不符合校验规则Organization type does not meet verification rulesPlease check whether the organization type field in the request parameters complies with the verification rules in 【Enterprise Center - User - Organization Attribute Definition】
400ORG.0042上级组织不符合校验规则The parent organization does not meet the verification rulesPlease check whether the parent organization field in the request parameters complies with the verification rules in 【Enterprise Center - User - Organization Attribute Definition】
400ORG.0044显示顺序不符合校验规则The organization sequence number does not meet the verification rulesPlease check whether the display sequence field in the request parameters complies with the verification rules in 【Enterprise Center - User - Organization Attribute Definition】
400ORG.0047扩展属性[{0}]不符合校验规则Extension property [{0}] does not meet verification rulesPlease check whether the extension attribute [{0}] field in the request parameters complies with the verification rules in 【Enterprise Center - User - Organization Attribute Definition】

BambooCloud IDaaS Open Platform