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

# Read task schedule



## OpenAPI

````yaml /openapi/public/openapi-task.json get /task/schedules
openapi: 3.0.0
info:
  title: MileApp API - Task
  version: 3.0.0
  description: MileApp API Documentation - RESTful API for field operations management.
servers:
  - url: https://apiweb.mile.app/api/v3
security:
  - bearerAuth: []
tags:
  - name: Task
    description: >-
      A task is an item of work intended for completion by an assignee. It can
      embody activities like pickups, deliveries, planning, inspections, sales
      visits, or other work-related actions within your organization. Tasks
      encompass essential attributes, including IDs, flow, time, status
      indicators, assignee information, order index, and other pertinent data.
      The content of a task is configurable based on your specified flow
      settings. For instance, tasks can serve as visits during the route
      optimization process, functioning as pivotal elements. The task can also
      represent a visit in route optimization, please follow [this
      link](#tag/Routing) to read more detail.


      **To see the details of task object, please follow [this
      link](#tag/task_model)**
  - name: Location History
    description: >-
      Location history is data that stores the user's location points that are
      sent periodically from the MileApp mobile application if the user
      activates the tracking feature. However, this endpoint can also be useful
      for integration into the user's IoT devices such as GPS or other mobile
      trackers. All location data sent can be visualized in MileApp in real time
      and makes it easier for users to monitor field activities more accurately.


      **Related Guide:** [Start Finish
      Feature](/configuration/start-trip-end-trip-feature)
  - name: Task Schedule
    description: >-
      Task Schedule is a mechanism to generate tasks according to the schedule
      that is set by you. The task schedule attributes consist of IDs,
      repetition period data (daily, weekly, etc.), flow structure, task
      content, and time of the schedule's start & end. This schedule could help
      you to set a task that will be repeated at a certain period.


      **To see the details of task schedule object, please follow [this
      link](#tag/task_schedule_model)**
  - name: Activity
    description: >-
      An Activity is a multi-step task group created from a Workflow template.
      When you create an Activity, MileApp automatically creates one parent task
      (with `taskType = activityMaster`) plus one child task (with `taskType =
      activityChild`) per Workflow step, and copies field values forward between
      steps according to the Workflow's field mappings. Activities are stored
      alongside regular tasks — the parent's `_id` is also the Activity ID, and
      its `subId` array lists every child task in Workflow-step order.


      After creation, retrieve, update, or delete an Activity through the
      standard Task endpoints using the Activity master task's ID.


      **To see the details of Activity object, please follow [this
      link](#tag/activity_model)**
paths:
  /task/schedules:
    get:
      tags:
        - Task Schedule
      summary: Read task schedule
      operationId: GetTaskSchedules
      parameters:
        - name: sortBy
          in: query
          required: false
          description: >-
            sortBy is used to sort the result-set in ascending or descending
            order according to selected field. The value of this param is one of
            available fields on task schedule objects.

            **Example:** `name`, `periode`, `flow`, `hubId`, etc.

            **Default:** `createdTime`
          schema:
            type: string
        - name: sortOrder
          in: query
          required: false
          description: |-
            sortOrder is to decide ascending or descending order
            **Example:** `asc` or `desc`.
            **Default:** `desc`
          schema:
            type: string
        - name: limit
          in: query
          required: false
          description: |-
            Limit of vehicles result list.
            **Example:** `10`.
            **Default:** `20`
          schema:
            type: string
        - name: page
          in: query
          required: false
          description: |-
            Pagination of vehicles result list.
            **Example:** `2`.
            **Default:** `1`
          schema:
            type: string
        - $ref: '#/components/parameters/hubIdInQuery'
        - name: name
          in: query
          required: false
          description: |-
            finding data by name task scheduler.
            **Example:** `Morning`
          schema:
            type: string
        - name: flow
          in: query
          required: false
          description: |-
            The unique name of organization's flow.
            Use [Flow /flows API](#tag/Flow) to get the list of flow names.
            **Example:** `Visit`
          schema:
            type: string
        - name: flowId
          in: query
          required: false
          description: >-
            The identifier for the flow that generated by system. Use [Flow
            /flows API](#tag/Flow/operation/getflow) to get the list of flow id.

            **Example:** `63d8c9b0dbd5ef20a627dd86`
          schema:
            type: string
        - name: status
          in: query
          required: false
          description: >-
            finding data running on SUCCESS or FAILED, acceptable
            value:SUCCESS,FAILED.

            **Example:** `SUCCESS`
          schema:
            type: string
        - name: assignee
          in: query
          required: false
          description: |-
            User email for a given task.
            **Example**: `worker@paket.id,jhon@paket.id`
          schema:
            type: string
        - name: fields
          in: query
          required: false
          description: >-
            Fields is for selecting the specific fields that you can choose by
            multiples to show in the response using a string with a comma
            delimiter.

            **Example:** `name,periode,hubId`.
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                title: NetworkReadResponse
                properties:
                  status:
                    type: boolean
                    description: Status of response.
                  message:
                    description: Message of API response.
                    type: string
                  taskSchedules:
                    description: List of object task schedule.
                    type: object
                    additionalProperties: true
                example:
                  status: true
                  message: Success
                  taskSchedules:
                    current_page: 1
                    data:
                      - hubId: 634e98498ce07d29474a7e29
                        name: Daily Morning Visit
                        periode: daily
                        flow: Visit
                        flowId: 67be687c128306111e022022
                        task:
                          receiverName: Miguel
                          address: gambir jakarta pusat
                          coordinates: ''
                          weight: '5'
                        schedules:
                          - time:
                              - '07:00'
                        startTime: '2022-11-02'
                        endTime: '2022-11-05'
                        createdBy: Pablo
                        timeSchedules:
                          - '07:00'
                        organizationId: 634e98098ce07d29474a7e22
                        updatedTime: '2022-11-01T07:28:23+00:00'
                        createdTime: '2022-11-01T07:28:23+00:00'
                        _id: 6352736c628401059b37a2e2
                      - hubId: 667b8e62b76860782a455e62
                        name: Biweekly Inspection
                        periode: custom
                        flow: Inspection
                        flowId: 67be688e128306111e022025
                        task:
                          reportContent: Biweekly Inspection
                          createdFrom: SCHEDULER
                        assignee:
                          - worker@paket.id
                        schedules:
                          - day: monday
                            time:
                              - '01:00'
                        startTime: 2024-09-01 00:00
                        endTime: 2024-12-31 23:59
                        frequency: weekly
                        interval: 2
                        createdBy: admin@paket.id
                        timeSchedules:
                          - monday 01:00
                        organizationId: 634e98098ce07d29474a7e22
                        updatedTime: '2024-08-26T00:47:42+00:00'
                        createdTime: '2024-08-26T00:47:42+00:00'
                        _id: 66cbd0aec0835f7336006992
                    first_page_url: >-
                      https://apiweb.mile.app/api/v3/task/schedules?limit=10&hubId=634fa8f119f4de35c534ad12&page=1
                    from: 1
                    last_page: 1
                    last_page_url: >-
                      https://apiweb.mile.app/api/v3/task/schedules?limit=10&hubId=634fa8f119f4de35c534ad12&page=1
                    links:
                      - url: null
                        label: '&laquo; Previous'
                        active: false
                      - url: >-
                          https://apiweb.mile.app/api/v3/task/schedules?limit=10&hubId=634fa8f119f4de35c534ad12&page=1
                        label: '1'
                        active: true
                      - url: null
                        label: Next &raquo;
                        active: false
                    next_page_url: null
                    path: https://apiweb.mile.app/api/v3/task/schedules
                    per_page: 10
                    prev_page_url: null
                    to: 5
                    total: 5
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    description: Shows if the request was successful.
                  message:
                    type: string
                    description: A short message explaining what went wrong.
                example:
                  status: false
                  message: Bad request - invalid parameters provided.
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    description: Shows if the request was successful.
                  message:
                    type: string
                    description: A short message explaining what went wrong.
                example:
                  status: false
                  message: Internal server error, please contact support@mile.app.
      deprecated: false
      security:
        - bearerAuth: []
components:
  parameters:
    hubIdInQuery:
      name: hubId
      in: query
      schema:
        type: string
      description: >-
        Fundamental entity within an organization, serving as the central point
        for managing various operational components. Use Use [**GET
        /hubs**](#tag/Hub/operation/getHubs) endpoint to get the list of Hub
        IDs.

        **Example:** `634e98498ce07d29474a7e29`
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Use a valid Bearer token to authenticate.

````