Get limits
The limits that apply to your organization and the rate card new jobs are priced with.
Autenticação
Exemplo de pedido
curl -X GET "https://runner.cargoduo.com/v1/limits" \
-H "Authorization: Bearer $CARGODUO_API_KEY"const res = await fetch("https://runner.cargoduo.com/v1/limits", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.CARGODUO_API_KEY}`,
},
});
const data = await res.json();
console.log(res.status, data);import os
import requests
response = requests.get(
"https://runner.cargoduo.com/v1/limits",
headers={"Authorization": f"Bearer {os.environ['CARGODUO_API_KEY']}"},
)
print(response.status_code, response.json())package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://runner.cargoduo.com/v1/limits", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CARGODUO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(out))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://runner.cargoduo.com/v1/limits"))
.header("Authorization", "Bearer " + System.getenv("CARGODUO_API_KEY"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("CARGODUO_API_KEY"));
var request = new HttpRequestMessage(HttpMethod.Get, "https://runner.cargoduo.com/v1/limits");
var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");<?php
$ch = curl_init('https://runner.cargoduo.com/v1/limits');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('CARGODUO_API_KEY'),
],
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), ' ', $response, PHP_EOL;require "net/http"
require "uri"
uri = URI("https://runner.cargoduo.com/v1/limits")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch("CARGODUO_API_KEY")}"
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.code, response.bodyExemplo de resposta
{
"max_items_per_request": 2000,
"max_vehicles_per_request": 20,
"max_time_limit_seconds": 90,
"allowed_vehicle_types": [
"truck",
"trailer",
"container",
"pallet"
],
"concurrency": 1,
"max_queued_jobs": 20,
"rate_limits": {
"per_minute": 60,
"per_hour": 1000,
"per_day": 5000
},
"retention_days": 14,
"rate_card": {
"version": 1,
"per_job": 0.06,
"per_vehicle": 0.2,
"per_compute_second": 0.005,
"large_load_threshold": 500,
"per_hundred_items_over": 0.02
}
}Respostas
200OKLimits and rate card.
NomeTipoObrigatórioDescriçãomax_items_per_requestintegerintegerNãoMost item units (sum of quantities) per job.
max_vehicles_per_requestintegerintegerNãoMost vehicles a job may list and load (auto-added ones included).
max_time_limit_secondsintegerintegerNãoCompute budget ceiling per job.
allowed_vehicle_typesstring[]string[]NãoVehicle types the API accepts.
concurrencyintegerintegerNãoJobs of your organization computing at the same time; more wait in the queue.
max_queued_jobsintegerintegerNãoQueued + running jobs per organization.
rate_limitsRateLimitsRateLimitsNãoRequests per window, per key and per organization.
per_minuteintegerintegerNãoper_hourintegerintegerNãoper_dayintegerintegerNãoretention_daysintegerintegerNãoDays request/result bodies and PDF links are kept.
rate_cardRateCardRateCardNãoPrices in credits (1 credit = 1 USD).
versionintegerintegerNãoper_jobnumber · creditsnumber · creditsNãoper_vehiclenumber · creditsnumber · creditsNãoPer vehicle actually loaded.
per_compute_secondnumber · creditsnumber · creditsNãoPro-rated per millisecond.
large_load_thresholdintegerintegerNãoItem units included before the surcharge applies.
per_hundred_items_overnumber · creditsnumber · creditsNãoPer started 100 units above the threshold.
401Unauthorized
unauthorizedkey_revokedkey_expiredunauthorizedMissing, malformed or unknown API key.key_revokedThe key was revoked.key_expiredThe key passed its expiry date.
Todos os códigos de erroNomeTipoObrigatórioDescriçãoerrorErrorBodyobrigatórioErrorBodySimcodestringobrigatóriostringSimMachine code (snake_case). Branch on this, never on
message.messagestringobrigatóriostringSimEnglish explanation.
request_idstringobrigatóriostringSimSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NãoPer-field problems (
validation_failed).pathstringstringNãoJSON path of the offending field, e.g. items[3].length.
codestringstringNãorequired,invalid_value,out_of_range,duplicate_id,unknown_vehicle,unknown_template,type_not_allowed,unknown_group,does_not_fit,too_many_items,too_many_vehicles,unknown_field,invalid_json.messagestringstringNãoEnglish explanation.
403Forbidden
ip_not_allowedsubscription_inactiveaccount_inactivescope_missingip_not_allowedThe calling IP is not on the key's allowlist.subscription_inactiveThe organization has no active subscription that includes the API.account_inactiveThe organization is suspended, or has no owner whose account is active.scope_missingThe key lacks a scope this endpoint needs.
Todos os códigos de erroNomeTipoObrigatórioDescriçãoerrorErrorBodyobrigatórioErrorBodySimcodestringobrigatóriostringSimMachine code (snake_case). Branch on this, never on
message.messagestringobrigatóriostringSimEnglish explanation.
request_idstringobrigatóriostringSimSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NãoPer-field problems (
validation_failed).pathstringstringNãoJSON path of the offending field, e.g. items[3].length.
codestringstringNãorequired,invalid_value,out_of_range,duplicate_id,unknown_vehicle,unknown_template,type_not_allowed,unknown_group,does_not_fit,too_many_items,too_many_vehicles,unknown_field,invalid_json.messagestringstringNãoEnglish explanation.
429Too many requests
rate_limitedrate_limitedToo many requests in the current minute, hour or day (per key or per organization), or more than 60 failed authentications per minute from your IP address.
Todos os códigos de erroNomeTipoObrigatórioDescriçãoerrorErrorBodyobrigatórioErrorBodySimcodestringobrigatóriostringSimMachine code (snake_case). Branch on this, never on
message.messagestringobrigatóriostringSimEnglish explanation.
request_idstringobrigatóriostringSimSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NãoPer-field problems (
validation_failed).pathstringstringNãoJSON path of the offending field, e.g. items[3].length.
codestringstringNãorequired,invalid_value,out_of_range,duplicate_id,unknown_vehicle,unknown_template,type_not_allowed,unknown_group,does_not_fit,too_many_items,too_many_vehicles,unknown_field,invalid_json.messagestringstringNãoEnglish explanation.
500Internal server error
internal_errorinternal_errorSomething failed on our side.
Todos os códigos de erroNomeTipoObrigatórioDescriçãoerrorErrorBodyobrigatórioErrorBodySimcodestringobrigatóriostringSimMachine code (snake_case). Branch on this, never on
message.messagestringobrigatóriostringSimEnglish explanation.
request_idstringobrigatóriostringSimSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NãoPer-field problems (
validation_failed).pathstringstringNãoJSON path of the offending field, e.g. items[3].length.
codestringstringNãorequired,invalid_value,out_of_range,duplicate_id,unknown_vehicle,unknown_template,type_not_allowed,unknown_group,does_not_fit,too_many_items,too_many_vehicles,unknown_field,invalid_json.messagestringstringNãoEnglish explanation.
503Service unavailable
api_disabledapi_disabledThe API is temporarily disabled (maintenance) or switched off for the organization.
Todos os códigos de erroNomeTipoObrigatórioDescriçãoerrorErrorBodyobrigatórioErrorBodySimcodestringobrigatóriostringSimMachine code (snake_case). Branch on this, never on
message.messagestringobrigatóriostringSimEnglish explanation.
request_idstringobrigatóriostringSimSame as the X-Request-Id header. Quote it when contacting support.
detailsErrorDetail[]ErrorDetail[]NãoPer-field problems (
validation_failed).pathstringstringNãoJSON path of the offending field, e.g. items[3].length.
codestringstringNãorequired,invalid_value,out_of_range,duplicate_id,unknown_vehicle,unknown_template,type_not_allowed,unknown_group,does_not_fit,too_many_items,too_many_vehicles,unknown_field,invalid_json.messagestringstringNãoEnglish explanation.