Saltar para o conteúdo
CargoDuo logoCargoDuo
Preços
Entrar

Por enquanto, esta documentação está disponível só em inglês.

Authentication

API keys, scopes and IP allowlists.

Send an API key as a bearer token on every /v1 request.

Bash
curl https://runner.cargoduo.com/v1/balance \
  -H "Authorization: Bearer $CARGODUO_API_KEY"

API keys

KeyDetail
Formatcd_live_ + 40 characters
Created byThe organization owner, in the developer console
ShownOnce, at creation. Only a hash is stored
Per organizationUp to 20 active keys
OptionalExpiry date, IP allowlist (IPs or CIDR ranges)
RotateNew secret, same settings. The old one stops at once

Keep keys on your server. Never ship one in a browser or mobile app.

Scopes

ScopeEndpoints
pack:writePOST /v1/pack, POST /v1/estimate, DELETE /v1/jobs/{id}, POST /v1/projects/{id}/pack
jobs:readGET /v1/jobs, GET /v1/jobs/{id}, GET /v1/jobs/{id}/result
account:readGET /v1/limits, GET /v1/balance, GET /v1/usage
resources:readGET /v1/projects, GET /v1/projects/{id}, GET /v1/vehicles, GET /v1/vehicles/{id}, GET /v1/templates, GET /v1/templates/{id}
resources:writePOST /v1/projects, PATCH /v1/projects/{id}, DELETE /v1/projects/{id}, POST /v1/projects/{id}/pack, POST /v1/vehicles, PATCH /v1/vehicles/{id}, DELETE /v1/vehicles/{id}, POST /v1/templates, PATCH /v1/templates/{id}, DELETE /v1/templates/{id}

New keys get every scope. POST /v1/projects/{id}/pack needs both pack:write and resources:write.

Errors

StatusCodeMeaning
401unauthorizedMissing, malformed or unknown API key.
401key_revokedThe key was revoked.
401key_expiredThe key passed its expiry date.
403ip_not_allowedThe calling IP is not on the key's allowlist.
403subscription_inactiveThe organization has no active subscription that includes the API.
403account_inactiveThe organization is suspended, or has no owner whose account is active.
403scope_missingThe key lacks a scope this endpoint needs.
429rate_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.