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

# Update automation

> Partially update an automation. `is_enabled` toggles new fires; already-claimed runs still finish. When `trigger` is sent, the schedule or status row is replaced. When `actions` is sent, the full action list is replaced. An automation that emails candidates or client contacts from a mailbox can only be edited by its creator; other admins can still turn it off or archive it. Only organization admins (or an API key) can create, change, turn off or archive automations during the Beta.



## OpenAPI

````yaml /api-reference/openapi-v1.json patch /v1/automations/{id}
openapi: 3.1.0
info:
  title: Stardex API (v1)
  version: 1.0.0
  description: >-
    Stardex ATS API — manage candidates, jobs, companies, and recruiting
    workflows.
servers:
  - url: https://api.stardex.ai
    description: Production API server
security:
  - bearerAuth: []
tags:
  - name: Persons
    description: Manage person records — contacts, work history, and custom fields.
  - name: Jobs
    description: Manage job postings — pipeline stages, team members, and custom fields.
  - name: Candidates
    description: Manage candidate records and pipeline stage transitions.
  - name: Companies
    description: Browse and retrieve company records.
  - name: Lists
    description: Create, search, and retrieve saved person and company lists.
  - name: Person Activities
    description: Create and manage activity records (notes, emails, meetings) for persons.
  - name: Team Members
    description: List team members for use in search filters and assignments.
  - name: Custom Fields
    description: Retrieve custom field definitions and tag options for search filters.
paths:
  /v1/automations/{id}:
    patch:
      tags:
        - Automations
      summary: Update automation
      description: >-
        Partially update an automation. `is_enabled` toggles new fires;
        already-claimed runs still finish. When `trigger` is sent, the schedule
        or status row is replaced. When `actions` is sent, the full action list
        is replaced. An automation that emails candidates or client contacts
        from a mailbox can only be edited by its creator; other admins can still
        turn it off or archive it. Only organization admins (or an API key) can
        create, change, turn off or archive automations during the Beta.
      operationId: updateAutomation
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
            description: Automation ID
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutomationUpdateRequest'
      responses:
        '200':
          description: Automation updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationUpdateResponse'
              example:
                success: true
                data:
                  id: aaa11111-bbbb-cccc-dddd-eeeeeeee2222
                  name: Email owner when a candidate is rejected
                  is_enabled: true
                  is_archived: false
                  runs_on_api_changes: false
                  created_by: 567e8901-e23c-45d6-e789-012345678901
                  trigger:
                    type: candidate_status_changed
                    pipeline_stage_ids:
                      - 123e4567-e89b-12d3-a456-426614174000
                    match_rejection_stages: true
                  actions:
                    - id: aaa11111-bbbb-cccc-dddd-eeeeeeee2223
                      position: 1
                      action_type: send_email
                      recipient_type: candidate
                      team_member_id: null
                      payload:
                        subject: Your application for {{job_name}}
                        body: |-
                          Hi {{candidate_first_name}},

                          Thank you for your time on the {{job_name}} search.

                          Best,
                          {{search_owner}}
                        sender:
                          kind: mailbox
                          nylas_grant_id: 8b3f4e5d-6c7a-4182-9c9d-0e1f2a3b4c5d
                        include_signature: true
                    - id: aaa11111-bbbb-cccc-dddd-eeeeeeee2228
                      position: 2
                      action_type: send_email
                      recipient_type: team_members
                      team_member_id: null
                      payload:
                        subject: '{{candidate_name}} was rejected on {{job_name}}'
                        body: >-
                          {{candidate_name}} moved to {{stage_name}} on
                          {{job_name}}.
                        team_member_ids:
                          - 567e8901-e23c-45d6-e789-012345678901
                        email_addresses:
                          - finance@yourfirm.com
                    - id: aaa11111-bbbb-cccc-dddd-eeeeeeee2226
                      position: 3
                      action_type: delay
                      payload:
                        amount: 2
                        unit: days
                    - id: aaa11111-bbbb-cccc-dddd-eeeeeeee2224
                      position: 4
                      action_type: add_note
                      team_member_id: 567e8901-e23c-45d6-e789-012345678901
                      payload:
                        content: >-
                          Rejected by automation — review before closing the
                          loop.
                    - id: aaa11111-bbbb-cccc-dddd-eeeeeeee2225
                      position: 5
                      action_type: agent_instructions
                      payload:
                        instructions: Summarize why this candidate was rejected.
                    - id: aaa11111-bbbb-cccc-dddd-eeeeeeee2227
                      position: 6
                      action_type: create_task
                      assignee_type: job_owner
                      team_member_id: null
                      payload:
                        content: Call {{candidate_name}} with feedback on {{job_name}}
                        task_type: call
                        due_in_days: 1
                  created_at: '2026-08-21T10:00:00Z'
                  updated_at: '2026-08-21T10:00:00Z'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '403':
          description: >-
            Only the creator can edit an automation that sends from their
            mailbox, or the caller is not an admin
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
components:
  schemas:
    AutomationUpdateRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          description: Display name.
        is_enabled:
          type: boolean
          description: Enable or disable new fires. In-flight runs still finish.
        is_archived:
          type: boolean
          description: Archive or restore the automation.
        runs_on_api_changes:
          type: boolean
          description: >-
            When true, changes made through the API or MCP (including Zapier)
            also start this automation. Off by default, because one API call can
            change hundreds of records and each change starts a run.
        trigger:
          $ref: '#/components/schemas/AutomationTrigger'
        actions:
          type: array
          items:
            $ref: '#/components/schemas/AutomationAction'
          minItems: 1
          description: >-
            Replace the full action list. Omit to leave existing actions
            unchanged.
    AutomationUpdateResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          $ref: '#/components/schemas/Automation'
      required:
        - success
        - data
    AutomationTrigger:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - schedule
              description: Fire on a recurring calendar schedule.
            rrule:
              type: string
              pattern: ^FREQ=
              description: >-
                RRULE body. FREQ=DAILY, or FREQ=WEEKLY with BYDAY. Optional
                INTERVAL, BYHOUR, BYMINUTE, UNTIL. BYHOUR and BYMINUTE take a
                single value, so a schedule runs once on each day it runs.
                MONTHLY and YEARLY are not supported.
              example: FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0
            dtstart:
              type: string
              description: >-
                ISO 8601 series origin used with timezone when expanding the
                RRULE.
            timezone:
              type: string
              minLength: 1
              description: IANA timezone used to expand the RRULE (e.g. Europe/Madrid).
            next_run_at:
              type: string
              description: >-
                Next scheduled fire. Computed by the server from rrule, dtstart,
                and timezone. Ignored on write.
          required:
            - type
            - rrule
            - dtstart
            - timezone
        - type: object
          properties:
            type:
              type: string
              enum:
                - candidate_status_changed
              description: Fire when a candidate lands on a pipeline stage.
            pipeline_stage_ids:
              type: array
              items:
                type: string
                format: uuid
              maxItems: 50
              description: >-
                Pipeline stage UUIDs to match. The automation fires when a
                candidate moves to any of them. Leave empty, with
                match_rejection_stages off, to fire on every stage change. Get
                IDs from GET /v1/jobs/pipeline-stages.
            match_rejection_stages:
              type: boolean
              description: >-
                Also fire when a candidate moves to any rejection stage,
                including rejection stages added later. Defaults to false.
          required:
            - type
        - type: object
          properties:
            type:
              type: string
              enum:
                - job_status_changed
              description: Fire when a job lands on a status.
            job_status_id:
              type:
                - string
                - 'null'
              format: uuid
              description: >-
                Job status UUID to match. Null or omitted means any job status
                change. Get IDs from GET /v1/jobs/statuses.
          required:
            - type
        - type: object
          properties:
            type:
              type: string
              enum:
                - job_created
              description: >-
                Fire when a new active job is created. Archived jobs, deleted
                jobs, and onboarding sample data are skipped.
            organization_company_id:
              type:
                - string
                - 'null'
              format: uuid
              description: >-
                Client (company) UUID to match. Null or omitted means a job for
                any client. Get IDs from POST /v1/companies/search.
          required:
            - type
        - type: object
          properties:
            type:
              type: string
              enum:
                - deal_status_changed
              description: >-
                Fire when a deal moves to a status. Creating a deal does not
                fire it.
            deal_status_id:
              type:
                - string
                - 'null'
              format: uuid
              description: >-
                Deal status UUID to match. Null or omitted means any deal status
                change. Get IDs from GET /v1/deals/statuses.
          required:
            - type
    AutomationAction:
      oneOf:
        - type: object
          properties:
            id:
              type: string
              format: uuid
              description: >-
                Action UUID. Assigned on create; ignored when replacing the
                action list.
            position:
              type: integer
              minimum: 1
              description: 1-based order. Assigned from array order on write.
            action_type:
              type: string
              enum:
                - send_email
            recipient_type:
              type: string
              enum:
                - candidate
                - team_member
                - team_members
                - job_owner
                - client_contacts
              description: >-
                Who receives the email. team_members emails every teammate in
                payload.team_member_ids and every address in
                payload.email_addresses (at least one between them); team_member
                is the older single-teammate form. candidate needs a candidate
                trigger. job_owner emails every owner of the job and needs a
                candidate or job trigger. client_contacts emails every client
                contact of the job, or of the deal on a deal trigger. candidate
                and client_contacts are sent from payload.sender's mailbox and
                skip anyone unsubscribed, marked do not contact or with a
                bounced address; a candidate is only emailed at a personal
                address and is skipped if they only have a work email; the same
                automation does not email the same address about the same
                candidate and search (or deal) twice within 24 hours;
                team_members, team_member and job_owner get the email from
                Stardex, with replies going to the automation's owner.
            team_member_id:
              type:
                - string
                - 'null'
              format: uuid
              description: >-
                Required when recipient_type is team_member. Get IDs from GET
                /v1/team-members.
            payload:
              type: object
              properties:
                subject:
                  type: string
                  minLength: 1
                  description: >-
                    Email subject line. Supports the same {{variables}} as the
                    body.
                body:
                  type: string
                  minLength: 1
                  description: >-
                    Plain text email body. Blank lines start a new paragraph.
                    Supports {{candidate_name}}, {{candidate_first_name}},
                    {{job_name}}, {{stage_name}}, {{job_status_name}},
                    {{client_name}}, {{deal_name}}, {{deal_status_name}} and
                    {{search_owner}} where the trigger provides them.
                sender:
                  oneOf:
                    - type: object
                      properties:
                        kind:
                          type: string
                          enum:
                            - mailbox
                        nylas_grant_id:
                          type: string
                          format: uuid
                          description: >-
                            A connected mailbox the automation's owner owns or
                            has shared access to.
                      required:
                        - kind
                        - nylas_grant_id
                    - type: object
                      properties:
                        kind:
                          type: string
                          enum:
                            - job_owner
                          description: >-
                            Send from the job owner's mailbox. The automation's
                            owner must have access to it when the email is sent.
                      required:
                        - kind
                  description: >-
                    Which mailbox sends the email. Required when recipient_type
                    is candidate or client_contacts. Emails to team members come
                    from Stardex instead.
                team_member_ids:
                  type: array
                  items:
                    type: string
                    format: uuid
                  maxItems: 50
                  description: >-
                    Teammates who receive the email when recipient_type is
                    team_members. Get IDs from GET /v1/team-members.
                email_addresses:
                  type: array
                  items:
                    type: string
                    format: email
                  maxItems: 50
                  description: >-
                    Other addresses that receive the email when recipient_type
                    is team_members, for example finance@yourfirm.com. They get
                    it from Stardex, like teammates do.
                include_signature:
                  type: boolean
                  description: >-
                    Add the sending mailbox's signature to the end of the email.
                    Only applies to candidate and client_contacts emails, which
                    are sent from a mailbox. Defaults to false.
              required:
                - subject
                - body
          required:
            - action_type
            - recipient_type
            - payload
        - type: object
          properties:
            id:
              type: string
              format: uuid
              description: >-
                Action UUID. Assigned on create; ignored when replacing the
                action list.
            position:
              type: integer
              minimum: 1
              description: 1-based order. Assigned from array order on write.
            action_type:
              type: string
              enum:
                - add_note
            team_member_id:
              type: string
              format: uuid
              description: >-
                Team member recorded as the note author. Get IDs from GET
                /v1/team-members.
            payload:
              type: object
              properties:
                content:
                  type: string
                  minLength: 1
                  description: >-
                    Note text added to the candidate. Supports
                    {{candidate_name}}, {{job_name}}, {{stage_name}}, and
                    {{client_name}}.
              required:
                - content
          required:
            - action_type
            - team_member_id
            - payload
        - type: object
          properties:
            id:
              type: string
              format: uuid
              description: >-
                Action UUID. Assigned on create; ignored when replacing the
                action list.
            position:
              type: integer
              minimum: 1
              description: 1-based order. Assigned from array order on write.
            action_type:
              type: string
              enum:
                - agent_instructions
            payload:
              type: object
              properties:
                instructions:
                  type: string
                  minLength: 1
                  description: >-
                    Natural-language instructions for the agent. The agent is
                    not executed yet; this is stored only.
              required:
                - instructions
          required:
            - action_type
            - payload
        - type: object
          properties:
            id:
              type: string
              format: uuid
              description: >-
                Action UUID. Assigned on create; ignored when replacing the
                action list.
            position:
              type: integer
              minimum: 1
              description: 1-based order. Assigned from array order on write.
            action_type:
              type: string
              enum:
                - delay
              description: >-
                Pause the run, then continue with the next action. Cannot be the
                last action.
            payload:
              type: object
              properties:
                amount:
                  type: integer
                  minimum: 1
                  description: >-
                    How many units to wait before the next action. Whole number,
                    at least 1.
                  example: 2
                unit:
                  type: string
                  enum:
                    - minutes
                    - hours
                    - days
                  description: Unit for amount. A day is a fixed 24 hours.
                  example: days
              required:
                - amount
                - unit
          required:
            - action_type
            - payload
        - type: object
          properties:
            id:
              type: string
              format: uuid
              description: >-
                Action UUID. Assigned on create; ignored when replacing the
                action list.
            position:
              type: integer
              minimum: 1
              description: 1-based order. Assigned from array order on write.
            action_type:
              type: string
              enum:
                - create_task
              description: >-
                Create a task. It links to the candidate, job and deal from the
                trigger when there are any.
            assignee_type:
              type: string
              enum:
                - team_member
                - job_owner
                - deal_owner
              description: >-
                Who the task is assigned to. job_owner assigns every owner of
                the job the run is about and is valid on candidate and job
                triggers. deal_owner assigns every owner of the deal and is
                valid on deal triggers.
            team_member_id:
              type:
                - string
                - 'null'
              format: uuid
              description: >-
                Required when assignee_type is team_member. Get IDs from GET
                /v1/team-members.
            payload:
              type: object
              properties:
                content:
                  type: string
                  minLength: 1
                  description: >-
                    Task text. Supports {{candidate_name}}, {{job_name}},
                    {{stage_name}}, {{job_status_name}} and {{client_name}}
                    where the trigger provides them.
                task_type:
                  type: string
                  enum:
                    - text
                    - linkedin_message
                    - linkedin_connection
                    - call
                    - other
                  description: Task type, the same values as tasks elsewhere in Stardex.
                due_in_days:
                  anyOf:
                    - type: number
                      enum:
                        - 0
                    - type: number
                      enum:
                        - 1
                    - type: number
                      enum:
                        - 3
                    - type: number
                      enum:
                        - 7
                  description: >-
                    Days after the step runs that the task is due. 0 means the
                    same day.
                  example: 1
              required:
                - content
                - task_type
                - due_in_days
          required:
            - action_type
            - assignee_type
            - payload
    Automation:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Automation UUID.
        name:
          type: string
          description: Display name.
        is_enabled:
          type: boolean
          description: Whether new fires are enqueued.
        is_archived:
          type: boolean
          description: Whether the automation is archived.
        runs_on_api_changes:
          type: boolean
          description: >-
            When true, changes made through the API or MCP (including Zapier)
            also start this automation. Off by default, because one API call can
            change hundreds of records and each change starts a run.
        created_by:
          type:
            - string
            - 'null'
          format: uuid
          description: Team member who created the automation.
        trigger:
          $ref: '#/components/schemas/AutomationTrigger'
        actions:
          type: array
          items:
            $ref: '#/components/schemas/AutomationAction'
          description: Ordered actions. At least one is required on create.
        created_at:
          type: string
          description: ISO 8601 creation timestamp.
        updated_at:
          type: string
          description: ISO 8601 last-updated timestamp.
      required:
        - id
        - name
        - is_enabled
        - is_archived
        - runs_on_api_changes
        - created_by
        - trigger
        - actions
        - created_at
        - updated_at
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Authenticate with a Bearer token: API key, OAuth token, or session
        token.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.