Set the total budget
curl --request PUT \
--url https://api.magnific.com/v2/team/budget \
--header 'Content-Type: application/json' \
--header 'x-magnific-api-key: <api-key>' \
--data '
{
"total_credits": 1500000000
}
'import requests
url = "https://api.magnific.com/v2/team/budget"
payload = { "total_credits": 1500000000 }
headers = {
"x-magnific-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-magnific-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({total_credits: 1500000000})
};
fetch('https://api.magnific.com/v2/team/budget', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.magnific.com/v2/team/budget",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'total_credits' => 1500000000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-magnific-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.magnific.com/v2/team/budget"
payload := strings.NewReader("{\n \"total_credits\": 1500000000\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-magnific-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.magnific.com/v2/team/budget")
.header("x-magnific-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"total_credits\": 1500000000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magnific.com/v2/team/budget")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-magnific-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"total_credits\": 1500000000\n}"
response = http.request(request)
puts response.read_body{
"data": {
"consumed": {
"magnific_credits": 1246000000,
"provider_credits": 0,
"total_credits": 1246000000
},
"period_start": "2026-11-01",
"available_credits": 156000000,
"total_credits": 1402000000,
"carried_credits": 1246000000,
"enabled": true
}
}Budgets API
Set the total budget
Set your organization’s total budget, while it is being piloted.
PUT
/
v2
/
team
/
budget
Set the total budget
curl --request PUT \
--url https://api.magnific.com/v2/team/budget \
--header 'Content-Type: application/json' \
--header 'x-magnific-api-key: <api-key>' \
--data '
{
"total_credits": 1500000000
}
'import requests
url = "https://api.magnific.com/v2/team/budget"
payload = { "total_credits": 1500000000 }
headers = {
"x-magnific-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-magnific-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({total_credits: 1500000000})
};
fetch('https://api.magnific.com/v2/team/budget', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.magnific.com/v2/team/budget",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'total_credits' => 1500000000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-magnific-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.magnific.com/v2/team/budget"
payload := strings.NewReader("{\n \"total_credits\": 1500000000\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-magnific-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.magnific.com/v2/team/budget")
.header("x-magnific-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"total_credits\": 1500000000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magnific.com/v2/team/budget")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-magnific-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"total_credits\": 1500000000\n}"
response = http.request(request)
puts response.read_body{
"data": {
"consumed": {
"magnific_credits": 1246000000,
"provider_credits": 0,
"total_credits": 1246000000
},
"period_start": "2026-11-01",
"available_credits": 156000000,
"total_credits": 1402000000,
"carried_credits": 1246000000,
"enabled": true
}
}Authorizations
magnificApiKeybearerAuth
Your Magnific API key. Required for authentication. Learn how to obtain an API key
Headers
Body
application/json
Response
The total budget.
Was this page helpful?