Create Account limit
Create Account limit
POST
https://api.ocamba.com/v2/ocamba/accounts/{id}/limits
Creates a new Account limit object
Note
Unique constraint is defined on a combination of the following fields: type, item and period. If you try to create two AccountLimit objects with same values on this combination of fields, the second object will be considered as
Duplicate entry and your request will be rejected.Path parameters
parametersRequest schema
bodycurl -X POST \
"https://api.ocamba.com/v2/ocamba/accounts/{id}/limits" \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"type": "frequency",
"item": "clicks",
"period": "day",
"value": 120
}'const url = 'https://api.ocamba.com/v2/ocamba/accounts/{id}/limits';
const options = {
method: 'POST',
headers: {
Authorization: "Bearer {TOKEN}",
'Content-Type': "application/json"
},
body: JSON.stringify(
{
"type": "frequency",
"item": "clicks",
"period": "day",
"value": 120
}
)
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}$ch = curl_init("https://api.ocamba.com/v2/ocamba/accounts/{id}/limits");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {TOKEN}",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
[
"type" => "frequency",
"item" => "clicks",
"period" => "day",
"value" => 120
]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);curl -X POST \
"https://api.ocamba.com/v2/ocamba/accounts/{id}/limits" \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"type": "budget",
"item": "income",
"period": "day",
"value": 161
}'const url = 'https://api.ocamba.com/v2/ocamba/accounts/{id}/limits';
const options = {
method: 'POST',
headers: {
Authorization: "Bearer {TOKEN}",
'Content-Type': "application/json"
},
body: JSON.stringify(
{
"type": "budget",
"item": "income",
"period": "day",
"value": 161
}
)
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}$ch = curl_init("https://api.ocamba.com/v2/ocamba/accounts/{id}/limits");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {TOKEN}",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
[
"type" => "budget",
"item" => "income",
"period" => "day",
"value" => 161
]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);Responses
201 Created
{
"id": "2084",
"company_id": "1234543",
"account_id": "16274541",
"type": "frequency",
"item": "clicks",
"period": "day",
"value": 120
}
Responses