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

# 发送图像



## OpenAPI

````yaml /zh/openapi.yml post /send/image
openapi: 3.0.0
info:
  title: WhatsApp API 多设备
  version: 9.7.0
  description: |
    此 API 用于通过 API 发送什么应用。

    Web 仪表板是一个单独的项目(gowa-ui)； 服务器下载它的
    最新版本资产并在 `/` 处服务(或在
    APP_UI_ENABLED=false时返回一个 JSON 横幅)。

    设备范围：
    - 在所有设备范围的REST 调用上发送 `X-Device-Id` 。
    - WebSocket: 连接到"/w?device_id=<id>`.
    - WebSocket 身份验证（启用基本身份验证时）：浏览器无法为
      WebSocket 连接设置 Authorization 请求头，因此还需在
      查询字符串中传入 `&authorization=<base64(user:pass)>`。 在
      生产中使用TLS ，因为凭据在 URL 中可见。
servers:
  - url: http://localhost:3000
security:
  - basicAuth: []
tags:
  - name: app
    description: 初始连接到 Whatsapp 服务器
  - name: device
    description: 多设备支持的设备管理
  - name: user
    description: 获取信息
  - name: send
    description: 发送消息 (Text/Image/File/Video)。
  - name: message
    description: 消息操作 (撤销/react/update)。
  - name: call
    description: 通话管理 (拒绝来电)
  - name: chat
    description: 聊天对话和消息
  - name: group
    description: 组设置
  - name: newsletter
    description: 通讯设置
  - name: chatwoot
    description: 客户支持的聊天窗口集成
paths:
  /send/image:
    post:
      tags:
        - send
      summary: 发送图像
      operationId: sendImage
      parameters:
        - $ref: '#/components/parameters/DeviceIdHeader'
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              allOf:
                - $ref: '#/components/schemas/ScheduleOptions'
              properties:
                phone:
                  type: string
                  example: 6289685028129@s.whatsapp.net
                  description: 具有国家代码的电话号码
                caption:
                  type: string
                  example: selamat malam
                  description: 要发送的标题
                mentions:
                  type: array
                  items:
                    type: string
                  example:
                    - '628123456789'
                    - '@everyone'
                  description: |
                    要提及的电话号码列表(主机提及-标题中不需要@)。
                    字幕中的`@phone`也被提及。 使用特殊关键词“@everone”来提及所有群组参与者。
                    每个条目分别发送一个 `mentions` 表单字段。
                reply_message_id:
                  type: string
                  example: 3EB089B9D6ADD58153C561
                  description: 您想要回复的消息 ID
                view_once:
                  type: boolean
                  example: false
                  description: 查看一次
                image:
                  type: string
                  format: binary
                  description: 要发送的图像
                image_url:
                  type: string
                  example: https://example.com/image.jpg
                  description: 要发送的图像 URL
                compress:
                  type: boolean
                  example: false
                  description: 压缩图像
                hd:
                  type: boolean
                  example: true
                  description: 发送高定义图像移除(最大边缘2560px)。 真时覆盖压缩。
                duration:
                  type: integer
                  example: 86400
                  description: >-
                    消息持续时间以秒为单位。 允许值：0 (没有到期)、86400 (24h)、604800
                    (7d)、776000(90d)。
                is_forwarded:
                  type: boolean
                  example: false
                  description: 这是否是一个转发消息
                allow_reshare:
                  type: boolean
                  example: false
                  description: >-
                    向查看状态的人显示reshare按钮。 需要 `phone` 为 `status@broadcast`; GOWA
                    拒绝任何其他收件人使用该字段。
      responses:
        '200':
          description: 好的
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendResponse'
        '400':
          description: 错误请求
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBadRequest'
        '500':
          description: 服务器内部错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInternalServer'
components:
  parameters:
    DeviceIdHeader:
      name: X-Device-Id
      in: header
      required: false
      description: |
        多设备支持的设备标识符。 当多个设备被注册时需要.
        如果只有一个设备被注册，它将被用作默认。
        也可以以 `device_id` 查询参数提供。
      schema:
        type: string
        example: my-device-id
  schemas:
    ScheduleOptions:
      type: object
      description: |
        可选字段安排消息，而不是现在发送消息。 设置
        `scheduled_at` 以调度；没有它，信息将立即发送。
        后台工作人员在预定时间发送它，当
        设备处于离线状态或未登录时重试 上传的媒体存储在
        服务器上，直到计划完成为止。
        在 multipart/form-data 请求体中，将 `weekdays` 作为重复字段发送
        （`weekdays=1`、`weekdays=3`）。
      properties:
        scheduled_at:
          type: string
          format: date-time
          example: '2026-10-01T09:00:00+07:00'
          description: >-
            第一次发送时间为RFC3339。 必须在未来进行。 首次发送始终在此时间进行，即使该时间不在 `weekdays` 或
            `day_of_month` 指定的范围内；这两个字段仅决定后续的重复发送时间。
        timezone:
          type: string
          example: Asia/Jakarta
          description: 用于计算循环运行的IANA时区。 设置计划时必填。
        recurrence:
          type: string
          enum:
            - once
            - daily
            - weekly
            - monthly
          default: once
          description: 重复发送的次数
        weekdays:
          type: array
          items:
            type: integer
            minimum: 0
            maximum: 6
          uniqueItems: true
          example:
            - 1
            - 3
            - 5
          description: 发送天数, 0=星期天到 6=星期六 每周重现时必填。
        day_of_month:
          type: integer
          minimum: 1
          maximum: 31
          example: 15
          description: 月份的日子，紧紧接着月份的最后一天。 当每个月重现时需要。
        end_at:
          type: string
          format: date-time
          example: '2026-12-31T23:59:59+07:00'
          description: 仅重复使用。 此时间后不会发送。必须在排定时间之后发送。
        occurrence_limit:
          type: integer
          minimum: 1
          example: 10
          description: 仅重复使用。 多次发送后停止。
    SendResponse:
      type: object
      properties:
        code:
          type: string
          example: SUCCESS
        message:
          type: string
          example: Success
        results:
          type: object
          properties:
            message_id:
              type: string
              example: 3EB0B430B6F8F1D0E053AC120E0A9E5C
              description: 预定的发送
            status:
              type: string
              example: <feature> success ....
            schedule_id:
              type: string
              example: 0b5c3a8e-7f5d-4d6f-9d1e-2f8c1a7b9e10
              description: 仅计划发送。 使用 /send/schedules 路由。
            scheduled_at:
              type: string
              format: date-time
              example: '2026-10-01T02:00:00Z'
              description: 仅计划发送。 第一次发送时间。
            next_run_at:
              type: string
              format: date-time
              example: '2026-10-01T02:00:00Z'
              description: 仅计划发送。 当工人接下来发送时。
    ErrorBadRequest:
      type: object
      properties:
        code:
          type: string
          example: 400
          description: HTTP 状态代码
        message:
          type: string
          example: field cannot be blank
          description: 详细错误消息
        results:
          type: object
          example: null
          description: 附加数据
    ErrorInternalServer:
      type: object
      properties:
        code:
          type: string
          example: INTERNAL_SERVER_ERROR
          description: SYSTEM_CODE_ERROR
        message:
          type: string
          example: you are not loggin
          description: 详细错误消息
        results:
          type: object
          example: null
          description: 附加数据
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````

## Related topics

- [实验性交互消息](https://gowa-docs.mintlify.site/zh/examples/interactive-messages.md)
- [正在发送消息](https://gowa-docs.mintlify.site/zh/examples/sending-messages.md)
- [媒体处理](https://gowa-docs.mintlify.site/zh/examples/media-handling.md)
- [聊天woot 集成](https://gowa-docs.mintlify.site/zh/integrations/chatwoot.md)
- [预定发送](https://gowa-docs.mintlify.site/zh/examples/scheduled-sends.md)


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