> ## 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.

# Bulk download FileAttachments

> This endpoint starts a bulk download of `FileAttachments`. 

The `job_ids` and `filter[jobs]` params are mutually exclusive and at least one of these is required.

On success the caller should subscribe to the `BulkDownloadResult` `RTU` using the `id` in the response.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/bulk_downloads
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/bulk_downloads:
    parameters:
      - $ref: '#/components/parameters/Accept-Language'
    post:
      tags:
        - FileAttachments
      summary: Bulk download FileAttachments
      description: >-
        This endpoint starts a bulk download of `FileAttachments`. 


        The `job_ids` and `filter[jobs]` params are mutually exclusive and at
        least one of these is required.


        On success the caller should subscribe to the `BulkDownloadResult` `RTU`
        using the `id` in the response.
      operationId: post-v1-bulk_downloads
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkDownload-Create'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/BulkDownload-Read'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '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:
    BulkDownload-Create:
      title: BulkDownload-Create
      x-stoplight:
        id: dginlau2z9kwc
      type: object
      required:
        - type
      properties:
        type:
          x-stoplight:
            id: bkfphr54z8e8u
          enum:
            - pdf
            - zip
        job_ids:
          type: array
          x-stoplight:
            id: 10qpu61ctkte7
          items:
            x-stoplight:
              id: dr8frggqtjuit
            type: string
            format: uuid
        filter:
          type: object
          x-stoplight:
            id: bfq6p121blguj
          properties:
            job:
              type: object
              x-stoplight:
                id: 2mvncci7daqfc
              properties:
                states:
                  type: array
                  x-stoplight:
                    id: qqookotjggzde
                  items:
                    $ref: '#/components/schemas/JobState'
                customer_account_ids:
                  type: array
                  x-stoplight:
                    id: wz8zonskz97iy
                  items:
                    x-stoplight:
                      id: x89yk8ot1xtln
                    type: string
                    format: uuid
                driver_ids:
                  type: array
                  x-stoplight:
                    id: inn9jbnu2xetg
                  items:
                    x-stoplight:
                      id: yo67fubgekey2
                    type: string
                    format: uuid
                dropoff_site_ids:
                  type: array
                  x-stoplight:
                    id: jeq43zqrp9lsx
                  items:
                    x-stoplight:
                      id: avvutvbuvurmx
                    type: string
                    format: uuid
                foreman_ids:
                  type: array
                  x-stoplight:
                    id: 1tnty976sj2n5
                  items:
                    x-stoplight:
                      id: fi63f0hbe8alo
                    type: string
                    format: uuid
                'pickup_site_ids:':
                  type: array
                  x-stoplight:
                    id: n9i5cpr7yu64i
                  items:
                    x-stoplight:
                      id: bo329ui51q3hw
                    type: string
                    format: uuid
                vendor_account_ids:
                  type: array
                  x-stoplight:
                    id: 3m6911ke43vf6
                  items:
                    x-stoplight:
                      id: lqu1a9jlq64le
                    type: string
                    format: uuid
                start_date:
                  type: string
                  x-stoplight:
                    id: iitb5tfvp03um
                  format: date
                end_date:
                  type: string
                  x-stoplight:
                    id: m6yl2h77ai8lf
                  format: date
            categories:
              type: array
              x-stoplight:
                id: vrg5vswusdl9n
              items:
                $ref: '#/components/schemas/FileAttachmentCategory'
      additionalProperties: false
    BulkDownload-Read:
      title: BulkDownload-Read
      x-stoplight:
        id: 00dtsuvxgipoi
      allOf:
        - $ref: '#/components/schemas/Identifier'
    JobState:
      title: JobState
      x-stoplight:
        id: qyb8p2t7h0pnn
      enum:
        - created
        - assigned
        - accepted
        - rejected
        - to_pickup
        - arrived_pickup
        - loaded
        - to_dropoff
        - arrived_dropoff
        - unloaded
        - completed
        - canceled
        - ended
        - sent
        - in_review
        - flagged
        - signed_off
        - paid
        - load_completed
      example: created
      default: created
      readOnly: true
    FileAttachmentCategory:
      title: FileAttachmentCategory
      x-stoplight:
        id: baiohh0t8x4x2
      enum:
        - Inspection Report
        - Site Map
        - Scale Ticket (External)
        - Scale Ticket (Internal)
        - Timesheet
        - Other
      default: Other
    Identifier:
      title: Identifier
      x-stoplight:
        id: gnd39lue5v7ol
      type: object
      required:
        - id
      properties:
        id:
          type: string
          x-stoplight:
            id: 2e38hjk4zd58m
          format: uuid
      additionalProperties: false
    UnauthenticatedError-Response:
      title: UnauthenticatedError-Response
      x-stoplight:
        id: o477eph7ttbzt
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/UnauthenticatedError'
      additionalProperties: false
    Error-Response:
      title: Error-Response
      x-stoplight:
        id: 52cydhphee3qe
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
      additionalProperties: false
    ModelError-Response:
      title: ModelError-Response
      x-stoplight:
        id: payf9ndh3l6np
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ModelError'
      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
    Error:
      title: Error
      x-stoplight:
        id: 3g57kkik3l464
      type: object
      description: An Error.
      required:
        - code
      properties:
        code:
          type: string
          x-stoplight:
            id: 7o9x1t8v0bgfo
      additionalProperties: false
    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'
    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
  responses:
    UnauthenticatedError:
      description: Example response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthenticatedError-Response'
            type: object
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error-Response'
            type: object
    ModelError:
      description: ''
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ModelError-Response'
            type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````