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

# Update partially automation by ID



## OpenAPI

````yaml /openapi/public/openapi-flow.json patch /automation/{automation_id}
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:
  /automation/{automation_id}:
    patch:
      tags:
        - Automation
      summary: Update partially automation by ID
      operationId: UpdatePartialAutomation/id
      parameters:
        - name: automation_id
          in: path
          required: true
          description: |-
            Unique identifier for automation that generated by system.
            **Example**: `62ce3918d3f3e1681a3a54b5`
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PATCHAutomationRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                title: NetworkPatchResponse
                properties:
                  status:
                    type: boolean
                    description: Status of response.
                  message:
                    description: Message of API response.
                    type: string
                  data:
                    description: Detail of object automation.
                    type: object
                    additionalProperties: true
                example:
                  status: true
                  message: Success
                  data:
                    name: Auto webhook automation
                    event: onTaskFinished
                    automationType: webhook
                    dataType: task
                    automationDetails:
                      url: https://apiweb.mile.app/webhook
                      headers:
                        x-api-key: 1234e98498ce07d29474a7ev2
                        org: global
                    rules:
                      flow: Pickup
                      flowId: 667b712f63020e5f182f0cb2
                    organizationId: 621dd813eb3ebf16b94dbde3
                    isActive: false
                    updatedTime: '2022-07-13T03:16:40+00:00'
                    createdTime: '2022-07-13T03:16:40+00:00'
                    _id: 62ce3918d3f3e1681a3a54b5
        '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.
        '404':
          description: Data not found
          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: Data not found
        '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:
  schemas:
    PATCHAutomationRequest:
      title: PATCHAutomationRequest
      example:
        name: Auto webhook automation
        event: onTaskFinished
        isActive: false
      type: object
      properties:
        name:
          type: string
          description: |-
            Automation's name.
            **Example:** `Auto webhook automation`
        event:
          type: string
          description: >-
            Act as a trigger that start an automation. There are 8 different
            types. 
             *enum: onTaskCreated, onTaskFinished, onTaskAssigned, onDataSourceCreated, onRoutingResultFinished, onRoutingResultDispatched, onStartTrip, onFinishTrip* 
             **onTaskCreated**: Automation will happen when a task is created. 
             **onTaskFinished**: Automation will happen when a task is finished (status task: Done). 
             **onTaskAssigned**: Automation will happen when a task is assigned to field user(s). 
             **onDataSourceCreated**: Automation will happen when a data source is created. 
             **onRoutingResultFinished**: Automation will happen when a routing created is created. 
             **onRoutingResultDispatched**: Automation will happen when a routing is dispatched. 
             **onStartTrip**: Automation will happen when a start trip is triggered. 
             **onFinishTrip**: Automation will happen when a finish trip is triggered. 
            **Example:** `onTaskFinished`
        isActive:
          type: boolean
          description: >-
            Automation's active state, only active automation will proceed by
            system

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

````