> ## 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.

# Send Instagram message

> Send a direct message to one or more recipients on Instagram. Write the text directly or use a template.



## OpenAPI

````yaml /en/instagram-api/api-reference/openapi-instagram.json post /v1/instagram/messages
openapi: 3.0.3
info:
  title: Notifique API — Instagram
  version: 1.0.0
  description: >-
    Send Instagram DMs and manage connections. Authenticate with `Authorization:
    Bearer sk_live_...` or `x-api-key`.
servers:
  - url: https://api.notifique.dev
    description: Production
security:
  - ntfIgBearerAuth: []
  - ntfIgApiKeyHeader: []
tags:
  - name: 'Instagram: instances'
    description: Criar, listar, desconectar e remover conexões Instagram.
  - name: 'Instagram: messages'
    description: Enviar, listar, editar, cancelar, apagar e inbound.
  - name: 'Instagram: comments'
    description: Listr, responder e moderar comentários.
paths:
  /v1/instagram/messages:
    post:
      tags:
        - 'Instagram: mensagens'
      summary: Send Instagram message
      description: >-
        Send a direct message to one or more recipients on Instagram. Write the
        text directly or use a template.
      operationId: ntfIg_sendMessage
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
          description: Evita duplicar envio em retry.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NtfIg_SendMessageBody'
            examples:
              text:
                summary: Text
                value:
                  instanceId: inst_abc
                  to:
                    - username_ou_igsid
                  type: TEXT
                  payload:
                    message: Olá!
              image:
                summary: Image
                value:
                  instanceId: inst_abc
                  to:
                    - username_ou_igsid
                  type: IMAGE
                  payload:
                    mediaUrl: https://example.com/image.jpg
                    caption: Legenda opcional
              video:
                summary: Video
                value:
                  instanceId: inst_abc
                  to:
                    - username_ou_igsid
                  type: VIDEO
                  payload:
                    mediaUrl: https://example.com/video.mp4
                    caption: Legenda opcional
              audio:
                summary: Audio
                value:
                  instanceId: inst_abc
                  to:
                    - username_ou_igsid
                  type: AUDIO
                  payload:
                    mediaUrl: https://example.com/audio.mp3
              document:
                summary: Document
                value:
                  instanceId: inst_abc
                  to:
                    - username_ou_igsid
                  type: DOCUMENT
                  payload:
                    mediaUrl: https://example.com/file.pdf
                    fileName: file.pdf
      responses:
        '202':
          description: Enfileirada ou agendada.
          content:
            application/json:
              example:
                success: true
                data:
                  messageIds:
                    - msg_abc
                  status: QUEUED
                  count: 1
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      messageIds:
                        type: array
                        items:
                          type: string
                        example:
                          - msg_abc
                      status:
                        type: string
                        example: QUEUED
                      count:
                        type: integer
                        example: 1
        '400':
          description: Validação do body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfIg_ErrorResponse'
              example:
                success: false
                error: Bad Request
                message: Validation failed
                details:
                  - path: payload.message
                    message: Required
        '402':
          description: Créditos insuficientes ou plano bloqueado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfIg_ErrorResponse'
              example:
                success: false
                error: Payment Required
                code: INSUFFICIENT_CREDITS
                message: Insufficient credits
        '403':
          description: Sem escopo ou instance não permitida.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfIg_ErrorResponse'
        '429':
          description: >-
            Fila do workspace no limite ou limite de warm-up
            (INSTAGRAM_WARMUP_DAILY_LIMIT: 15 DMs/dia nos primeiros 5 dias após
            firstConnectedAt).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfIg_ErrorResponse'
              examples:
                warmup:
                  summary: Warm-up
                  value:
                    success: false
                    error: Too Many Requests
                    code: INSTAGRAM_WARMUP_DAILY_LIMIT
                    message: 'Warm-up daily limit is 15 DMs. Sent today: 15.'
                    data:
                      active: true
                      dailyLimit: 15
                      sentToday: 15
                      daysRemaining: 4
                queue:
                  summary: Fila
                  value:
                    success: false
                    error: Too Many Requests
                    message: Workspace queue limit reached
components:
  schemas:
    NtfIg_SendMessageBody:
      type: object
      required:
        - instanceId
        - to
        - type
        - payload
      properties:
        instanceId:
          type: string
          example: inst_abc
        to:
          type: array
          minItems: 1
          maxItems: 50
          items:
            type: string
          example:
            - usuario_alvo
          description: Username (com ou sem @) ou ID numérico.
        type:
          type: string
          enum:
            - text
            - image
            - video
            - audio
            - document
        payload:
          type: object
          description: >-
            Para text: message. Para mídia: mediaUrl, mimetype, fileName e
            caption optional.
          additionalProperties: true
        priority:
          type: string
          enum:
            - high
            - normal
            - low
        sendAt:
          type: string
          format: date-time
          description: Agendamento optional (ISO 8601).
        maxRetries:
          type: integer
          minimum: 0
          maximum: 5
        metadata:
          type: object
          additionalProperties: true
    NtfIg_ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
        message:
          type: string
        code:
          type: string
        details:
          type: object
          additionalProperties: true
        data:
          type: object
          additionalProperties: true
        retryAfterSec:
          type: integer
          description: >-
            Segundos até poder tentar de novo (presente em 429 de cooldown/abuse
            pause).
  securitySchemes:
    ntfIgBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Authorization: Bearer sk_live_...'
    ntfIgApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````