usage-policies-admin

Create Policy

Put a policy in force for one organization, charging it for the activity before it.

Platform admin only. A policy is immutable, so this only ever activates a new one: when a policy already governs the same template and scope, the response is a conflict naming it, and changing that budget means retiring it first.

The new policy is charged for the organization's prior activity as part of the same act, so it can be created already partly — or wholly — spent, and the response says by how much. A charge that cannot be computed refuses the whole call and creates nothing, because a policy blind to its history under-reports and under-enforces with nothing on the surface to show it.

post/admin/organizations/{organization_id}/usage-policies

Path parameters

organization_idstring uuid required

Request body

policy_template_idstring uuid required

The template whose limit behaviour this policy applies.

scope'user' | 'organization' | 'automation' required

Whose consumption a policy counts.

AUTOMATION counts the whole organization exactly as ORGANIZATION does and differs only in which activity it accepts: human and automated work draw on separate budgets, so each of those two scopes counts one of them and refuses the other.

budgetinteger nullable

Credits the scope may consume per window. Null imposes no limit, which is distinct from 0 forbidding all usage.

Response

Successful Response

Changes

Changed in 3 of the 57 revisions of this API.534

  • d5665d7046eb522See the full diff
    • ▲

      removed the required property from the response with the status

      response-required-property-removed

    • ▲

      removed the required property from the response with the status

      response-required-property-removed

    • ▲

      removed the required property from the response with the status

      response-required-property-removed

    • ▲

      removed the required property from the response with the status

      response-required-property-removed

    • ▲

      removed the required property from the response with the status

      response-required-property-removed

    • ●

      removed the optional property from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property from the response with the status

      response-optional-property-removed

    • ○

      added the required property to the response with the status

      response-required-property-added

    • ○

      added the required property to the response with the status

      response-required-property-added

  • c5e1ea955e8111See the full diff
    • ●

      added the new automation enum value to the response property for the response status

      response-property-enum-value-added

    • ○

      added the new automation enum value to the request property

      request-property-enum-value-added

    • ○

      endpoint added

      endpoint-added

Of the 57 revisions, 9 have no diff computed.