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



## OpenAPI

````yaml /openapi/public/openapi-flow.json get /automations
openapi: 3.0.0
info:
  title: MileApp API - Flow
  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: Flow
    description: >-
      Flow in MileApp is the mobile field application workflow, setting it
      correctly is critical to the success of the field workers in doing their
      job efficiently. Flow attributes consist of IDs, pages, components,
      configurations, and time. The Flow will be used at Task, Automation, or
      Schedule.


      **To see the details of flow object, please follow [this
      link](#tag/flow_model)**
  - name: Automation
    description: >-
      Automation enables you to set up automation based on tasks' events and
      data source's events. It might help you automate creation of tasks, task
      assignment, task placement, task webhook, data source update, datasource
      creation, and data source webhook. Automation attributes consist of IDs,
      automation name, automation type, automation details, and rules.


      **To see the details of automation object, please follow [this
      link](#tag/automation_model)**
paths:
  /automations:
    get:
      tags:
        - Automation
      summary: Read automation
      operationId: automation
      parameters:
        - $ref: '#/components/parameters/pageInQuery'
        - $ref: '#/components/parameters/limitInQuery'
        - name: q
          in: query
          required: false
          description: >-
            Query param search. This field will search automation according to
            similar value of name, automation type or flow

            **Example:** `Automation Tigaraksa, createTask, Delivery`
          schema:
            type: string
        - 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 automation objects.

            **Example:** `name`, `flow`, `automationType`, `createdTime`, 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: 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,automationType,flow`.
          schema:
            type: string
        - name: event
          in: query
          required: false
          description: |-
            Act as a trigger that start an automation.
            **Example:** `onTaskCreated`
          schema:
            type: string
        - name: automationType
          in: query
          required: false
          description: |-
            Automation's type. The action of automation.
            **Example:** `webhook`.
          schema:
            type: string
        - name: dataType
          in: query
          required: false
          description: |-
            Automation's data type.
            **Example:** `task`.
          schema:
            type: string
        - name: flow
          in: query
          required: false
          description: >-
            FlowName to select specific task for event to happens. Use [GET
            /flows API](#tag/Flow) to get the list of Flow.

            **Example:** `Pickup`
          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
                  data:
                    description: List of object automation.
                    type: object
                    additionalProperties: true
                example:
                  status: true
                  message: Success
                  data:
                    current_page: 1
                    data:
                      - name: Auto webhook automation
                        event: onTaskFinished
                        automationType: webhook
                        dataType: task
                        automationDetails:
                          url: https://apiweb.mile.app/webhook
                          headers:
                            x-api-key: 1234e98498ce07d29474a7ev2
                            org: general
                        rules:
                          flow: Pickup
                          flowId: 667b712f63020e5f182f0cb2
                        organizationId: 621dd813eb3ebf16b94dbde3
                        isActive: true
                        updatedTime: '2022-07-13T03:16:40+00:00'
                        createdTime: '2022-07-13T03:16:40+00:00'
                        _id: 62ce3918d3f3e1681a3a54b5
                    first_page_url: >-
                      http://apiweb.mile.app/api/v3/automations?q=automation%201&page=1
                    from: 1
                    last_page: 1
                    last_page_url: >-
                      http://apiweb.mile.app/api/v3/automations?q=automation%201&page=1
                    links:
                      - url: null
                        label: '&laquo; Previous'
                        active: false
                      - url: >-
                          http://apiweb.mile.app/api/v3/automations?q=automation%201&page=1
                        label: '1'
                        active: true
                      - url: null
                        label: Next &raquo;
                        active: false
                    next_page_url: null
                    path: http://apiweb.mile.app/api/v3/automations
                    per_page: 10
                    prev_page_url: null
                    to: 1
                    total: 1
        '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:
    pageInQuery:
      name: page
      in: query
      schema:
        default: 1
        type: integer
      description: The page number of results to retrieve. **Example:** `2`
    limitInQuery:
      name: limit
      in: query
      schema:
        default: 20
        minimum: 1
        maximum: 1000
        type: integer
      description: >-
        Specifies the maximum number of items to retrieve in a single request.
        **Example:** `10`
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Use a valid Bearer token to authenticate.

````