Skip to content
SENS Platform Docs

Create an organization unit in an administrable scope.

POST
/v1/tenants/{tenantNumber}/organization-units
curl --request POST \
--url https://api.dev.iot-sens.schlossers.at/v1/tenants/1/organization-units \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "key": "example", "name": "example", "parentOrganizationUnitId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "metadata": { "additionalProperty": "example" } }'
tenantNumber
required
integer format: int32
>= 1 <= 2147483647
Media typeapplication/json
object
key
required
string
/^[a-z0-9][a-z0-9_-]{0,63}$/
name
required
string
>= 1 characters <= 200 characters
parentOrganizationUnitId
One of:
string format: uuid
metadata
object
<= 50 properties
key
additional properties
One of:
string
Examplegenerated
{
"key": "example",
"name": "example",
"parentOrganizationUnitId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"metadata": {
"additionalProperty": "example"
}
}

Organization unit created.

Media typeapplication/json
object
organizationUnitId
required
string format: uuid
tenantId
required
string format: uuid
parentOrganizationUnitId
required
One of:
string format: uuid
key
required
string
/^[a-z0-9][a-z0-9_-]{0,63}$/
name
required
string
>= 1 characters <= 200 characters
status
required
string
Allowed values: active disabled
effectiveStatus
required
string
Allowed values: active disabled
scopeRelation
required
string
Allowed values: accessible ancestor
hasChildren
required

Whether at least one direct child is visible to the current actor.

boolean
metadata
required
object
<= 50 properties
key
additional properties
One of:
string
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
Example
{
"status": "active",
"effectiveStatus": "active",
"scopeRelation": "accessible"
}
Location
string
Example
/v1/organization-units/10000000-0000-4000-8000-000000000001

Canonical flat organization-unit URL.

A safe platform error response.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: VALIDATION_FAILED AUTHENTICATION_FAILED AUTHORIZATION_FAILED RESOURCE_NOT_FOUND CONFLICT DEPENDENCY_FAILURE FLOW_FAILURE RATE_LIMITED INTERNAL_ERROR
category
required
string
Allowed values: validation authentication authorization not_found conflict dependency_failure flow_failure rate_limit internal
message
required

Safe client-facing diagnostic message.

string
correlationId
required

Correlation ID for operational investigation.

string
>= 1 characters
details

Safe bounded diagnostic details.

object
key
additional properties
One of:
string
Example
{
"error": {
"code": "VALIDATION_FAILED",
"category": "validation"
}
}
Cache-Control
string
Allowed value: no-store