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

# Add Route

> Add a new route.



## OpenAPI

````yaml /spec/oas.yaml post /routes
openapi: 3.0.3
info:
  title: CRO Software API
  version: 2.x
  description: >-
    REST API for the CRO Software waste management and logistics platform.
    Authenticate via OAuth2 (client_credentials or authorization_code). All
    requests require a Bearer token and an X-Tenant-Id header.
servers:
  - url: https://api.crosoftware.com/v0
    description: Production
security: []
paths:
  /routes:
    post:
      tags:
        - Routes
      summary: Add Route
      description: Add a new route.
      operationId: routes_add_route
      parameters:
        - name: x-api-version
          in: header
          required: false
          schema:
            type: string
            description: Version identifier (date format).
        - name: x-tenant-id
          in: header
          required: true
          schema:
            type: integer
            format: int64
            description: >-
              Tenant identifier. Contact [CRO
              Software](https://crosoftwaresolutions.com/) for more info if you
              don't already have this id. See [list tenant
              ids](/docs/requests/tenants_list_tenants) for info on listing the
              tenants you have access to.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRouteRequestBodyModel'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouteModel'
      security:
        - oauth2:
            - api
components:
  schemas:
    CreateRouteRequestBodyModel:
      type: object
      description: Create new route request body model.
      properties:
        auto_decline:
          type: boolean
          description: Auto decline.
        days_interval:
          type: integer
          description: Days interval.
        end_at_lat:
          type: string
          description: Latitude.
        end_at_lng:
          type: string
          description: Longitude.
        end_time:
          type: string
          format: date-time
          description: Scheduled job completion date.
        friday_on:
          type: boolean
          description: Friday on.
        interface_color:
          type: string
          description: Interface color.
        last_dispatched:
          type: string
          format: date-time
          description: Last time this route had a job dispatched.
        location_id:
          type: integer
          format: int64
          description: Location identifier.
        monday_on:
          type: boolean
          description: Monday on.
        name:
          type: string
          description: Route name.
        recure_date:
          type: string
          format: date-time
          description: Recure date.
        route_zone_id:
          type: integer
          description: Route zone id
        saturday_on:
          type: boolean
          description: Saturday on.
        start_at_lat:
          type: string
          description: Latitude.
        start_at_lng:
          type: string
          description: Longitude.
        start_time:
          type: string
          format: date-time
          description: Scheduled job completion date.
        sunday_on:
          type: boolean
          description: Sunday on.
        thursday_on:
          type: boolean
          description: Thursday on.
        truck_id:
          type: integer
          format: int64
          description: Truck identifier.
        tuesday_on:
          type: boolean
          description: Tuesday on.
        visualize_round_trip:
          type: boolean
          description: Visualize round trip.
        wednesday_on:
          type: boolean
          description: Wednesday on.
        will_rollover:
          type: boolean
          description: Will rollover.
      required:
        - location_id
        - name
        - truck_id
    RouteModel:
      type: object
      description: Route model.
      properties:
        auto_decline:
          type: boolean
          description: Auto decline.
        days_interval:
          type: integer
          description: Days interval.
        end_at_lat:
          type: string
          description: Latitude.
        end_at_lng:
          type: string
          description: Longitude.
        end_time:
          type: string
          format: date-time
          description: Scheduled job completion date.
        friday_on:
          type: boolean
          description: Friday on.
        id:
          type: integer
          format: int64
          description: Trailer record identifier.
        interface_color:
          type: string
          description: Interface color.
        last_dispatched:
          type: string
          format: date-time
          description: Last time this route had a job dispatched.
        location_id:
          type: integer
          format: int64
          description: Location identifier.
        monday_on:
          type: boolean
          description: Monday on.
        name:
          type: string
          description: Route name.
        recure_date:
          type: string
          format: date-time
          description: Recure date.
        route_zone_id:
          type: integer
          description: Route zone id
        saturday_on:
          type: boolean
          description: Saturday on.
        start_at_lat:
          type: string
          description: Latitude.
        start_at_lng:
          type: string
          description: Longitude.
        start_time:
          type: string
          format: date-time
          description: Scheduled job completion date.
        sunday_on:
          type: boolean
          description: Sunday on.
        thursday_on:
          type: boolean
          description: Thursday on.
        truck_id:
          type: integer
          format: int64
          description: Truck identifier.
        tuesday_on:
          type: boolean
          description: Tuesday on.
        visualize_round_trip:
          type: boolean
          description: Visualize round trip.
        wednesday_on:
          type: boolean
          description: Wednesday on.
        will_rollover:
          type: boolean
          description: Will rollover.
      required:
        - auto_decline
        - days_interval
        - end_at_lat
        - end_at_lng
        - end_time
        - friday_on
        - id
        - interface_color
        - last_dispatched
        - location_id
        - monday_on
        - name
        - recure_date
        - route_zone_id
        - saturday_on
        - start_at_lat
        - start_at_lng
        - start_time
        - sunday_on
        - thursday_on
        - truck_id
        - tuesday_on
        - visualize_round_trip
        - wednesday_on
        - will_rollover
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: REPLACE_WITH_AUTH_BASE_URL/oauth2/token
          scopes:
            api: General API access
            webhook: Webhook management
        authorizationCode:
          authorizationUrl: REPLACE_WITH_AUTH_BASE_URL/oauth2/auth
          tokenUrl: REPLACE_WITH_AUTH_BASE_URL/oauth2/token
          scopes:
            api: General API access
            webhook: Webhook management

````