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

# Save mileage setup

> Save (or update) the mileage setup for the authenticated user



## OpenAPI

````yaml https://dev.tight.com/v3/api-docs post /v6/mileage/setup
openapi: 3.0.1
info:
  title: Tight API
  contact:
    name: Hurdlr, Inc. (dba Tight)
    url: https://www.tight.com
    email: api@tight.com
  version: 6.0.0
servers:
  - url: https://sandbox.tight.com
    description: Staging Environment
  - url: https://prod.tight.com
    description: Production Environment
security:
  - EmbedToken: []
paths:
  /v6/mileage/setup:
    post:
      tags:
        - Mileage Setup
      summary: Save mileage setup
      description: Save (or update) the mileage setup for the authenticated user
      operationId: postMileageSetup
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MileageSetupPostDto'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponseMileageSetupGetDto'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                result: FAILURE
                error:
                  - type: REQUIRED
                    message: Amount is required
                    param: amount
        '401':
          description: Not authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                result: FAILURE
                error:
                  - type: INVALID_TOKEN
                    message: Invalid access token
        '403':
          description: Not authorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                result: FAILURE
                error:
                  - type: FORBIDDEN
                    message: Expired access token
        '404':
          description: Endpoint not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                result: FAILURE
                error:
                  - type: BAD_REQUEST
                    message: Resource not found
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                result: FAILURE
                error:
                  - type: UNKNOWN_ERROR
                    message: Something went wrong. Please try again later.
      security:
        - EmbedToken: []
components:
  schemas:
    MileageSetupPostDto:
      type: object
      properties:
        workHours:
          $ref: '#/components/schemas/WorkHoursPostDto'
        setupComplete:
          type: boolean
          description: Whether the mileage setup has been completed
          nullable: false
          example: false
    SuccessResponseMileageSetupGetDto:
      type: object
      properties:
        result:
          type: string
          description: The result of the action performed.
          enum:
            - SUCCESS
            - FAILURE
        data:
          $ref: '#/components/schemas/MileageSetupGetDto'
    ErrorResponse:
      type: object
      properties:
        result:
          type: string
          description: The result of the action performed.
          enum:
            - SUCCESS
            - FAILURE
        data:
          type: object
          description: The data generated by the action performed.
          nullable: true
        error:
          type: array
          items:
            $ref: '#/components/schemas/ErrorItem'
    WorkHoursPostDto:
      type: object
      properties:
        enabled:
          type: boolean
          description: Whether work hours filtering is enabled
          example: true
        monday:
          type: array
          description: Work hour blocks for Monday
          items:
            $ref: '#/components/schemas/TimeBlockPostDto'
        tuesday:
          type: array
          description: Work hour blocks for Tuesday
          items:
            $ref: '#/components/schemas/TimeBlockPostDto'
        wednesday:
          type: array
          description: Work hour blocks for Wednesday
          items:
            $ref: '#/components/schemas/TimeBlockPostDto'
        thursday:
          type: array
          description: Work hour blocks for Thursday
          items:
            $ref: '#/components/schemas/TimeBlockPostDto'
        friday:
          type: array
          description: Work hour blocks for Friday
          items:
            $ref: '#/components/schemas/TimeBlockPostDto'
        saturday:
          type: array
          description: Work hour blocks for Saturday
          items:
            $ref: '#/components/schemas/TimeBlockPostDto'
        sunday:
          type: array
          description: Work hour blocks for Sunday
          items:
            $ref: '#/components/schemas/TimeBlockPostDto'
      description: Work hours configuration for automatic mileage trip classification
      nullable: false
    MileageSetupGetDto:
      required:
        - setupComplete
        - workHours
      type: object
      properties:
        workHours:
          $ref: '#/components/schemas/WorkHoursGetDto'
        setupComplete:
          type: boolean
          description: Whether the mileage setup has been completed
          example: false
      description: The data generated by the action performed.
    ErrorItem:
      type: object
      properties:
        type:
          type: string
          description: The type of the error. Safe for programmatic use.
          enum:
            - UNKNOWN_ERROR
            - INVALID_TOKEN
            - EXPIRED_TOKEN
            - FORBIDDEN
            - BAD_REQUEST
            - JSON_ERROR
            - DUPLICATE
            - REQUIRED
            - INVALID_VALUE
            - NOT_MODIFIABLE
            - INVALID_FORMAT
            - NOT_FOUND
        message:
          type: string
          description: >-
            A human-readable message providing more details about the error.
            Safe for displaying to a user.
        param:
          type: string
          description: >-
            If the error is parameter-specific, the parameter related to the
            error. This can be used to display a message near the correct form
            field.
      description: Errors associated with the action performed, if applicable.
    TimeBlockPostDto:
      type: object
      properties:
        startTime:
          type: string
          description: Start time of the work block
          example: '09:00:00'
        endTime:
          type: string
          description: End time of the work block
          example: '17:00:00'
      description: Work hour blocks for Sunday
    WorkHoursGetDto:
      required:
        - enabled
        - friday
        - monday
        - saturday
        - sunday
        - thursday
        - tuesday
        - wednesday
      type: object
      properties:
        enabled:
          type: boolean
          description: Whether work hours filtering is enabled
          example: true
        monday:
          type: array
          description: Work hour blocks for Monday
          items:
            $ref: '#/components/schemas/TimeBlockGetDto'
        tuesday:
          type: array
          description: Work hour blocks for Tuesday
          items:
            $ref: '#/components/schemas/TimeBlockGetDto'
        wednesday:
          type: array
          description: Work hour blocks for Wednesday
          items:
            $ref: '#/components/schemas/TimeBlockGetDto'
        thursday:
          type: array
          description: Work hour blocks for Thursday
          items:
            $ref: '#/components/schemas/TimeBlockGetDto'
        friday:
          type: array
          description: Work hour blocks for Friday
          items:
            $ref: '#/components/schemas/TimeBlockGetDto'
        saturday:
          type: array
          description: Work hour blocks for Saturday
          items:
            $ref: '#/components/schemas/TimeBlockGetDto'
        sunday:
          type: array
          description: Work hour blocks for Sunday
          items:
            $ref: '#/components/schemas/TimeBlockGetDto'
      description: Work hours configuration for automatic mileage trip classification
    TimeBlockGetDto:
      required:
        - endTime
        - startTime
      type: object
      properties:
        startTime:
          type: string
          description: Start time of the work block
          example: '09:00:00'
        endTime:
          type: string
          description: End time of the work block
          example: '17:00:00'
      description: Work hour blocks for Sunday
  securitySchemes:
    EmbedToken:
      type: http
      description: >-
        Bearer authentication header of the form `Bearer <token>`, see
        [Authentication for more
        detail](/api-reference/authentication#partner-level-authentication).
      scheme: bearer

````