Entity status counts for a conversation
Learn more about entity status counts for a conversation.
Use the Entity status counts for a conversation to get the entity status counts for a conversation. This lets you get per-entity status counts without listing every entity.
HTTP method and endpoint
Use the following HTTP method and endpoint path to entity status counts for a conversation.
POST {TenantURL}/ai/agentflow/api/v202605/{tenant_id}/lrt/jobs/conversation/{conversation_id}/entities/summary
The following table describes the endpoint path parameters.
| Parameter | Type | Required | Description |
|---|---|---|---|
TenantURL | String | Yes | The base URL for your tenant. |
conversation_id | String | Yes | The unique identifier of the conversation associated with the job. |
tenant_id | String | Yes | The tenant identifier. |
Request headers
The following request headers must be included.
| Header | Value | Required |
|---|---|---|
Authorization | <access_token> | Yes |
Content-Type | application/json | Yes |
Request body
The following table describes the request body parameters.
| Parameter | Type | Required | Description | Accepted values / Default |
|---|---|---|---|---|
| filter_condition | Object | No | The entity type or status filter to scope the counts. | — |
| filter_condition.entity_type | String | No | Returns only entities of this entity type. | — |
| filter_condition.entity_id | String | No | Returns only the entity with this identifier. | — |
| filter_condition.status | String | No | Returns only entities with this processing status. | — |
| filter_condition.decision_code | String | No | Returns only entities with this decision code (for example NO_MATCH). | — |
| run_id | String | No | Scopes the counts to a single worker run. | — |
Example request
Use the following example to see how a complete request is structured, with headers and a JSON body.
POST {TenantURL}/ai/agentflow/api/v202605/tenant-xyz/lrt/jobs/conversation/example-id/entities/summary
Authorization: <access_token>
Content-Type: application/json
{
"filter_condition": {
"entity_type": "<string>",
"entity_id": "<string>",
"status": "<string>",
"decision_code": "<string>"
},
"run_id": "<string>"
}
Response body
The following table describes the fields returned in the response body.
| Parameter | Type | Description |
|---|---|---|
conversation_id | String | The unique identifier of the conversation. |
total | Integer | The total number of entities counted. |
counts | Object | The entity counts, grouped by status. |
counts.processed | Integer | The number of entities that completed successfully. |
counts.failed | Integer | The number of entities that failed processing. |
counts.needs_review | Integer | The number of entities that are waiting for review. |
by_entity_type | Array | The status counts, broken down by entity type. |
by_entity_type[].entity_type | String | The entity type, or unknown when the agent did not provide one. |
by_entity_type[].processed | Integer | The number of entities of this type that completed successfully. |
by_entity_type[].failed | Integer | The number of entities of this type that failed processing. |
by_entity_type[].needs_review | Integer | The number of entities of this type that are waiting for review. |
by_entity_type[].total | Integer | The total number of entities of this type. |
top_reasons | Array | The most common short reasons, ordered by count (highest first). |
top_reasons[].reason | String | The short explanation text. |
top_reasons[].status | String | The status that the reason was recorded against. |
top_reasons[].count | Integer | The number of entities with this reason. |
top_reasons_truncated | Boolean | Whether some reasons were omitted because the top-reasons limit was reached. |
by_decision_code | Array | The counts grouped by decision code. |
by_decision_code[].decision_code | String | The outcome code for the entity (for example NO_MATCH). |
by_decision_code[].status | String | The status that the decision code was recorded against. |
by_decision_code[].count | Integer | The number of entities with this decision code. |
sample_entities | Array | A few matching entity rows, so you can see example entity_id, decision_code, and reason values before building a filter. |
sample_entities[].entity_id | String | The unique identifier of the entity. |
sample_entities[].entity_type | String | The entity type name. |
sample_entities[].label | String | The display label of the entity. |
sample_entities[].status | String | The processing status of the entity: processed, failed, or needs_review. |
sample_entities[].decision_code | String | The outcome code for the entity (for example NO_MATCH). |
sample_entities[].reason | String | A short explanation of the outcome, shortened for display. |
sample_entities[].confidence | String | The confidence band for the outcome, when available. |
sample_entities[].run_id | String | The unique identifier of the run that processed this entity. |
filtered_total | Integer | The count for the requested status filter, when one was supplied. |
truncated | Boolean | Whether the count reached the page limit, so the counts may be lower than the actual totals. |
Example response
The following example shows a response with successful response.
{
"conversation_id": "<string>",
"total": 0,
"counts": {
"processed": 0,
"failed": 0,
"needs_review": 0
},
"by_entity_type": [
{
"entity_type": "<string>",
"processed": 0,
"failed": 0,
"needs_review": 0,
"total": 0
}
],
"top_reasons": [
{
"reason": "<string>",
"status": "<string>",
"count": 0
}
],
"top_reasons_truncated": false,
"by_decision_code": [
{
"decision_code": "<string>",
"status": "<string>",
"count": 0
}
],
"sample_entities": [
{
"entity_id": "<string>",
"entity_type": "<string>",
"label": "<string>",
"status": "<string>",
"decision_code": "<string>",
"reason": "<string>",
"confidence": "<string>",
"run_id": "<string>"
}
],
"filtered_total": 0,
"truncated": false
}
Error codes and recommended actions
The following table lists the possible error responses returned by this API.
| HTTP status | Description | Recommended action |
|---|---|---|
422 Unprocessable Entity | Validation Error | Review the request parameters or body, correct the invalid values, and resend the request. |