GROperator

Auth

Every operation of the LastMile Public API, generated from the OpenAPI document. The reference text is in English in both languages.

POST

/api/public/v1/auth/login

#

Sign in with username and password

No credentials needed

Returns a bearer token pair. Failed attempts count toward the same lockout and per-network/device throttling as the dashboard sign-in (HTTP 401 auth.invalid_credentials, then 429 auth.login_temporarily_blocked). The company must have the public API enabled, otherwise 403 channel_disabled and no token is issued. Rate limit policy: 30 requests per minute per IP.

Request body · PublicLoginRequestapplication/json

The credentials.

FieldTypeDescription
usernamestringnullable

Username or e-mail address.

passwordstringnullable

Password.

The OpenAPI document does not mark required fields formally, so “required” is read from each field’s description. The guides list the required fields of every request.

Request example

POST /auth/login
curl -X POST "https://api.goldrock.live/api/public/v1/auth/login" \
  -H "Content-Type: application/json" \
  -d '{
  "username": "ahmed@your-company.example",
  "password": "YOUR_PASSWORD"
}'

Samples use an API key; replace the placeholders. To use a bearer token instead, send Authorization: Bearer <accessToken>.

Responses

200Signed in.

Responses · Field
FieldTypeDescription
accessTokenstringnullable

JWT to send as Authorization: Bearer ....

refreshTokenstringnullable

Single-use refresh token.

tokenTypestringnullable

Always Bearer.

expiresIninteger (int32)

Lifetime of the access token in seconds.

200 · Example response
{
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refreshToken": "q3kZ0m8w...",
  "tokenType": "Bearer",
  "expiresIn": 900
}
StatusDescription
400

The request is invalid (code validation_failed, details.errors lists every field).

401

Wrong username or password.

403

Public API disabled for the company, company suspended, or account inactive.

422

A business rule or a location could not be satisfied (codes such as geo_city_not_found, shipment.cannot_cancel).

429

Too many attempts.

Error responses share one body, described in the error reference. Error reference

GET

/api/public/v1/auth/me

#

Describe the current caller: company, user or API key, scopes and permissions

API key + secret, or bearer tokenAny valid credential

Requires authentication (bearer token, or X-API-Key with X-API-Secret). No scope is needed.

Request example

GET /auth/me
curl "https://api.goldrock.live/api/public/v1/auth/me" \
  -H "X-API-Key: lmc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "X-API-Secret: YOUR_API_SECRET"

Samples use an API key; replace the placeholders. To use a bearer token instead, send Authorization: Bearer <accessToken>.

Responses

200The caller.

Responses · Field
FieldTypeDescription
authMethodstringnullable

password or api_key.

companyPublicCompanyDto

Company identity shown by the public auth/me endpoint.

id
company.id
string (uuid)

Company id.

name
company.name
stringnullable

Company name.

slug
company.slug
stringnullable

Company slug.

userPublicUserDto

The user behind a password-authenticated call.

id
user.id
string (uuid)

User id.

name
user.name
stringnullable

Full name.

apiKeyPublicApiKeyDto

The API key behind a key-authenticated call.

id
apiKey.id
string (uuid)

API key id.

name
apiKey.name
stringnullable

Label given to the key.

scopesarray<string>nullable

API scopes granted (for password callers: the scopes the user's permissions cover).

permissionsarray<string>nullable

Permission codes held by the caller.

200 · Example response
{
  "authMethod": "api_key",
  "company": {
    "id": "0f8fad5b-d9cb-469f-a165-70867728950e",
    "name": "Fast Express",
    "slug": "fast-express"
  },
  "user": null,
  "apiKey": {
    "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "name": "Website integration"
  },
  "scopes": [
    "geography:read",
    "pricing:read",
    "shipments:read",
    "shipments:write"
  ],
  "permissions": [
    "orders:create",
    "orders:read"
  ]
}
StatusDescription
401

Not authenticated.

403

Public API disabled for the company.

429

Too many requests (code rate_limited); wait for the Retry-After header.

Error responses share one body, described in the error reference. Error reference

POST

/api/public/v1/auth/refresh

#

Exchange a refresh token for a new token pair

No credentials needed

The refresh token is single use: store the new one returned here. Rate limit: 10 requests per minute per IP.

Request body · PublicRefreshRequestapplication/json

The refresh token.

FieldTypeDescription
refreshTokenstringnullable

The refresh token returned by login or by a previous refresh (single use).

The OpenAPI document does not mark required fields formally, so “required” is read from each field’s description. The guides list the required fields of every request.

Request example

POST /auth/refresh
curl -X POST "https://api.goldrock.live/api/public/v1/auth/refresh" \
  -H "Content-Type: application/json" \
  -d '{
  "refreshToken": "YOUR_REFRESH_TOKEN"
}'

Samples use an API key; replace the placeholders. To use a bearer token instead, send Authorization: Bearer <accessToken>.

Responses

200New token pair.

Responses · Field
FieldTypeDescription
accessTokenstringnullable

JWT to send as Authorization: Bearer ....

refreshTokenstringnullable

Single-use refresh token.

tokenTypestringnullable

Always Bearer.

expiresIninteger (int32)

Lifetime of the access token in seconds.

200 · Example response
{
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refreshToken": "q3kZ0m8w...",
  "tokenType": "Bearer",
  "expiresIn": 900
}
StatusDescription
400

The request is invalid (code validation_failed, details.errors lists every field).

401

The refresh token is invalid or expired.

403

Public API disabled for the company.

422

A business rule or a location could not be satisfied (codes such as geo_city_not_found, shipment.cannot_cancel).

429

Too many requests (code rate_limited); wait for the Retry-After header.

Error responses share one body, described in the error reference. Error reference