POST
/api/agent-network/budget-rulesCreate an Agent Network budget rule
Creates a new account-level budget rule. Supply name and limits, including both token and budget limits, and use target_groups and target_users to scope the rule; empty target lists make it account-wide. A 200 response returns the created rule with its identifier, limits, targets, enforcement state, and timestamps.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Account-level budget rule configuration. name and limits are required.
enabledbooleanoptional
Whether the rule is enforced. Defaults to true on create.
limitsobjectrequired
Token and budget caps attached directly to the policy. These compose with any guardrail-level checks.
namestringrequired
Display name for the budget rule.
target_groupsarray<string>optional
NetBird group ids the rule binds. Empty plus empty target_users means account-wide.
target_usersarray<string>optional
NetBird user ids the rule binds directly.
200Returns the created budget rule, including its ID, name, enforcement state, targets, limits, and creation and update timestamps.
created_atstringrequired
enabledbooleanrequired
Whether the rule is enforced.
idstringrequired
Budget rule ID.
limitsobjectrequired
Token and budget caps attached directly to the policy. These compose with any guardrail-level checks.
namestringrequired
Display name for the budget rule.
target_groupsarray<string>required
NetBird group ids the rule binds. Empty plus empty target_users means account-wide.
target_usersarray<string>required
NetBird user ids the rule binds directly.
updated_atstringrequired
400Returned when the request is malformed or a required field or value fails validation.
401Returned when authentication is missing or invalid.
403Returned when the authenticated user is not permitted to create the budget rule.
500Returned when an internal server error occurs.
Error handling
A 400 is returned when the request is malformed or invalid. A 401 is returned when authentication is missing or invalid; a 403 is returned when access is forbidden; a 500 is returned for an internal server error. name and limits are required, and limits must include both token_limit and budget_limit.