Units by attribute values
POST /v1/units-by-attributes
Operation id: v1UnitsByAttributes
Tags: Kernel NextGen APIs
Parameters
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
auth_token | string | No |
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
x-reflexis-auth-token-x | string | No | Authentication token (or use auth_token query param) |
x-reflexis-domain-x | string | No | Domain id string; optional — defaults to token domain |
Responses
200 — OK — list envelope; data is an array of organization unit objects matching the given attributes. has_more is always false (no pagination). An empty or missing JSON body yields 400 (validation_error).
Content type: application/json
400 — Missing org_level or attributes — flat error body (not list envelope)
Content type: application/json
401 — Authentication failed. The request is missing a token, the token is invalid, or the token has expired.
Content type: application/json
500 — An unexpected error occurred while processing the request.
Content type: application/json
Request body
Required: Yes
application/json
Schema
Request body uses org_level plus attributes. Legacy key attributes_map is accepted when attributes is omitted (same semantics). Each attribute value may be a scalar or an array of scalars for multi-value match.
| Property | Type | Required | Description |
|---|---|---|---|
org_level | integer | Yes | |
attributes | object | No | Attribute name → single value or array of values |
attributes_map | object | No | Legacy alias (same shape as attributes); merged when attributes is absent |
is_and_operation | boolean | No | |
exclude_store_org_attribute_units | boolean | No | |
status | string | No | |
los_unit_id | string | No |
{
"type": "object",
"description": "Request body uses `org_level` plus `attributes`.\nLegacy key `attributes_map` is accepted when `attributes` is omitted (same semantics).\nEach attribute value may be a scalar or an array of scalars for multi-value match.\n",
"required": [
"org_level"
],
"properties": {
"org_level": {
"type": "integer"
},
"attributes": {
"type": "object",
"description": "Attribute name → single value or array of values"
},
"attributes_map": {
"type": "object",
"description": "Legacy alias (same shape as attributes); merged when attributes is absent"
},
"is_and_operation": {
"type": "boolean"
},
"exclude_store_org_attribute_units": {
"type": "boolean"
},
"status": {
"type": "string"
},
"los_unit_id": {
"type": "string"
}
}
}
Response models
200 — OK — list envelope; data is an array of organization unit objects matching the given attributes. has_more is always false (no pagination). An empty or missing JSON body yields 400 (validation_error).
Content type: application/json
Schema
List envelope — object list, url, data array, has_more, optional next_cursor, fetched_at
| Property | Type | Required | Description |
|---|---|---|---|
object | string | No | |
url | string | No | |
data | array | No | |
has_more | boolean | No | |
next_cursor | string, nullable | No | |
fetched_at | string (date-time) | No |
{
"type": "object",
"description": "List envelope — `object` list, `url`, `data` array, `has_more`, optional `next_cursor`, `fetched_at`",
"properties": {
"object": {
"type": "string",
"example": "list"
},
"url": {
"type": "string"
},
"data": {
"type": "array",
"items": {}
},
"has_more": {
"type": "boolean"
},
"next_cursor": {
"type": "string",
"nullable": true
},
"fetched_at": {
"type": "string",
"format": "date-time"
}
}
}
400 — Missing org_level or attributes — flat error body (not list envelope)
Content type: application/json
Schema
Validation / client error returned for some 400 responses (not wrapped in the list/single envelope).
| Property | Type | Required | Description |
|---|---|---|---|
type | string | No | |
code | string | No | |
message | string | No | |
param | string, nullable | No |
{
"type": "object",
"description": "Validation / client error returned for some 400 responses (not wrapped in the list/single envelope).\n",
"properties": {
"type": {
"type": "string",
"example": "invalid_request"
},
"code": {
"type": "string",
"example": "unit_id_required"
},
"message": {
"type": "string"
},
"param": {
"type": "string",
"nullable": true
}
}
}
401 — Authentication failed. The request is missing a token, the token is invalid, or the token has expired.
Content type: application/json
Schema
Structured error envelope returned by external gateway endpoints (/v1/api/*). Wraps a single error object with type, code, human-readable message, the offending param (when applicable), and an optional documentation URL.
| Property | Type | Required | Description |
|---|---|---|---|
error | object | No |
{
"type": "object",
"description": "Structured error envelope returned by external gateway endpoints (`/v1/api/*`).\nWraps a single `error` object with `type`, `code`, human-readable `message`, the offending\n`param` (when applicable), and an optional documentation URL.\n",
"properties": {
"error": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "High-level error category (for example `unauthorized`, `invalid_parameter`, `validation_error`).",
"example": "invalid_parameter"
},
"code": {
"type": "string",
"description": "Machine-readable error code; clients should branch on this rather than `message`.",
"example": "invalid_parameter"
},
"message": {
"type": "string",
"description": "Human-readable description of the error.",
"example": "One or more request parameters are invalid."
},
"param": {
"type": "string",
"description": "Name of the request parameter or field that caused the error, when applicable.",
"example": "page_number",
"nullable": true
},
"doc_url": {
"type": "string",
"description": "Optional URL to documentation describing the error.",
"example": "https://{APP_URL}/kernel/errors/invalid_parameter",
"nullable": true
}
}
}
}
}
500 — An unexpected error occurred while processing the request.
Content type: application/json
Schema
Structured error envelope returned by external gateway endpoints (/v1/api/*). Wraps a single error object with type, code, human-readable message, the offending param (when applicable), and an optional documentation URL.
| Property | Type | Required | Description |
|---|---|---|---|
error | object | No |
{
"type": "object",
"description": "Structured error envelope returned by external gateway endpoints (`/v1/api/*`).\nWraps a single `error` object with `type`, `code`, human-readable `message`, the offending\n`param` (when applicable), and an optional documentation URL.\n",
"properties": {
"error": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "High-level error category (for example `unauthorized`, `invalid_parameter`, `validation_error`).",
"example": "invalid_parameter"
},
"code": {
"type": "string",
"description": "Machine-readable error code; clients should branch on this rather than `message`.",
"example": "invalid_parameter"
},
"message": {
"type": "string",
"description": "Human-readable description of the error.",
"example": "One or more request parameters are invalid."
},
"param": {
"type": "string",
"description": "Name of the request parameter or field that caused the error, when applicable.",
"example": "page_number",
"nullable": true
},
"doc_url": {
"type": "string",
"description": "Optional URL to documentation describing the error.",
"example": "https://{APP_URL}/kernel/errors/invalid_parameter",
"nullable": true
}
}
}
}
}