Create an organization unit in an administrable scope.
POST
/v1/tenants/{tenantNumber}/organization-units
const url = 'https://api.dev.iot-sens.schlossers.at/v1/tenants/1/organization-units';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"key":"example","name":"example","parentOrganizationUnitId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","metadata":{"additionalProperty":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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" } }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”tenantNumber
required
integer format: int32
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
Examplegenerated
{ "key": "example", "name": "example", "parentOrganizationUnitId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "metadata": { "additionalProperty": "example" }}Responses
Section titled “Responses”Organization unit created.
Media typeapplication/json
object
organizationUnitId
required
string format: uuid
tenantId
required
string format: uuid
key
required
string
name
required
string
status
required
string
effectiveStatus
required
string
scopeRelation
required
string
hasChildren
required
Whether at least one direct child is visible to the current actor.
boolean
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
Example
{ "status": "active", "effectiveStatus": "active", "scopeRelation": "accessible"}Headers
Section titled “Headers”Location
string
Example
/v1/organization-units/10000000-0000-4000-8000-000000000001Canonical flat organization-unit URL.
default
Section titled “default”A safe platform error response.
Media typeapplication/json
object
error
required
object
Example
{ "error": { "code": "VALIDATION_FAILED", "category": "validation" }}Headers
Section titled “Headers”Cache-Control
string