Reallocate Credit Limits
curl --request PATCH \
--url https://prod-api.ringg.ai/ca/api/v0/workspace/sub/credit-limits \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"parent_credit_limit": 500000,
"allocations": {
"00000000-0000-4000-8000-000000000101": 200000,
"00000000-0000-4000-8000-000000000114": 150000
}
}
'import requests
url = "https://prod-api.ringg.ai/ca/api/v0/workspace/sub/credit-limits"
payload = {
"parent_credit_limit": 500000,
"allocations": {
"00000000-0000-4000-8000-000000000101": 200000,
"00000000-0000-4000-8000-000000000114": 150000
}
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
parent_credit_limit: 500000,
allocations: {
'00000000-0000-4000-8000-000000000101': 200000,
'00000000-0000-4000-8000-000000000114': 150000
}
})
};
fetch('https://prod-api.ringg.ai/ca/api/v0/workspace/sub/credit-limits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"parent_workspace_id": "00000000-0000-4000-8000-000000000107",
"parent_credit_limit": "500000.00",
"allocations": {
"00000000-0000-4000-8000-000000000101": "200000.00",
"00000000-0000-4000-8000-000000000114": "150000.00"
},
"primary": {
"id": "00000000-0000-4000-8000-000000000107",
"name": "Acme Collections HQ"
}
}{
"message": "This family uses common billing; per-sub credit limits do not exist."
}{
"message": "Invalid credentials"
}{
"message": "Sub-workspaces are not enabled for this workspace."
}{
"message": "Workspace is not a sub-workspace family parent."
}{
"message": "An unexpected error occurred. Please try again later."
}Reallocate Credit Limits
Set every Ringg Space’s credit limit in one call, and optionally the family total, for postpaid Ringg Space families in individual billing mode.
PATCH
/
workspace
/
sub
/
credit-limits
Reallocate Credit Limits
curl --request PATCH \
--url https://prod-api.ringg.ai/ca/api/v0/workspace/sub/credit-limits \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"parent_credit_limit": 500000,
"allocations": {
"00000000-0000-4000-8000-000000000101": 200000,
"00000000-0000-4000-8000-000000000114": 150000
}
}
'import requests
url = "https://prod-api.ringg.ai/ca/api/v0/workspace/sub/credit-limits"
payload = {
"parent_credit_limit": 500000,
"allocations": {
"00000000-0000-4000-8000-000000000101": 200000,
"00000000-0000-4000-8000-000000000114": 150000
}
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
parent_credit_limit: 500000,
allocations: {
'00000000-0000-4000-8000-000000000101': 200000,
'00000000-0000-4000-8000-000000000114': 150000
}
})
};
fetch('https://prod-api.ringg.ai/ca/api/v0/workspace/sub/credit-limits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"parent_workspace_id": "00000000-0000-4000-8000-000000000107",
"parent_credit_limit": "500000.00",
"allocations": {
"00000000-0000-4000-8000-000000000101": "200000.00",
"00000000-0000-4000-8000-000000000114": "150000.00"
},
"primary": {
"id": "00000000-0000-4000-8000-000000000107",
"name": "Acme Collections HQ"
}
}{
"message": "This family uses common billing; per-sub credit limits do not exist."
}{
"message": "Invalid credentials"
}{
"message": "Sub-workspaces are not enabled for this workspace."
}{
"message": "Workspace is not a sub-workspace family parent."
}{
"message": "An unexpected error occurred. Please try again later."
}Use it to split the family’s credit limit across clients or teams, or to raise one client’s limit while keeping the total unchanged.
Rules
- Values are absolute limits, not deltas.
- A Ringg Space’s limit cannot go below what it has already used this month.
- The sum of all allocations cannot exceed the family total. Allocating less than the total is allowed; the remainder stays with the primary.
- What remains with the primary must still cover the primary’s own utilized amount.
- In a common-billing family there are no per-Ringg Space limits: every charge utilizes the primary’s single credit limit, and this endpoint returns
400. Allocate concurrency instead.
Notes
- Read the current limits and usage from Get Ringg Spaces first, then send the full map.
- Amounts in the request can be JSON numbers (
200000) or numeric strings ("200000.00"); they are rounded to two decimals. - Amounts in the response are decimal strings (
"200000.00"), unlike the read endpoints.
Errors
400:Credit-limit reallocation applies to postpaid families only.400:This family uses common billing; per-sub credit limits do not exist.400:Allocations must cover every active sub-workspace exactly once. Missing: [...]; unknown: [...].400:Credit limit 100.00 for sub-workspace 'Mumbai Collections' is below its utilized amount 34210.50.400:The total credit limit across sub-workspaces must not exceed the parent workspace's credit limit (500000.00); allocations sum to 600000.00.400:These allocations would leave the primary workspace with 1000.00, below its already-utilized 12500.00. Lower the sub-workspace limits or raise the primary credit limit.401: Invalid or missing API key.403:Sub-workspaces are not enabled for this workspace.— Ringg Spaces are not enabled on the primary, or the key belongs to a Ringg Space.404:Workspace is not a sub-workspace family parent.— the primary has no Ringg Spaces yet.422: Empty map, negative value, or a key that is not a UUID.
Body
application/json
Response
Successful Response: The applied limits. Amounts are decimal strings.
Was this page helpful?