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

> ## Agent Instructions
> Base URL: https://api.social-api.ai/v1. Send your API key in the Authorization header: Authorization: Bearer <your API key>.
> Every error response from /v1 is JSON: { "error": { "code", "message", "meta" (optional) }, "request_id" }. Branch on error.code; use error.message only for logs.
> A 429 response carries a Retry-After header, in seconds, when the limit has a known wait.
> Paginated list endpoints return next_cursor, at the top level or inside pagination (see /guides/pagination). Pass it as the cursor query parameter to get the next page. An absent or empty next_cursor means you have the last page.
> Treat every ID as an opaque string: do not parse it or assume a format.
> Support differs by platform and by operation. Check /platforms/overview before assuming an operation works on a platform. An unsupported operation returns 501 with error.code resource.not_supported.

# Update an Automation

> Updates the fields you send and keeps the rest. Set status to paused to stop the Automation and to active to resume it. steps replaces the whole list. Changed steps or post_ids must meet the same rules as creation. Renaming or pausing needs only automations:write; resuming, or changing steps, post_ids or once_per_person, also needs each action's own scope.



## OpenAPI

````yaml /api-reference/openapi.json patch /automations/{id}
openapi: 3.0.0
info:
  description: >-
    Unified social media inbox API. Read and respond to comments, DMs, reviews,
    and mentions across Instagram, Facebook, Threads, Google Business Profile,
    TikTok, LinkedIn, and YouTube through a single REST API. X/Twitter and
    Trustpilot coming soon.
  title: SocialAPI.AI
  contact:
    name: SocialAPI.AI Support
    email: support@social-api.ai
  license:
    name: MIT
  version: '1.0'
servers:
  - url: https://api.social-api.ai/v1
security: []
paths:
  /automations/{id}:
    patch:
      tags:
        - Automations
      summary: Update an Automation
      description: >-
        Updates the fields you send and keeps the rest. Set status to paused to
        stop the Automation and to active to resume it. steps replaces the whole
        list. Changed steps or post_ids must meet the same rules as creation.
        Renaming or pausing needs only automations:write; resuming, or changing
        steps, post_ids or once_per_person, also needs each action's own scope.
      parameters:
        - example: aut_01J9Z8Y7X6W5V4T3S2R1Q0P9N8
          description: Automation ID
          name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/social-api_ai_core_api_service.UpdateAutomationParams
        description: Fields to change
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/social-api_ai_core_api_service.Automation'
        '400':
          description: >-
            Invalid definition (validation.*), or a trigger or action needs a
            permission the account does not have (validation.permission_missing)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.ErrorResponse'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.ErrorResponse'
        '403':
          description: >-
            The key's scopes do not include automations:write or the scope an
            action needs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.ErrorResponse'
        '404':
          description: Automation not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    social-api_ai_core_api_service.UpdateAutomationParams:
      type: object
      properties:
        name:
          description: 1 to 100 characters
          type: string
        once_per_person:
          type: boolean
        post_ids:
          description: >-
            Up to 100 platform post ids, each 1 to 100 characters, a comment
            must be on. An empty list means every post. Comment trigger only
          type: array
          items:
            type: string
        status:
          type: string
          enum:
            - active
            - paused
        steps:
          type: array
          items:
            $ref: '#/components/schemas/social-api_ai_core_api_service.Step'
    social-api_ai_core_api_service.Automation:
      type: object
      properties:
        account_id:
          type: string
          example: acc_01HZ9X3Q4R5M6N7P8V2K0W1J
        created_at:
          type: string
        failed_count:
          description: Actions that failed
          type: integer
        fired_count:
          description: Events the Automation ran against
          type: integer
        id:
          type: string
          example: aut_01J9Z8Y7X6W5V4T3S2R1Q0P9N8
        name:
          type: string
          example: Send the link
        once_per_person:
          description: >-
            Reach each person at most once. A run in which every action failed
            does not count
          type: boolean
        post_ids:
          description: >-
            Up to 100 platform post ids, each 1 to 100 characters, a comment
            must be on. Omitted means every post. Comment trigger only
          type: array
          items:
            type: string
        sent_count:
          description: Actions carried out successfully
          type: integer
        status:
          type: string
          enum:
            - active
            - paused
          example: active
        steps:
          description: Up to 10 Steps forming a graph. One must have the key "start"
          type: array
          items:
            $ref: '#/components/schemas/social-api_ai_core_api_service.Step'
        trigger:
          description: The kind of inbound event that fires the Automation
          type: string
          enum:
            - comment
            - dm
          example: comment
        updated_at:
          type: string
    api_endpoints.ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/api_endpoints.ErrorBody'
    social-api_ai_core_api_service.Step:
      type: object
      properties:
        actions:
          description: At most one of each type
          type: array
          items:
            $ref: '#/components/schemas/social-api_ai_core_api_service.Action'
        buttons:
          description: >-
            Up to 3, shown under the private_reply or send_dm message. With
            buttons, each of that message's texts is at most 640 characters
          type: array
          items:
            $ref: '#/components/schemas/social-api_ai_core_api_service.StepButton'
        fallthrough_step:
          description: >-
            Key of the Step to run when this Step's filters fail. Not allowed on
            start
          type: string
        filters:
          description: Up to 10. All must pass. None means every event passes
          type: array
          items:
            $ref: '#/components/schemas/social-api_ai_core_api_service.Filter'
        key:
          description: Unique within the Automation. The entry step is "start"
          type: string
          example: start
    api_endpoints.ErrorBody:
      type: object
      properties:
        code:
          type: string
          example: resource.not_found
        message:
          type: string
          example: Account not found
        meta:
          type: object
          additionalProperties: {}
    social-api_ai_core_api_service.Action:
      type: object
      properties:
        private_reply:
          description: DM to the comment's author. Free
          allOf:
            - $ref: '#/components/schemas/social-api_ai_core_api_service.TextAction'
        reply_comment:
          description: Public reply to the comment. Costs 1 credit
          allOf:
            - $ref: '#/components/schemas/social-api_ai_core_api_service.TextAction'
        send_dm:
          description: DM in the conversation. Costs 1 credit
          allOf:
            - $ref: '#/components/schemas/social-api_ai_core_api_service.TextAction'
        type:
          type: string
          enum:
            - hide_comment
            - reply_comment
            - private_reply
            - send_dm
          example: private_reply
    social-api_ai_core_api_service.StepButton:
      type: object
      properties:
        next_step:
          description: >-
            Key of the Step to run when this button is tapped. Required when
            type is postback
          type: string
          example: check
        title:
          description: Up to 20 characters
          type: string
          example: Open
        type:
          type: string
          enum:
            - url
            - postback
          example: url
        url:
          description: An http or https URL. Required when type is url
          type: string
          example: https://example.com
    social-api_ai_core_api_service.Filter:
      type: object
      properties:
        keyword:
          description: Required when type is keyword
          allOf:
            - $ref: >-
                #/components/schemas/social-api_ai_core_api_service.KeywordFilter
        type:
          description: >-
            follows_account is available on Instagram only and not on the start
            step
          type: string
          enum:
            - keyword
            - follows_account
          example: keyword
    social-api_ai_core_api_service.TextAction:
      type: object
      properties:
        texts:
          description: >-
            1 to 10 variants, each 1 to 1000 characters, or at most 640 for a
            private_reply or send_dm whose step has buttons; one is picked at
            random each time
          type: array
          items:
            type: string
          example:
            - 'Here is the link: https://example.com'
    social-api_ai_core_api_service.KeywordFilter:
      type: object
      properties:
        keywords:
          description: 1 to 50, each 1 to 100 characters
          type: array
          items:
            type: string
          example:
            - link
            - price
        match:
          description: >-
            contains: a keyword appears as a whole word or phrase. exact: the
            whole text equals a keyword
          type: string
          enum:
            - contains
            - exact
          example: contains
  securitySchemes:
    BearerAuth:
      description: >-
        Prefix your API key with "Bearer ". Example: `Authorization: Bearer
        sapi_key_...`
      type: apiKey
      name: Authorization
      in: header

````

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