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.Rate limits:
- Burst: 10/s
- Steady: 150/m
Path parameters
parametersRequest schema
bodyResponse schemas
›
400
application/json
›
500
application/json
curl -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
}
400 Bad Request
{
"code": 400,
"title": "Bad request.",
"message": "The request body is not valid.",
"trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
500 Internal Server Error
{
"code": 500,
"title": "Internal server error.",
"message": "Internal server error."
}
Responses