Skip to main content
POST
/
api
/
trailers
Create a trailer
curl --request POST \
  --url https://clarus-api.com/api/trailers \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Clarus-Subdomain: <api-key>' \
  --data '
{
  "data": {
    "type": "trailers",
    "attributes": {
      "code": "TRL-001",
      "name": "Curtainsider 13.6m",
      "trailer_type_id": 7,
      "active": true,
      "description": "Standard 45ft curtainsider"
    }
  }
}
'
{
  "id": 1,
  "code": "TRL-001",
  "name": "Curtainsider 13.6m",
  "active": true,
  "trailer_type_id": 7
}

Request Structure

{
  "data": {
    "type": "trailers",
    "attributes": {
      "code": "TRL-001",
      "name": "Curtainsider 13.6m",
      "trailer_type_id": 7,
      "active": true
    }
  }
}

Key Fields

FieldRequiredDescription
codeYesUnique trailer code (max 50)
nameYesTrailer name (max 50)
trailer_type_idYesTrailer type
activeYesActive flag

Authorizations

Authorization
string
header
required

OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.

X-Clarus-Subdomain
string
header
required

The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.

Body

application/json
data
object
required

Response

Created successfully

The response is of type object.