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

# Cancelar SMS agendado

> Cancela um SMS que ainda não saiu — estava na fila ou agendado para depois.



## OpenAPI

````yaml /sms-api/api-reference/openapi-sms.json post /v1/sms/messages/{id}/cancel
openapi: 3.0.3
info:
  title: Notifique API. SMS
  description: >-
    Envie SMS, acompanhe a entrega e veja mensagens recebidas. Use
    `Authorization: Bearer sk_live_...` ou `x-api-key` para autenticar.
  version: 1.0.0
servers:
  - url: https://api.notifique.dev
    description: Produção
security:
  - ntfSmsBearerAuth: []
  - ntfSmsApiKeyHeader: []
tags:
  - name: SMS
    description: Enviar SMS, consultar status e ver mensagens recebidas.
paths:
  /v1/sms/messages/{id}/cancel:
    post:
      tags:
        - SMS
      summary: Cancelar SMS agendado
      description: >-
        Cancela um SMS que ainda não saiu — estava na fila ou agendado para
        depois.
      operationId: ntfSms_postV1SmsCancel
      parameters:
        - name: id
          in: path
          required: true
          description: ID (cuid) do SMS agendado retornado em POST /v1/sms/messages.
          schema:
            type: string
      responses:
        '200':
          description: SMS cancelado com sucesso.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfSms_CancelSmsResponse'
              example:
                success: true
                data:
                  smsId: clxx123...
                  status: CANCELLED
        '400':
          description: >-
            SMS não está QUEUED nem SCHEDULED (apenas esses status podem ser
            cancelados).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfSms_ErrorResponse'
              example:
                success: false
                error: Bad Request
                message: Only queued or scheduled SMS can be cancelled.
                data:
                  status: QUEUED
                code: BAD_REQUEST
        '401':
          description: API Key ausente ou inválida.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfSms_ErrorResponse'
        '403':
          description: Escopo sms:cancel ausente.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfSms_ErrorResponse'
        '404':
          description: SMS não encontrado ou não pertence ao workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfSms_ErrorResponse'
              example:
                success: false
                error: Not Found
                message: SMS not found
                code: NOT_FOUND
components:
  schemas:
    NtfSms_CancelSmsResponse:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          required:
            - smsId
            - status
          properties:
            smsId:
              type: string
              description: ID (cuid) do SMS cancelado.
            status:
              type: string
              enum:
                - CANCELLED
    NtfSms_ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          description: 'Rótulo HTTP do erro (ex.: Unauthorized, Bad Request, Not Found).'
        message:
          type: string
          description: >-
            Mensagem legível para exibir ao usuário (localizada via
            Accept-Language / x-locale quando aplicável).
        code:
          type: string
          description: >-
            Código estável da API v1 (enum). Sempre presente em erros. Use com o
            status HTTP para decidir retry ou correção. Ver [Respostas de
            erro](/guides/conceitos/resposta-de-erros).
        details:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              message:
                type: string
          description: Lista de erros de validação por campo.
      required:
        - success
        - error
        - message
        - code
  securitySchemes:
    ntfSmsBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API Key no header Authorization. Exemplo: `Authorization: Bearer
        sk_live_xxxxx`
    ntfSmsApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: 'API Key no header x-api-key. Exemplo: `x-api-key: sk_live_xxxxx`'

````