[POST] .../v1/target/get
Returns targets. Use this method to retrieve firm and personal targets for dashboards, target setup screens and target history workflows. The response contains targets visible to the current user according to global or personal target permissions; filters can narrow the list by target IDs, firm IDs, user IDs, owner and finished state. Missing body, invalid current user context, denied permissions, unsupported filters and storage errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| filters | Array of Filter | Optional | Optional filters by fields available for this API method. |
Filterable Fields
| Field | Type | Description |
|---|---|---|
| finished | bool | Finished flag. true returns finished targets; false returns unfinished targets. |
| firm_id | int | Firm IDs used to narrow the returned targets. |
| id | int | Target IDs used to narrow the returned targets. |
| owner | string | Target owner filter: Firm, User or Default to include both scopes allowed by current permissions. |
| user_id | int | User IDs used to narrow personal targets. Users without all-user permission can only see their own personal targets. |
Request Example
{
"filters": [
{
"Field": "firm_id",
"Operator": "In",
"Value": "2"
},
{
"Field": "owner",
"Operator": "Equal",
"Value": "Firm"
},
{
"Field": "finished",
"Operator": "Equal",
"Value": "false"
}
]
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Array of Target | Result array. |
Response Example
{
"ok": true,
"result": [
{
"id": 12,
"name": "Monthly sales amount",
"target_type": {
"id": 4,
"name": "Sales amount",
"name_key": "SALES_AMOUNT",
"description": "Sales amount target",
"last_update": 1712345600
},
"owner": "Firm",
"period_type": "Month",
"period": 1,
"value": 50000000.00,
"repeateable": true,
"finished": false,
"firm": {
"id": 2,
"name": "REGOS Retail"
},
"stock": {
"id": 8,
"name": "Main store"
},
"currency": null,
"user": null,
"last_update": 1712345600
}
]
}