Create Consumer Organization
Endpoint
POST /apiops/projects/{projectName}/consumer-organizations
Authentication
Requires a Personal API Access Token.
Authorization: Bearer YOUR_TOKEN
Request
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
Request Body
{
"code": "acme-partners",
"nameDefault": "ACME Partners",
"nameSecondary": "ACME Ortaklar",
"parentOrganizationCode": "acme",
"metadata": [
{ "key": "region", "value": "emea", "secret": false }
]
}
| Field | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | Code of the organization. Stored trimmed. Unique in the project |
| nameDefault | string | No | Default display name |
| nameSecondary | string | No | Secondary display name |
| parentOrganizationCode | string | No | Code of an organization of the same project. An unknown code answers 404 resourceNotFound |
| metadata | array | No | Custom metadata entries (key, value, secret, includeInJwt, includeInTokenResponse, jwtClaimName). The value of a secret entry is write-only |
Response
201 Created with a Location header (/apiops/projects/{projectName}/consumer-organizations/{code}).
The response is a write response. result is the organization. runtimeDeployment reports the gateway push (IN_SYNC or DEGRADED). A DEGRADED write is stored. resourceVersion is not returned.
Errors
| Status | Error key | Cause |
|---|---|---|
| 400 | malformedRequest | code is missing |
| 404 | resourceNotFound | The parent organization code is unknown |
| 409 | duplicateName | The code is already used in the project |
cURL Example
curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/consumer-organizations" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "code": "acme-partners", "nameDefault": "ACME Partners" }'
Permissions
- User must have
IDENTITY+MANAGEpermission in the project - A project outside the scope of the caller answers
404 resourceNotFound, never403 - The admin project has no consumer organizations: a call on it answers
400 malformedRequest(params.reason=platformScopeNotSupported)