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

# Cancel Scheduled Emails

> Cancel every pending email with one cancellationKey

Guide: [Schedule one email yourself](https://docs.minimo.it/embedded/schedule-email.md). Errors: [Errors and limits](https://docs.minimo.it/embedded/errors.md).


## OpenAPI

````yaml delete /public/v1/transactionals/scheduled
openapi: 3.1.0
info:
  title: API Documentation
  description: Documentation for transactional and subscribe APIs
  version: 1.0.0
servers:
  - url: https://app.minimo.it
security:
  - bearerAuth: []
paths:
  /public/v1/transactionals/scheduled:
    servers:
      - url: https://api.minimo.it
    delete:
      summary: Cancel scheduled emails
      description: >-
        Cancels every pending email with this `cancellationKey`. Without
        `tenant`, only emails scheduled without a tenant. Sent emails are not
        touched. Send no body and no `Content-Type` header.
      operationId: cancelScheduledEmails
      parameters:
        - name: cancellationKey
          in: query
          required: true
          description: The key used when scheduling.
          schema:
            type: string
        - name: tenant
          in: query
          required: false
          description: The restaurant of the emails.
          schema:
            type: string
      responses:
        '200':
          description: How many were cancelled
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      cancelled:
                        type: integer
                        example: 1
              example:
                data:
                  cancelled: 1
        '401':
          description: >-
            `INVALID_TOKEN`: missing or wrong key, or a key without the
            **Transactional** permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
        - bearerAuth: []
      x-codeSamples:
        - label: cURL
          lang: bash
          source: |-
            curl --request DELETE \
              --url 'https://api.minimo.it/public/v1/transactionals/scheduled?cancellationKey=booking-4812&tenant=restaurant_4812' \
              --header 'Authorization: Bearer YOUR_MINIMO_KEY'
        - lang: JavaScript
          source: >-
            const res = await
            fetch('https://api.minimo.it/public/v1/transactionals/scheduled?cancellationKey=booking-4812&tenant=restaurant_4812',
            {
              method: 'DELETE',
              headers: {
                Authorization: 'Bearer YOUR_MINIMO_KEY',
              },
            });

            console.log(res.status);
        - lang: Python
          source: |-
            import requests

            res = requests.delete(
                'https://api.minimo.it/public/v1/transactionals/scheduled?cancellationKey=booking-4812&tenant=restaurant_4812',
                headers={'Authorization': 'Bearer YOUR_MINIMO_KEY'},
            )
            print(res.status_code, res.text)
components:
  schemas:
    ApiError:
      type: object
      properties:
        status:
          type: string
          example: FAIL
        message:
          type: string
          description: The error code to test in your code.
          example: INVALID_PARAMETERS
        userMessage:
          type: string
          description: >-
            When present, a sentence that says what to fix. You can show or log
            it.
          example: Set the origins allowed to embed the widgets first.
      description: >-
        Every error has this shape. See [Errors and limits](/embedded/errors)
        for every code.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: mn-API_CLIENT_ID-API_KEY

````

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