> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.datatruck.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create trailer

> Creates a new trailer with the provided details, including make, model, year, unit number, VIN, and optional fields such as plate number, state, status, and driver assignments.



## OpenAPI

````yaml POST /trailers/create/
openapi: 3.0.1
info:
  title: OpenAPI Datatruck
  description: >-
    To be able to use Datatruck OpenAPI you should create tokens from your
    dashboard. Go to your dashboard and create token with appropriate scopes and
    expiration. Expiration and scopes are optional as well as description for
    your token, but remember name is required.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://{company}.datatruck.io/api/v1/openapi/
security: []
paths:
  /trailers/create/:
    post:
      summary: Create Trailer
      description: >-
        Creates a new trailer with the provided details, including make, model,
        year, unit number, VIN, and optional fields such as plate number, state,
        status, and driver assignments.
      operationId: createTrailer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTrailerRequest'
      responses:
        '201':
          description: Trailer successfully created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: success
        '400':
          description: Invalid request data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateTrailerRequest:
      type: object
      properties:
        make:
          type: string
          description: Manufacturer of the trailer.
        model:
          type: string
          description: Model of the trailer.
        year:
          type: integer
          description: Manufacturing year of the trailer.
        unit_number:
          type: string
          description: Unit number of the trailer.
        vin:
          type: string
          description: Vehicle Identification Number (VIN) of the trailer.
        plate_number:
          type: string
          nullable: true
          description: Plate number of the trailer, if available.
        state:
          type: string
          nullable: true
          description: State where the trailer is registered, if available.
        status:
          type: string
          description: Current status of the trailer, if applicable.
        ownership:
          type: string
          nullable: true
          description: Ownership details of the trailer, if provided.
        company_mc:
          type: integer
          nullable: true
          description: Company motor carrier number, if applicable.
        notes:
          type: string
          nullable: true
          description: Additional notes about the trailer, if provided.
        driver_operator:
          type: integer
          nullable: true
          description: ID of the primary driver operator assigned to the trailer, if any.
        co_driver_operator:
          type: integer
          nullable: true
          description: ID of the co-driver operator assigned to the trailer, if any.
        reg_expiry_date:
          type: string
          format: date
          nullable: true
          description: Registration expiry date of the trailer, if provided.
        last_annual_inspection_date:
          type: string
          format: date
          nullable: true
          description: Date of the last annual inspection, if provided.
        owner:
          type: integer
          nullable: true
          description: ID of the owner of the trailer, if applicable.
      required:
        - make
        - model
        - year
        - unit_number
        - vin
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string

````