Create a budget for an organization
Creates a new budget for an organization. The authenticated user must be an organization admin or billing manager.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The organization name. The name is not case sensitive.
Request Body
Section titled “ Request Body ”object
The budget amount in whole dollars. For license-based products, this represents the number of licenses.
Whether to prevent additional spending once the budget is exceeded. For user and multi_user_customer scopes, this must be true.
object
Whether alerts are enabled for this budget
Array of user login names who will receive alerts
The scope of the budget for this organization.
organization: Apply the budget to the organization.repository: Apply the budget to a specific repository in the organization.multi_user_customer: Apply a universal budget to all users in the organization.user: Apply the budget to a single user in the organization.
user and multi_user_customer scopes are only supported when
budget_product_sku is ai_credits or premium_requests.
The name of the entity to apply the budget to
A single product or SKU that will be covered in the budget
The username of the user for user scope budgets. This field is required when budget_scope is user.
Examples
Create organization budget example
{ "budget_amount": 500, "prevent_further_usage": true, "budget_scope": "organization", "budget_entity_name": "", "budget_type": "ProductPricing", "budget_product_sku": "actions", "budget_alerting": { "will_alert": false, "alert_recipients": [] }}Responses
Section titled “ Responses ”Budget created successfully
object
A message indicating the result of the create operation
object
ID of the budget.
The type of scope for the budget
The name of the entity to apply the budget to
The budget amount in whole dollars. For license-based products, this represents the number of licenses.
Whether to prevent additional spending once the budget is exceeded
A single product or sku to apply the budget to.
object
Whether alerts are enabled for this budget
Array of user login names who will receive alerts
Examples
{ "message": "Budget successfully created.", "budget": { "id": "f5236c62-157f-4d8f-a79e-ffb91058ee97", "budget_type": "ProductPricing", "budget_product_sku": "actions", "budget_scope": "organization", "budget_entity_name": "example-organization", "budget_amount": 100, "prevent_further_usage": true, "budget_alerting": { "will_alert": false, "alert_recipients": [] } }}Bad Request
Basic Error
object
Example generated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}Scim Error
object
Example generated
{ "message": "example", "documentation_url": "example", "detail": "example", "status": 1, "scimType": "example", "schemas": [ "example" ]}Requires authentication
Basic Error
object
Example generated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}Insufficient permissions
Basic Error
object
Examples
{ "message": "Insufficient permissions to create a budget.", "documentation_url": "https://docs.github.com/rest/billing/budgets#create-a-budget-for-an-organization"}Feature not enabled or organization not found
Basic Error
object
Examples
{ "message": "Not Found", "documentation_url": "https://docs.github.com/rest/billing/budgets#create-a-budget-for-an-organization"}Validation failed, or the endpoint has been spammed.
Validation Error
object
object
Example generated
{ "message": "example", "documentation_url": "example", "errors": [ { "resource": "example", "field": "example", "message": "example", "code": "example", "index": 1, "value": [ "example" ] } ]}Internal server error
Basic Error
object
Examples
{ "message": "Unable to create budget.", "documentation_url": "https://docs.github.com/rest/billing/budgets#create-a-budget-for-an-organization"}