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

# Create a ResourceUsageLog for a DriverDay

> Create a `ResourceUsageLog` for a `DriverDay`.

This endpoint requires the `create_resource_usage_log` `IamPermission`.





## OpenAPI

````yaml /api-reference/openapi.json post /v1/driver_days/{driver-day-id}/resource_usage_logs
openapi: 3.0.3
info:
  title: Horizon API V1
  version: '1.0'
  contact:
    name: Tread
    url: https://tread.io
    email: developers@tread.io
  description: >-
    This is the Version 1 implementation.


    When in doubt we default to the practices outlined
    [here](https://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#advanced-queries)
  license:
    name: Private
    url: https://tread.io
servers:
  - description: production
    url: https://api.tread-horizon.com
security:
  - bearerAuth: []
tags:
  - name: Projects
  - name: Orders
  - name: Loads
  - name: Jobs
  - name: JobAssignments
  - name: ApprovalAssignments
  - name: Equipment
  - name: FuelSurcharges
  - name: Materials
  - name: Accounts
  - name: Tickets
  - name: Users
  - name: Sites
  - name: Companies
  - name: Departments
  - name: Rates
  - name: Services
  - name: EquipmentType
  - name: FileAttachments
  - name: MaterialType
  - name: LineItemType
  - name: DriverStateEvent
  - name: Authentication
  - name: IamRoles
  - name: Typeaheads
  - name: Integrations
  - name: Reflection
  - name: LoadCycles
  - name: AddOns
  - name: ServiceClass
  - name: Invoices
  - name: JobSummaries
  - name: LoadSummaries
  - name: CompanyShares
  - name: UserDevicePermission
  - name: Drivers
  - name: Settlements
  - name: LocationHistories
  - name: Telematics
  - name: OmniReports
  - name: DriverDays
  - name: Agave
  - name: AddOnCharges
  - name: ResourceUsageLogs
  - name: ResourceScopes
  - name: TravelledDistances
  - name: MaterialRates
  - name: CompanyDayJobStats
  - name: KMLFiles
  - name: AutoAddOnAssignments
  - name: SiteRateSchedules
  - name: TwilioIntegrations
  - name: Foremen
  - name: AccountExternalTruckIdentifier
  - name: GeofenceTriggers
  - name: Labels
  - name: Compliance
  - name: ComplianceDocuments
paths:
  /v1/driver_days/{driver-day-id}/resource_usage_logs:
    parameters:
      - schema:
          type: string
          format: uuid
        name: driver-day-id
        in: path
        required: true
        description: DriverDay ID
      - $ref: '#/components/parameters/Accept-Language'
    post:
      tags:
        - ResourceUsageLogs
      summary: Create a ResourceUsageLog for a DriverDay
      description: |+
        Create a `ResourceUsageLog` for a `DriverDay`.

        This endpoint requires the `create_resource_usage_log` `IamPermission`.

      operationId: post-v1-driver_days-driver-day-id-resource_usage_logs
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceUsageLog-Create'
              type: object
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/ResourceUsageLog-Read'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '415':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
components:
  parameters:
    Accept-Language:
      name: Accept-Language
      in: header
      schema:
        type: string
        default: en
        example: en
      description: >-
        The Accept-Language request HTTP header indicates the natural language
        and locale that the client prefers. 
  schemas:
    ResourceUsageLog-Create:
      title: ResourceUsageLog-Create
      x-stoplight:
        id: ctlqt56dso5sp
      type: object
      required:
        - usage_minutes
        - date_of_use
        - driver_id
      properties:
        usage_minutes:
          type: integer
          x-stoplight:
            id: pgh45oidnpymr
        date_of_use:
          type: string
          x-stoplight:
            id: p9caze6rxyn5b
          format: date
        equipment_id:
          type: string
          x-stoplight:
            id: 727hux7q1s5bn
          format: uuid
          nullable: true
        driver_id:
          type: string
          x-stoplight:
            id: jv0mr9v8rn4ht
          format: uuid
        phase_id:
          type: string
          x-stoplight:
            id: gstyyn7mj0vga
          format: uuid
          nullable: true
      additionalProperties: false
    ResourceUsageLog-Read:
      title: ResourceUsageLog-Read
      x-stoplight:
        id: 71ah7ysofkyys
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - $ref: '#/components/schemas/Timestamps'
        - type: object
          x-stoplight:
            id: 27h1eblij2y2j
          required:
            - usage_minutes
            - resource_usage_loggable_type
            - resource_usage_loggable_id
          properties:
            usage_minutes:
              type: integer
              x-stoplight:
                id: jcgxqpwj89vk2
            equipment:
              $ref: '#/components/schemas/Equipment-Read-Nested'
            driver:
              $ref: '#/components/schemas/Driver-Read-Nested'
            phase:
              $ref: '#/components/schemas/Phase-Read'
            resource_usage_loggable_type:
              type: string
              x-stoplight:
                id: g3ls2k5o246sb
            resource_usage_loggable_id:
              type: string
              x-stoplight:
                id: 3pgg849uxtyzy
              format: uuid
    Identifier:
      title: Identifier
      x-stoplight:
        id: gnd39lue5v7ol
      type: object
      required:
        - id
      properties:
        id:
          type: string
          x-stoplight:
            id: 2e38hjk4zd58m
          format: uuid
      additionalProperties: false
    Timestamps:
      title: Timestamps
      x-stoplight:
        id: t82ecgfu0oj00
      type: object
      required:
        - created_at
        - updated_at
      properties:
        created_at:
          type: string
          x-stoplight:
            id: gjj950jpq0ga9
          format: date-time
          description: ISO8601 timestamp with local timezone
        updated_at:
          type: string
          x-stoplight:
            id: bwcuyfwc7aj0e
          format: date-time
          description: ISO8601 timestamp with local timezone
      additionalProperties: false
    Equipment-Read-Nested:
      title: Equipment-Read-Nested
      x-stoplight:
        id: 7ezenec7ycv5l
      allOf:
        - $ref: '#/components/schemas/Equipment-Read-Typeahead'
        - type: object
          required:
            - license_number
            - zone
            - accounting_id
            - equipment_id
          properties:
            license_number:
              type: string
              x-stoplight:
                id: hw1ooa17wsadq
              nullable: true
            zone:
              type: string
              x-stoplight:
                id: 81hr4p8yp8btv
              nullable: true
            accounting_id:
              type: string
              x-stoplight:
                id: ere9qhs4cuwhi
              nullable: true
            equipment_id:
              type: string
              x-stoplight:
                id: gt7r3iqzx2w0u
    Driver-Read-Nested:
      title: Driver-Read-Nested
      x-stoplight:
        id: lcevfprple1sa
      allOf:
        - $ref: '#/components/schemas/Driver-Read-Typeahead'
        - type: object
          x-stoplight:
            id: 19sn21xqtmd0w
          required:
            - email
          properties:
            email:
              type: string
              x-stoplight:
                id: ekvo9chmdhjkp
              nullable: true
    Phase-Read:
      title: Phase-Read
      x-stoplight:
        id: t87rtwp61n8ry
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - name
            - code
            - primary
          properties:
            name:
              type: string
              x-stoplight:
                id: joxj6kldpdok8
            code:
              type: string
              x-stoplight:
                id: mtoxuvguckczq
              nullable: true
            primary:
              type: boolean
              x-stoplight:
                id: ww6q56py1x5wq
        - $ref: '#/components/schemas/Timestamps'
    Error-Response:
      title: Error-Response
      x-stoplight:
        id: 52cydhphee3qe
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
      additionalProperties: false
    UnauthenticatedError-Response:
      title: UnauthenticatedError-Response
      x-stoplight:
        id: o477eph7ttbzt
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/UnauthenticatedError'
      additionalProperties: false
    ModelError-Response:
      title: ModelError-Response
      x-stoplight:
        id: payf9ndh3l6np
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ModelError'
      additionalProperties: false
    Equipment-Read-Typeahead:
      title: Equipment-Read-Typeahead
      x-stoplight:
        id: sv94osohm5xhg
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - name
            - equipment_type
            - external_id
            - equipment_id
          properties:
            name:
              type: string
              description: Equipment name
            equipment_type:
              $ref: '#/components/schemas/EquipmentType-Read-Nested'
            external_id:
              type: string
              x-stoplight:
                id: jrkz95htilck3
              nullable: true
            company_share:
              $ref: '#/components/schemas/CompanyShare-Read-Nested'
            equipment_id:
              type: string
              x-stoplight:
                id: fkr9fkdtl996f
    Driver-Read-Typeahead:
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          x-stoplight:
            id: 5vacab4kzhkj4
          required:
            - first_name
            - last_name
            - schedule_on
            - phone
            - managed
            - company
          properties:
            first_name:
              type: string
              x-stoplight:
                id: 4gb9hhpizab3h
              description: First name
            last_name:
              type: string
              x-stoplight:
                id: my6q150nen1kb
              description: Last name
            company:
              $ref: '#/components/schemas/Company-Read-Nested'
            company_share:
              $ref: '#/components/schemas/CompanyShare-Read-User-Nested'
            equipment:
              $ref: '#/components/schemas/Equipment-Read-Nested'
            default_equipment:
              $ref: '#/components/schemas/Equipment-Read-Nested'
            schedule_on:
              type: boolean
              x-stoplight:
                id: 7dq6dvne8bqcr
            company_day_driver_stat:
              $ref: '#/components/schemas/CompanyDayDriverStat-Read'
            phone:
              type: string
              x-stoplight:
                id: y4l44re1zfaa9
              description: User's E.164 formatted phone number
              nullable: true
            managed:
              type: boolean
              x-stoplight:
                id: k8m3xq0sz6wt4
            labels:
              type: array
              items:
                $ref: '#/components/schemas/Label-Read-Nested'
              description: Labels assigned to this driver
        - $ref: '#/components/schemas/GpsStatusable'
      title: Driver-Read-Typeahead
    Error:
      title: Error
      x-stoplight:
        id: 3g57kkik3l464
      type: object
      description: An Error.
      required:
        - code
      properties:
        code:
          type: string
          x-stoplight:
            id: 7o9x1t8v0bgfo
      additionalProperties: false
    UnauthenticatedError:
      title: UnauthenticatedError
      x-stoplight:
        id: 202o69l0fs40h
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          x-stoplight:
            id: tg10dt7s0l6bw
          properties:
            error_type:
              type: string
              x-stoplight:
                id: wvq8c0qsym4hz
          required:
            - error_type
    ModelError:
      title: ModelError
      x-stoplight:
        id: nhp6714o4j1qt
      description: A Model-specific error
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          required:
            - errors
          properties:
            errors:
              type: array
              x-stoplight:
                id: m4ul9vcq2deh6
              items:
                $ref: '#/components/schemas/ModelError-Item'
    EquipmentType-Read-Nested:
      title: EquipmentType-Read-Nested
      x-stoplight:
        id: em46i5kysysdh
      type: object
      required:
        - id
        - name
        - system
        - external_id
        - accounting_id
      properties:
        id:
          type: string
          x-stoplight:
            id: 835oy22o6h24z
          format: uuid
        name:
          type: string
          x-stoplight:
            id: tnszefd7lypln
        system:
          type: boolean
          x-stoplight:
            id: vimoqz5e8x6gx
        external_id:
          type: string
          x-stoplight:
            id: ttaijg77qmbgk
          nullable: true
        accounting_id:
          type: string
          x-stoplight:
            id: s4rscgptv68x3
          nullable: true
      additionalProperties: false
    CompanyShare-Read-Nested:
      title: CompanyShare-Read-Nested
      x-stoplight:
        id: makajouqsb7jq
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          x-stoplight:
            id: s6h0nfzt2fjry
          required:
            - external_id
            - ticket_match_id
            - sender_company
            - dispatchable
            - schedule_on
            - rate_override
            - expires_at
          properties:
            external_id:
              type: string
              x-stoplight:
                id: c9ls3nrhbih3v
              nullable: true
            ticket_match_id:
              type: string
              x-stoplight:
                id: a1cd3nrhbih3v
              nullable: true
            sender_company:
              $ref: '#/components/schemas/Company-Read-Nested'
            dispatchable:
              type: boolean
              x-stoplight:
                id: kd884ihz6qi6w
            schedule_on:
              type: boolean
              x-stoplight:
                id: kd884ihz61234
            rate_override:
              type: boolean
              x-stoplight:
                id: mq4osazzielxo
            expires_at:
              type: string
              x-stoplight:
                id: aaa111jpq0ga9
              format: date-time
              description: ISO8601 timestamp with local timezone
              nullable: true
    Company-Read-Nested:
      title: Company-Read-Nested
      x-stoplight:
        id: cb2kn77qmf1l7
      description: Compact Company model for nested reads.
      allOf:
        - $ref: '#/components/schemas/Identifier'
          x-stoplight:
            id: jwsufva4znm91
        - $ref: '#/components/schemas/TreadId'
        - type: object
          properties:
            legal_name:
              type: string
              x-stoplight:
                id: yc10t8hieecwk
              description: The Company's name. Must be globally unique.
            company_type:
              $ref: '#/components/schemas/CompanyType'
          required:
            - legal_name
            - company_type
    CompanyShare-Read-User-Nested:
      title: CompanyShare-Read-User-Nested
      x-stoplight:
        id: 8czythac5qhgz
      allOf:
        - $ref: '#/components/schemas/CompanyShare-Read-Nested'
        - type: object
          properties:
            default_equipment:
              $ref: '#/components/schemas/Equipment-Read-Default-Nested'
    CompanyDayDriverStat-Read:
      title: CompanyDayDriverStat-Read
      x-stoplight:
        id: 3grxlvq5qo470
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - $ref: '#/components/schemas/Timestamps'
        - type: object
          x-stoplight:
            id: e0k1y5lyccj7x
          properties:
            day:
              type: string
              x-stoplight:
                id: tq2kbgspesbyq
              format: date
            jobs_count:
              type: integer
              x-stoplight:
                id: lq3o1iorx79vx
      description: CompanyDayDriverStat
    Label-Read-Nested:
      title: Label-Read-Nested
      x-stoplight:
        id: lbl1readnest01
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          properties:
            name:
              type: string
              x-stoplight:
                id: lbl1nestnm0001
              description: Label name
            color:
              type: string
              x-stoplight:
                id: lbl1nestcol001
              description: Hex color code for the label
              pattern: ^#[0-9A-Fa-f]{6}$
          required:
            - name
            - color
    GpsStatusable:
      title: GpsStatusable
      x-stoplight:
        id: o6oprcupw6ep7
      type: object
      required:
        - gps_status
      properties:
        gps_status:
          $ref: '#/components/schemas/GpsStatus'
      additionalProperties: false
    ModelError-Item:
      title: ModelError-Item
      x-stoplight:
        id: b93chwval2t8d
      type: object
      required:
        - model
        - field
        - message
      properties:
        model:
          type: string
          x-stoplight:
            id: 30myfyjkno8ao
          description: The Model associated with this Error
        field:
          type: string
          x-stoplight:
            id: 8gl4ed3uxhdws
          description: The field associated with this Error
        message:
          type: string
          x-stoplight:
            id: bmgbrtmw17qsj
          description: The Error message
      additionalProperties: false
    TreadId:
      title: TreadId
      x-stoplight:
        id: 43k4t5tl359m4
      type: object
      required:
        - tread_id
      properties:
        tread_id:
          type: string
          x-stoplight:
            id: zi3ld7djflw6f
          pattern: ^[0-9A-F]{6}$
          minLength: 6
          maxLength: 6
          example: ABC123
          description: Tread ID
      additionalProperties: false
    CompanyType:
      title: CompanyType
      x-stoplight:
        id: dkzo7gjbtb1b3
      enum:
        - broker
        - contractor
        - hauler
        - owner_operator
        - producer
        - super
      example: hauler
      description: Company Type
    Equipment-Read-Default-Nested:
      title: Equipment-Read-Default-Nested
      x-stoplight:
        id: kojte9y4g6t9v
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - name
            - external_id
            - equipment_type
            - equipment_id
          properties:
            name:
              type: string
              description: Equipment name
            external_id:
              type: string
              nullable: true
            equipment_type:
              $ref: '#/components/schemas/EquipmentType-Read-Nested'
            company_share:
              $ref: '#/components/schemas/CompanyShare-Read-Nested'
            equipment_id:
              type: string
              x-stoplight:
                id: v25n5jka8apv0
    GpsStatus:
      title: GpsStatus
      x-stoplight:
        id: 3b02180lfd6ve
      description: GPS Ping status for a record
      type: object
      required:
        - status
        - last_ping_at
      properties:
        status:
          x-stoplight:
            id: 7f6aqydupq3ac
          enum:
            - online
            - offline
            - idle
            - no_signal
        last_ping_at:
          type: string
          x-stoplight:
            id: 1ikh7blmxdqcz
          format: date-time
          nullable: true
      additionalProperties: false
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error-Response'
            type: object
    UnauthenticatedError:
      description: Example response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthenticatedError-Response'
            type: object
    ModelError:
      description: ''
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ModelError-Response'
            type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````