Create Credential Organization
Endpoint
POST /apiops/projects/{projectName}/credential-organizations/
Authentication
Requires a Personal API Access Token.
Header
Authorization: Bearer YOUR_TOKEN
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
| Content-Type | application/json | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
Request Body
Full JSON Body Example
{
"code": "team-alpha",
"nameDefault": "Team Alpha",
"nameSecondary": "Alpha Ekibi",
"parentOrganizationCode": "root-org",
"metadata": [
{
"key": "costCenter",
"value": "CC-1001",
"secret": false,
"includeInJwt": true,
"includeInTokenResponse": false,
"jwtClaimName": null
}
]
}
Request Body Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| code | string | Yes | - | Stable public identifier (unique within the project) |
| nameDefault | string | No | - | Primary display name |
| nameSecondary | string | No | - | Secondary display name |
| parentOrganizationCode | string | No | - | Parent organization code (must exist in the same project) |
| metadata | array[object] | No | [] | Custom metadata entries. See Metadata Object below |
Metadata Object
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| key | string | Yes | - | Metadata key |
| value | string | No | - | Metadata value. Secret entries are write-only on GET |
| secret | boolean | No | false | When true, the value is not returned on GET |
| includeInJwt | boolean | No | false | Include this entry in issued JWT access tokens |
| includeInTokenResponse | boolean | No | false | Include this entry in token endpoint JSON responses |
| jwtClaimName | string|null | No | null | Override JWT claim name; defaults to key when null |
Response
Success Response (201 Created)
Returns the created CredentialOrganizationDTO. Secret metadata values are omitted from the response body.
{
"code": "team-alpha",
"nameDefault": "Team Alpha",
"nameSecondary": "Alpha Ekibi",
"parentOrganizationCode": "root-org",
"metadata": [
{
"key": "costCenter",
"value": "CC-1001",
"secret": false,
"includeInJwt": true,
"includeInTokenResponse": false,
"jwtClaimName": null
}
]
}
Error Responses
| Status | Condition |
|---|---|
| 400 | Blank code, or parent organization not found |
| 401 | Invalid or missing token |
| 409 | An organization with the same code already exists in the project |
| 500 | Unexpected server error |
cURL Example
curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/credential-organizations/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"code": "team-alpha", "nameDefault": "Team Alpha", "metadata": []}'
Notes and Warnings
codeis immutable. After creation, the organization is always addressed bycodein path parameters.- Metadata replaces the full list on update. On POST, an empty or omitted
metadataarray creates the organization with no metadata entries. - Secret metadata is write-only. Values marked
secret: trueare never returned on GET; supply the value again on POST/PUT to set or change it.
Permissions
User must have IDENTITY + MANAGE permission in the project.