Stores how many systems each organization still has on the old my
(legacy.my.nethesis.it). Called by the legacy sync with the owner API key, once per
run; the values come back through legacy in /systems/totals and through
legacy_systems_count in the organization stats and lists.
The payload is the COMPLETE picture and replaces the stored counters wholesale: an
organization missing from it is an organization with no legacy systems left. That is
what lets a counter fall back to zero as machines migrate, which an upsert-only
endpoint could never do. An empty counts array is therefore legitimate and clears
every counter.
Restricted to the Owner organization: the payload spans the whole fleet, so a partner writing it could inflate or erase any other partner's counter.
Transitional endpoint: it exists for as long as two portals answer for the same partner, and is removed at the legacy decommission.
curl \
--request PUT 'https://api.your-domain.com/api/legacy-systems/counts' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"counts": [
{
"organization_id": "obhdyclbfx4t",
"total": 12
}
]
}'
{
"counts": [
{
"organization_id": "obhdyclbfx4t",
"total": 12
}
]
}
{
"code": 200,
"message": "legacy systems counts stored",
"data": {
"organizations": 478,
"systems": 16890
}
}
{
"code": 400,
"message": "validation failed",
"data": {
"type": "validation_error",
"errors": [
{
"key": "username",
"message": "required",
"value": "string"
}
]
}
}
{
"code": 401,
"message": "invalid token",
"data": {}
}
{
"code": 403,
"message": "insufficient permissions",
"data": {}
}
{
"code": 500,
"message": "internal server error",
"data": {}
}