Update user budget
Update the user’s budget. This is only available if the user has budget update permission.
curl --request PATCH \
--url https://your_a2_service/user/budget \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"budget": 123,
"campaign_count": 1,
"creative_count": 1,
"credit": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"permissions": {},
"placement_count": 1,
"preferences": {
"etc": {
"language": "ko"
},
"notification_methods": {
"email": true,
"slack": false,
"sms": false
},
"notification_methods_data": {
"slack": "<SLACK_WEBHOOK_URL>",
"sms": ""
},
"notifications": {
"attribute_deleted": true,
"campaign_finished": true,
"publish_approval": true,
"publish_request": true
}
},
"email": "jsmith@example.com",
"is_active": true,
"is_superuser": true,
"is_verified": true,
"password": "<string>"
}
'import requests
url = "https://your_a2_service/user/budget"
payload = {
"budget": 123,
"campaign_count": 1,
"creative_count": 1,
"credit": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"permissions": {},
"placement_count": 1,
"preferences": {
"etc": { "language": "ko" },
"notification_methods": {
"email": True,
"slack": False,
"sms": False
},
"notification_methods_data": {
"slack": "<SLACK_WEBHOOK_URL>",
"sms": ""
},
"notifications": {
"attribute_deleted": True,
"campaign_finished": True,
"publish_approval": True,
"publish_request": True
}
},
"email": "jsmith@example.com",
"is_active": True,
"is_superuser": True,
"is_verified": True,
"password": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
budget: 123,
campaign_count: 1,
creative_count: 1,
credit: 123,
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
permissions: {},
placement_count: 1,
preferences: {
etc: {language: 'ko'},
notification_methods: {email: true, slack: false, sms: false},
notification_methods_data: {slack: '<SLACK_WEBHOOK_URL>', sms: ''},
notifications: {
attribute_deleted: true,
campaign_finished: true,
publish_approval: true,
publish_request: true
}
},
email: 'jsmith@example.com',
is_active: true,
is_superuser: true,
is_verified: true,
password: '<string>'
})
};
fetch('https://your_a2_service/user/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://your_a2_service/user/budget",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'budget' => 123,
'campaign_count' => 1,
'creative_count' => 1,
'credit' => 123,
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'permissions' => [
],
'placement_count' => 1,
'preferences' => [
'etc' => [
'language' => 'ko'
],
'notification_methods' => [
'email' => true,
'slack' => false,
'sms' => false
],
'notification_methods_data' => [
'slack' => '<SLACK_WEBHOOK_URL>',
'sms' => ''
],
'notifications' => [
'attribute_deleted' => true,
'campaign_finished' => true,
'publish_approval' => true,
'publish_request' => true
]
],
'email' => 'jsmith@example.com',
'is_active' => true,
'is_superuser' => true,
'is_verified' => true,
'password' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://your_a2_service/user/budget"
payload := strings.NewReader("{\n \"budget\": 123,\n \"campaign_count\": 1,\n \"creative_count\": 1,\n \"credit\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"permissions\": {},\n \"placement_count\": 1,\n \"preferences\": {\n \"etc\": {\n \"language\": \"ko\"\n },\n \"notification_methods\": {\n \"email\": true,\n \"slack\": false,\n \"sms\": false\n },\n \"notification_methods_data\": {\n \"slack\": \"<SLACK_WEBHOOK_URL>\",\n \"sms\": \"\"\n },\n \"notifications\": {\n \"attribute_deleted\": true,\n \"campaign_finished\": true,\n \"publish_approval\": true,\n \"publish_request\": true\n }\n },\n \"email\": \"jsmith@example.com\",\n \"is_active\": true,\n \"is_superuser\": true,\n \"is_verified\": true,\n \"password\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://your_a2_service/user/budget")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"budget\": 123,\n \"campaign_count\": 1,\n \"creative_count\": 1,\n \"credit\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"permissions\": {},\n \"placement_count\": 1,\n \"preferences\": {\n \"etc\": {\n \"language\": \"ko\"\n },\n \"notification_methods\": {\n \"email\": true,\n \"slack\": false,\n \"sms\": false\n },\n \"notification_methods_data\": {\n \"slack\": \"<SLACK_WEBHOOK_URL>\",\n \"sms\": \"\"\n },\n \"notifications\": {\n \"attribute_deleted\": true,\n \"campaign_finished\": true,\n \"publish_approval\": true,\n \"publish_request\": true\n }\n },\n \"email\": \"jsmith@example.com\",\n \"is_active\": true,\n \"is_superuser\": true,\n \"is_verified\": true,\n \"password\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/user/budget")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"budget\": 123,\n \"campaign_count\": 1,\n \"creative_count\": 1,\n \"credit\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"permissions\": {},\n \"placement_count\": 1,\n \"preferences\": {\n \"etc\": {\n \"language\": \"ko\"\n },\n \"notification_methods\": {\n \"email\": true,\n \"slack\": false,\n \"sms\": false\n },\n \"notification_methods_data\": {\n \"slack\": \"<SLACK_WEBHOOK_URL>\",\n \"sms\": \"\"\n },\n \"notifications\": {\n \"attribute_deleted\": true,\n \"campaign_finished\": true,\n \"publish_approval\": true,\n \"publish_request\": true\n }\n },\n \"email\": \"jsmith@example.com\",\n \"is_active\": true,\n \"is_superuser\": true,\n \"is_verified\": true,\n \"password\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"budget": 123,
"campaign_count": 1,
"creative_count": 1,
"credit": 123,
"email": "jsmith@example.com",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"is_superuser": true,
"is_verified": true,
"permissions": {},
"placement_count": 1,
"preferences": {
"etc": {
"language": "ko"
},
"notification_methods": {
"email": true,
"slack": false,
"sms": false
},
"notification_methods_data": {
"slack": "<SLACK_WEBHOOK_URL>",
"sms": ""
},
"notifications": {
"attribute_deleted": true,
"campaign_finished": true,
"publish_approval": true,
"publish_request": true
}
},
"role": "advertiser",
"name": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
Represents an update command for a user.
The total budget currently available to the user.
The number of campaigns owned by the user.
x >= 0The number of creatives owned by the user.
x >= 0The total credit currently available to the user.
The ID of the user.
The name of the user.
4 - 32The permissions information of the user.
{}
{
"admin": [],
"advertiser": ["permission"],
"analytic": ["campaign"],
"audience": [],
"audience_attribute": ["r"],
"audience_segment": ["r", "w"],
"campaign": ["r", "w"],
"creative": ["r", "w"],
"placement": ["r"],
"retailer": []
}
{
"admin": ["list_advertisers", "budget"],
"advertiser": [],
"analytic": ["placement"],
"audience": ["r"],
"audience_attribute": ["r", "w"],
"audience_segment": ["r", "w"],
"campaign": ["r"],
"creative": ["r", "w"],
"placement": ["r", "w"],
"retailer": ["approval", "permission"]
}
The number of placements owned by the user.
x >= 0Represents a user preferences.
Show child attributes
Show child attributes
The email of the user.
Is the user active.
Is the user admin.
Is the user email is verified.
The password of the user.
Response
Successful Response
Represents a read command for a user.
The total budget currently available to the user.
The number of campaigns owned by the user.
x >= 0The number of creatives owned by the user.
x >= 0The total credit currently available to the user.
The email of the user.
The id of the user.
Is the user active.
Is the user admin.
Is the user email is verified.
The permissions information of the user.
{}
{
"admin": [],
"advertiser": ["permission"],
"analytic": ["campaign"],
"audience": [],
"audience_attribute": ["r"],
"audience_segment": ["r", "w"],
"campaign": ["r", "w"],
"creative": ["r", "w"],
"placement": ["r"],
"retailer": []
}
{
"admin": ["list_advertisers", "budget"],
"advertiser": [],
"analytic": ["placement"],
"audience": ["r"],
"audience_attribute": ["r", "w"],
"audience_segment": ["r", "w"],
"campaign": ["r"],
"creative": ["r", "w"],
"placement": ["r", "w"],
"retailer": ["approval", "permission"]
}
The number of placements owned by the user.
x >= 0Represents a user preferences.
Show child attributes
Show child attributes
User role enum.
advertiser, retailer, admin The name of the user.
Was this page helpful?
curl --request PATCH \
--url https://your_a2_service/user/budget \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"budget": 123,
"campaign_count": 1,
"creative_count": 1,
"credit": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"permissions": {},
"placement_count": 1,
"preferences": {
"etc": {
"language": "ko"
},
"notification_methods": {
"email": true,
"slack": false,
"sms": false
},
"notification_methods_data": {
"slack": "<SLACK_WEBHOOK_URL>",
"sms": ""
},
"notifications": {
"attribute_deleted": true,
"campaign_finished": true,
"publish_approval": true,
"publish_request": true
}
},
"email": "jsmith@example.com",
"is_active": true,
"is_superuser": true,
"is_verified": true,
"password": "<string>"
}
'import requests
url = "https://your_a2_service/user/budget"
payload = {
"budget": 123,
"campaign_count": 1,
"creative_count": 1,
"credit": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"permissions": {},
"placement_count": 1,
"preferences": {
"etc": { "language": "ko" },
"notification_methods": {
"email": True,
"slack": False,
"sms": False
},
"notification_methods_data": {
"slack": "<SLACK_WEBHOOK_URL>",
"sms": ""
},
"notifications": {
"attribute_deleted": True,
"campaign_finished": True,
"publish_approval": True,
"publish_request": True
}
},
"email": "jsmith@example.com",
"is_active": True,
"is_superuser": True,
"is_verified": True,
"password": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
budget: 123,
campaign_count: 1,
creative_count: 1,
credit: 123,
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
permissions: {},
placement_count: 1,
preferences: {
etc: {language: 'ko'},
notification_methods: {email: true, slack: false, sms: false},
notification_methods_data: {slack: '<SLACK_WEBHOOK_URL>', sms: ''},
notifications: {
attribute_deleted: true,
campaign_finished: true,
publish_approval: true,
publish_request: true
}
},
email: 'jsmith@example.com',
is_active: true,
is_superuser: true,
is_verified: true,
password: '<string>'
})
};
fetch('https://your_a2_service/user/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://your_a2_service/user/budget",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'budget' => 123,
'campaign_count' => 1,
'creative_count' => 1,
'credit' => 123,
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'permissions' => [
],
'placement_count' => 1,
'preferences' => [
'etc' => [
'language' => 'ko'
],
'notification_methods' => [
'email' => true,
'slack' => false,
'sms' => false
],
'notification_methods_data' => [
'slack' => '<SLACK_WEBHOOK_URL>',
'sms' => ''
],
'notifications' => [
'attribute_deleted' => true,
'campaign_finished' => true,
'publish_approval' => true,
'publish_request' => true
]
],
'email' => 'jsmith@example.com',
'is_active' => true,
'is_superuser' => true,
'is_verified' => true,
'password' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://your_a2_service/user/budget"
payload := strings.NewReader("{\n \"budget\": 123,\n \"campaign_count\": 1,\n \"creative_count\": 1,\n \"credit\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"permissions\": {},\n \"placement_count\": 1,\n \"preferences\": {\n \"etc\": {\n \"language\": \"ko\"\n },\n \"notification_methods\": {\n \"email\": true,\n \"slack\": false,\n \"sms\": false\n },\n \"notification_methods_data\": {\n \"slack\": \"<SLACK_WEBHOOK_URL>\",\n \"sms\": \"\"\n },\n \"notifications\": {\n \"attribute_deleted\": true,\n \"campaign_finished\": true,\n \"publish_approval\": true,\n \"publish_request\": true\n }\n },\n \"email\": \"jsmith@example.com\",\n \"is_active\": true,\n \"is_superuser\": true,\n \"is_verified\": true,\n \"password\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://your_a2_service/user/budget")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"budget\": 123,\n \"campaign_count\": 1,\n \"creative_count\": 1,\n \"credit\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"permissions\": {},\n \"placement_count\": 1,\n \"preferences\": {\n \"etc\": {\n \"language\": \"ko\"\n },\n \"notification_methods\": {\n \"email\": true,\n \"slack\": false,\n \"sms\": false\n },\n \"notification_methods_data\": {\n \"slack\": \"<SLACK_WEBHOOK_URL>\",\n \"sms\": \"\"\n },\n \"notifications\": {\n \"attribute_deleted\": true,\n \"campaign_finished\": true,\n \"publish_approval\": true,\n \"publish_request\": true\n }\n },\n \"email\": \"jsmith@example.com\",\n \"is_active\": true,\n \"is_superuser\": true,\n \"is_verified\": true,\n \"password\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/user/budget")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"budget\": 123,\n \"campaign_count\": 1,\n \"creative_count\": 1,\n \"credit\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"permissions\": {},\n \"placement_count\": 1,\n \"preferences\": {\n \"etc\": {\n \"language\": \"ko\"\n },\n \"notification_methods\": {\n \"email\": true,\n \"slack\": false,\n \"sms\": false\n },\n \"notification_methods_data\": {\n \"slack\": \"<SLACK_WEBHOOK_URL>\",\n \"sms\": \"\"\n },\n \"notifications\": {\n \"attribute_deleted\": true,\n \"campaign_finished\": true,\n \"publish_approval\": true,\n \"publish_request\": true\n }\n },\n \"email\": \"jsmith@example.com\",\n \"is_active\": true,\n \"is_superuser\": true,\n \"is_verified\": true,\n \"password\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"budget": 123,
"campaign_count": 1,
"creative_count": 1,
"credit": 123,
"email": "jsmith@example.com",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"is_superuser": true,
"is_verified": true,
"permissions": {},
"placement_count": 1,
"preferences": {
"etc": {
"language": "ko"
},
"notification_methods": {
"email": true,
"slack": false,
"sms": false
},
"notification_methods_data": {
"slack": "<SLACK_WEBHOOK_URL>",
"sms": ""
},
"notifications": {
"attribute_deleted": true,
"campaign_finished": true,
"publish_approval": true,
"publish_request": true
}
},
"role": "advertiser",
"name": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}