Create a budget for the organization.

POST /api/v1/billing/organization/{organization_id}/budget

Create a new budget for an organization

Path parameters

  • organization_id string Required

    The organization ID

application/json

Body Required

  • active boolean

    Whether the budget is active

    Default value is true.

  • alerts array[object] Required

    List of budget alerts. The service enforces a server-side limit on the number of alerts per budget.

    Hide alerts attributes Show alerts attributes object
    • operator string Required

      Alert operator

      Values are gte or lte.

    • threshold integer Required

      Alert threshold value

    • threshold_type string Required

      Whether threshold is a percentage or absolute amount

      Values are percentage or amount.

  • amount integer Required

    Budget amount in ECU

  • name string

    Optional name for the budget

  • period string Required

    Budget period

    Value is monthly.

  • recipient_group array[string]

    Optional list of recipient types who receive budget alerts (organization-admins, billing-admins, resource-viewers, resource-editors, resource-admins). resource-viewers, resource-editors and resource-admins cannot be used with scope_type=organization. organization-admins, billing-admins are included by default if recipient_group is not provided.

    Values are organization-admins, billing-admins, resource-viewers, resource-editors, or resource-admins.

  • scope_type string Required

    The scope type of the budget

    Values are organization or cloud_resource.

  • scope_values array[string] Required

    List of scope values

Responses

  • 200 application/json

    Budget created successfully

    Hide response attribute Show response attribute object
    • id integer

      The created budget ID

  • 400

    Invalid request

  • 403

    Not allowed to create this budget

  • 500

    Internal Server Error

POST /api/v1/billing/organization/{organization_id}/budget
curl \
 --request POST 'https://cloud.elastic.co/api/v1/billing/organization/{organization_id}/budget' \
 --header "Content-Type: application/json" \
 --data '{"active":true,"alerts":[{"operator":"gte","threshold":42,"threshold_type":"percentage"}],"amount":42,"name":"string","period":"monthly","recipient_group":["organization-admins"],"scope_type":"organization","scope_values":["string"]}'
Response examples (200)
{
  "id": 432433423
}