Skip to navigation

Quickstart

Sign in and make your first authenticated request against the Cargovision API.
View as Markdown

This guide signs in with an email account and lists the containers visible to that account. It uses curl, but any HTTP client works.

EnvironmentBase URL
Productionhttps://api.cargovision.app
Local developmenthttp://localhost:8080

Every endpoint lives under the /v1 prefix, for example https://api.cargovision.app/v1/containers. The health probes /health and /ready are the only unversioned routes.

1

Get an account

Accounts are invite-only. Ask a Cargovision administrator for an invite, accept it, and set a password. Google sign-in is also available through the web dashboard.

2

Sign in

Send your credentials to the login endpoint and keep the returned session cookie.

curl -sS -c cookies.txt \
-H "Content-Type: application/json" \
-d '{"email":"operator@example.com","password":"your-password"}' \
https://api.cargovision.app/v1/user/auth/email/login

A successful login returns 200 with your email and role, and sets an HttpOnly token cookie that holds your JWT:

{
"status": "success",
"message": "Login Success",
"data": { "email": "operator@example.com", "role": "operator" }
}
3

List your containers

Send the cookie back on the next request:

curl -sS -b cookies.txt \
"https://api.cargovision.app/v1/containers?page=1&limit=20"

The response uses the standard { success, data } envelope:

{
"success": true,
"data": {
"containers": [
{ "containerNumber": "MSCU1234566", "status": "ANALYZED", "aiDecision": { "status": "CLEARED" } }
],
"pagination": { "page": 1, "limit": 20, "total": 1, "pages": 1 }
}
}
4

Use a bearer token in scripts

Server-side scripts can send the same JWT as a bearer token instead of a cookie. Read the token value from cookies.txt and pass it in the Authorization header:

TOKEN=$(awk '$6 == "token" { print $7 }' cookies.txt)
curl -sS -H "Authorization: Bearer $TOKEN" \
https://api.cargovision.app/v1/containers/stats

Bearer requests skip the browser-origin check that applies to cookie-authenticated writes. See Authentication.

Next steps