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

# Cancel automation

> Cancel an existing recurring investment or savings automation.



## OpenAPI

````yaml POST /automations/{id}/cancel
openapi: 3.0.3
info:
  title: Wealthyhood Automations API
  version: 1.0.0
  description: >
    Recurring investment automation endpoints for Wealthyhood portfolios.


    All requests use machine-to-machine (M2M) authentication. Each request
    requires:

    - A bearer access token (M2M token with required scopes)

    - An `x-user-id` header to specify which user's data to access


    **Note:** Only `TopUpAutomation` (recurring investments) and
    `SavingsTopUpAutomation` (recurring savings top-ups) are currently supported
    in the API.
servers:
  - url: https://{host}
    variables:
      host:
        default: api.wealthyhood.com
        description: Wealthyhood API host name.
security:
  - bearerAuth: []
tags:
  - name: Automations
    description: Manage recurring investment automations for users.
paths:
  /automations/{id}/cancel:
    post:
      tags:
        - Automations
      summary: Cancel an automation
      description: >
        Cancel an existing recurring investment automation. This will stop
        future recurring

        investments from being executed. Any pending deposits that have not yet
        been submitted

        to the payment provider will also be cancelled.


        **Note:** The associated mandate is not cancelled and can be reused for
        future automations.
      parameters:
        - $ref: '#/components/parameters/XUserId'
        - $ref: '#/components/parameters/AutomationId'
      responses:
        '202':
          description: Automation cancellation accepted
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
components:
  parameters:
    XUserId:
      name: x-user-id
      in: header
      required: true
      description: >-
        User identifier for the M2M client to specify which user's data to
        access.
      schema:
        type: string
        pattern: ^[a-f0-9]{24}$
    AutomationId:
      name: id
      in: path
      required: true
      description: Automation ID
      schema:
        type: string
        pattern: ^[a-f0-9]{24}$
  responses:
    BadRequestError:
      description: Validation failure or business rule violation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          examples:
            invalidAmount:
              summary: Invalid order amount
              value:
                status: 400
                error:
                  message: You need to invest at least €10.00.
                  description: Operation failed
                responseId: 7c91c5fe-d5a8-4b82-8e3f-5af2e30e43c2
            invalidDayOfMonth:
              summary: Invalid day of month
              value:
                status: 400
                error:
                  message: >-
                    Day of month should be between 1 and 28 or set to -1 but
                    instead is 0
                  description: Operation failed
                responseId: 8d92c6gf-e6b9-5c93-9f4g-6bg3f41f54d3
    UnauthorizedError:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            status: 401
            error:
              message: User not found
            responseId: 145f2b0d-1d5b-4e91-8d0d-7af0ae9ad13a
    ForbiddenError:
      description: Authenticated user cannot act on the requested resource or lacks scopes.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            status: 403
            error:
              message: You do not have access to this bank account
            responseId: 5e467f79-c62c-4d83-9810-7a0f8529fd76
    NotFoundError:
      description: Automation, bank account, or related resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            status: 404
            error:
              message: Automation not found
            responseId: 65c0b1f6-2a48-4c4f-a5aa-9b9c8c6f9b58
  schemas:
    ApiErrorResponse:
      type: object
      properties:
        status:
          type: integer
        error:
          type: object
          properties:
            message:
              type: string
            description:
              type: string
              nullable: true
        responseId:
          type: string
          format: uuid
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Auth0-issued access token that includes the scopes listed for the
        endpoint.

````