Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/plantasur-dev/ship-quote/llms.txt

Use this file to discover all available pages before exploring further.

Calling this endpoint is the recommended way to temporarily remove a carrier from rate comparisons without discarding its configuration, rate tables, zones, or pallet types. The agency’s active field is toggled on every call — if the agency is currently active it becomes inactive, and vice versa.
This endpoint does not accept a request body. The active field is always set to the opposite of its current value (!agency.active). Read the current state from GET /api/v1/agencies before patching if you need to ensure a deterministic outcome.
Deactivating an agency excludes it from all POST /api/v1/rates/* comparison results immediately. Its zone definitions, static rate tables, and pallet type records remain intact in the database and are restored to the engine as soon as the agency is reactivated.

Endpoint

PATCH /api/v1/agencies/:agencyId

Path Parameters

agencyId
string
required
The MongoDB ObjectId of the agency to toggle. Returns 404 if no agency with this ID exists, and 404 (CastError) if the value is not a valid ObjectId format.

Response

A successful request returns HTTP 200 OK with the full updated agency document.
id
string
MongoDB ObjectId of the agency.
name
string
Title-cased agency name.
code
string
Normalised slug identifier.
type
string
Agency type: "static", "api", or "hybrid".
active
boolean
The new activation state after the toggle.
rules
object
Capability and routing rules (unchanged by this endpoint).
supplements
object
Pricing supplements (unchanged by this endpoint).
apiConfig
object
Carrier API configuration (present for "api" and "hybrid" agencies; unchanged by this endpoint).
createdAt
string
ISO 8601 creation timestamp (unchanged).
updatedAt
string
ISO 8601 timestamp updated to reflect this change.

Examples

Toggle an agency’s status

The example below toggles the Dachser agency. If it was active it becomes inactive (excluded from rate comparisons); if it was inactive it becomes active again. No request body is required.
curl -X PATCH http://localhost:3000/api/v1/agencies/507f1f77bcf86cd799439011

Error Responses

404 Not Found
object
Returned when no agency with the supplied agencyId exists in the database, or when the supplied value is not a valid MongoDB ObjectId (CastError).
{
  "message": "Agency not found"
}

Build docs developers (and LLMs) love