PushGo Gateway API

此页面仅面向普通消息推送方,覆盖发送类接口: /message/event/*/thing/*
This page targets message senders and documents only push endpoints: /message, /event/*, /thing/*.

私有传输运行参数(QUIC/TCP/WSS/MQTT)不在本页;请参考 gateway README 的 “Private Transport Model / CLI Reference / Upgrade Notes for v1.2.11”,并使用 PUSHGO_PRIVATE_TRANSPORTS(或 --private-transports)做显式启停配置。Docker/container 部署需要显式发布 MQTT 1883/tcp 或在边缘层终止 8883/tcp
发送端不得传入 op_id;它由 gateway 生成并在响应中返回。 若旧客户端继续传入,gateway 返回 400 op_id_not_allowed
MQTT 客户端必须使用 MQTT 5 和 QoS 1。CONNECT 使用 User Property device_type=publish 表示临时只发送连接,或 device_type=subscribe 表示持久接收设备。Subscribe 设备的 client id 为空、未知,或因属于其他 platform 而被替换时,gateway 会通过 CONNACK Assigned Client Identifier 返回分配后的 device key。MQTT topic 直接使用 {channel_id};payload 使用 type 区分业务模型。 publish envelope 为 {"type":"message","data":{...}},或 {"type":"event|thing","action":"create|update|close|archive|delete","data":{...}}。 MQTT 上行和下行都支持 message/event/thing;topic/password 是可信通道身份, payload 不携带 channel_idpassword。 MQTT 遗嘱消息只允许 device_type=subscribe 设备设置;Will Topic 为原始 {channel_id},可发送到任意频道,Will QoS 必须为 1,Will Retain 必须为 false,Will Properties 必须包含 User Property pushgo-password,Will payload 使用同一套 publish envelope。Gateway 会在异常断开或 MQTT 5 DisconnectWithWillMessage 时发送遗嘱,正常 DISCONNECT 不发送。
Private runtime configuration (QUIC/TCP/WSS/MQTT) is not covered on this page. See gateway README sections “Private Transport Model / CLI Reference / Upgrade Notes for v1.2.11” and use PUSHGO_PRIVATE_TRANSPORTS (or --private-transports) for explicit transport enablement. Docker/container deployments must publish MQTT 1883/tcp, or terminate TLS at the edge on 8883/tcp.
Sender requests must not provide op_id; gateway generates it and returns it in the response. Legacy clients that still provide op_id receive 400 op_id_not_allowed.
MQTT clients must use MQTT 5 and QoS 1. CONNECT uses User Property device_type=publish for temporary publish-only connections, or device_type=subscribe for persistent receiver devices. For subscribe devices, an empty, unknown, or replaced client id causes gateway to return the assigned device key in CONNACK Assigned Client Identifier. MQTT topic is the raw {channel_id}; payload type identifies the business model. MQTT publish accepts {"type":"message","data":{...}} for messages and {"type":"event|thing","action":"create|update|close|archive|delete","data":{...}} for entity actions. MQTT downlink uses {"schema":"pushgo.mqtt.delivery.v1","type":"message|event|thing","delivery_id":"...","channel_id":"...","data":{...}} as a realtime outlet and does not persist offline MQTT receiver deliveries through private outbox. MQTT Will Message is accepted only from device_type=subscribe; Will Topic is raw {channel_id} and may target any channel, Will QoS must be 1, Will Retain must be false, Will Properties must include User Property pushgo-password, and Will payload uses the same publish envelope. Gateway publishes the Will on abnormal close or MQTT 5 DisconnectWithWillMessage, but not on normal DISCONNECT.

整体请求 / 响应格式
Global Request / Response Format

所有推送接口都使用 JSON。先看统一格式,再看每个接口的业务字段。
All push endpoints use JSON. Read global envelope first, then endpoint business fields.

全局请求体限制:HTTP body 最大 32KBDefaultBodyLimit::max(32 * 1024))。 业务 ID(message_id/event_id/thing_id)由网关生成,当前格式为 32 位小写十六进制字符串。
Global request body limit: HTTP body is capped at 32KB (DefaultBodyLimit::max(32 * 1024)). Business IDs (message_id/event_id/thing_id) are generated by gateway and currently use 32-char lowercase hex strings.

当前发送类接口请求模型启用了严格 JSON 解析(deny_unknown_fields): 未声明字段会触发 400。
Current push endpoint request models use strict JSON parsing (deny_unknown_fields): undeclared fields are rejected with HTTP 400.

请求头
Request headers

字段
Field
必填
Required
类型
Type
说明
Notes
Content-Type
Yes
string 固定为 application/json
Must be application/json.
Authorization 按部署
Depends
string 若网关启用鉴权,使用 Bearer <token>
Use Bearer <token> when auth is enabled.

通用请求字段
Common request fields

字段
Field
必填
Required
类型
Type
说明
Notes
channel_id
Yes
string 目标频道 ID。
Target channel ID.
password
Yes
string 频道密码(8-128)。
Channel password (8-128 chars).
op_id 否,且禁止传入
No, forbidden
string | null op_id 是 Gateway 生成的发送流水号,发送端请求不得传入。 若传入,Gateway 返回 400 op_id_not_allowed
op_id is a gateway-generated send operation id. Sender requests must not provide it; if provided, gateway returns 400 op_id_not_allowed.

通用响应包裹
Common response envelope

字段
Field
类型
Type
说明
Notes
success boolean 请求是否成功。
Whether request succeeded.
data object | null 成功时为业务响应对象。
Business response on success.
error string | null 失败时的错误信息。
Error message on failure.
error_code string | null 部分错误会返回错误码。
Optional machine-readable error code.

示例响应
Response examples

{
  "success": true,
  "data": {
    "op_id": "00191a2050440-0123456789abcdef0123456789abcdef",
    "message_id": "8a1fc4b3d9f04fd2857f92f66f7cc5d1"
  }
}
{
  "success": false,
  "error": "channel not found",
  "error_code": null,
  "data": null
}

消息推送接口
Message Push API

POST /message JSON

作用:发送一条顶层消息。接口同步返回“是否受理”,下发在后台异步执行。
Purpose: send a top-level message. Response indicates acceptance only.

发送说明(面向推送方):单次请求体最大 32KB;ttl 超过 28 天会按 28 天处理。
Sender notes: request body is capped at 32KB; ttl is capped at 28 days.

请求业务字段
Request business fields

字段
Field
必填
Required
类型
Type
说明
Notes
thing_id
No
string 可选对象 ID;请直接使用网关返回的 thing_id。有值时视为对象下消息。
Optional thing ID; use the thing_id returned by gateway. It marks the message as thing-scoped.
occurred_at 条件必填
Conditional
number | string 业务发生时间(支持 Unix 秒/毫秒,网关内部归一化为毫秒)。默认可省略;但当 thing_id 存在(对象下消息)时必须提供,否则返回 occurred_at_required_for_thing_scoped_message
Business occurred-at timestamp accepts Unix seconds or milliseconds and is normalized to milliseconds. Optional by default; required when thing_id is present (thing-scoped message), otherwise request is rejected.
title
Yes
string 消息标题。
Message title.
body
No
string 消息正文(可 Markdown)。
Message body (Markdown allowed).
url
No
string 可选跳转链接(空字符串会被忽略)。
Optional link URL (empty string is ignored).
ciphertext
No
string 可选密文透传字段(空字符串会被忽略)。网关不解密、不重写、只按字符串透传给客户端。
Optional encrypted payload passthrough (empty string is ignored). Gateway does not decrypt or rewrite it; it is forwarded as-is to clients.
images
No
string[] 图片 URL 列表(最多 32 条,每条最多 2048 字符)。
Image URL list (up to 32 items, each up to 2048 chars).
tags
No
string[] 标签列表(最多 32 条,每条最多 64 字符)。
Tag list (up to 32 items, each up to 64 chars).
severity
No
string critical|high|normal|low,默认 normal。内部映射:APNs 为 critical/time-sensitive/active/passive,FCM 为 HIGH/NORMAL,WNS 为 1/2/3;未知值按 normal 处理。
Notification severity. Internal mapping: APNs critical/time-sensitive/active/passive, FCM HIGH/NORMAL, WNS 1/2/3; unknown values fall back to normal.
ttl
No
number 过期时间(支持 Unix 秒/毫秒,网关内部归一化为毫秒);最大按 28 天处理。
Expire-at timestamp accepts Unix seconds or milliseconds and is normalized to milliseconds; capped to 28 days.
metadata
No
object 自定义键值,只支持 string/number/bool;key ≤ 64,value ≤ 512。
Custom key-values, scalar only (string/number/bool); key ≤ 64, value ≤ 512.

ciphertext 详细规范(重要)
Detailed ciphertext spec (important)

以下规则基于 Apple 客户端当前实现(PushGo iOS/macOS/watchOS 共享解密路径)。 发送侧请严格按此构造,否则客户端会标记解密失败并回退到明文展示(若有明文字段)。
The rules below are based on the current Apple client implementation (shared iOS/macOS/watchOS decrypt path). Follow this exactly; otherwise clients mark decrypt failure and fall back to plaintext when available.

1) 支持算法与密钥要求
1) Supported algorithm and key requirements

2) ciphertext 编码格式
2) ciphertext encoding format

先将明文 JSON(UTF-8)做 AES-GCM 加密,然后按如下字节顺序拼接并 Base64:
Encrypt plaintext JSON (UTF-8) with AES-GCM, then concatenate and Base64:

ciphertext_field = Base64( cipher || tag || iv )

3) 解密后 JSON 结构(客户端统一实现)
3) JSON structure after decrypt (cross-client behavior)

客户端解密 ciphertext 后会按 JSON 解码,当前识别字段为:
After decrypting ciphertext, client decodes JSON and currently recognizes:

字段
Field
类型
Type
说明
Notes
title string 可选。存在且非空时覆盖通知标题。
Optional. Non-empty value overrides notification title.
body string 可选。存在且非空时覆盖通知正文。
Optional. Non-empty value overrides notification body.
images string[] 或 JSON 字符串
string[] or JSON-stringified array
可选。客户端会做 trim + 去重后写回 payload。
Optional. Client trims and deduplicates values before applying.
url string 可选。存在且有效时覆盖 payload 中的 url
Optional. When valid and non-empty, overrides payload url.
description/status/message/tags/started_at/ended_at/attrs string/number/object 或 JSON 字符串
string/number/object or JSON-stringified value
可选。事件/对象语义字段直接使用同名键,不再使用 legacy profile/attrs 包装字段。
Optional. Use canonical event/thing keys directly; legacy profile/attrs wrapper keys are not supported.

4) 发送构造示例
4) Sender construction example

{
  "title": "Encrypted title",
  "body": "Encrypted body",
  "url": "https://safe.example/open",
  "description": "Encrypted event summary",
  "message": "Encrypted event body",
  "attrs": {"name":{"label":"名称","value":"泵站A"}},
  "images": [
    "https://cdn.example.com/a.png",
    "https://cdn.example.com/b.png"
  ]
}

将上面 JSON 作为明文,使用共享密钥 + 12-byte IV 做 AES-GCM,加密后拼成 cipher||tag||iv,再 Base64,放入 /messageciphertext 字段。
Use the JSON above as plaintext, encrypt with shared key + 12-byte IV using AES-GCM, concatenate cipher||tag||iv, Base64 it, and put the result in /message.ciphertext.

{
  "channel_id": "YOUR_CHANNEL_ID",
  "password": "YOUR_PASSWORD",
  "title": "Fallback title",
  "body": "Fallback body",
  "ciphertext": "BASE64_OF_cipher_tag_iv"
}

5) 行为优先级与回退
5) priority and fallback behavior

响应业务字段
Response business fields

字段
Field
类型
Type
说明
Notes
op_id string Gateway 生成的发送流水号。
Gateway-generated send operation id.
message_id string 网关生成,当前为 32 位小写十六进制。
Generated by gateway; currently 32-char lowercase hex.

发送状态查询
Send Status Query

GET /send_status/{op_id} 查询单次发送的粗粒度状态。该接口只接受 Gateway 返回的 op_id,不支持按频道、设备、payload 或 provider 信息查询。
Query a coarse sender-facing status for one send operation. The only lookup key is the gateway-returned op_id; channel, device, payload, and provider details are intentionally not exposed.

响应字段
Response field
类型
Type
说明
Notes
op_id string Gateway 生成的发送流水号。
Gateway-generated send operation id.
status string accepted, processing, sent, partially_failed, 或 failed
One of accepted, processing, sent, partially_failed, or failed.
model string message, event, 或 thing
entity_id string 本次发送对应的技术实体 ID。
Technical entity id for this send.
accepted_at/updated_at/expires_at integer 毫秒时间戳。
Millisecond timestamps.

状态记录会按维护清理策略自动过期;过期或不存在时返回 404 send_status_not_found
Status records expire through maintenance cleanup; expired or missing records return 404 send_status_not_found.

事件推送接口
Event Push APIs

二级事件已并入一级事件接口:都走 /event/*,是否挂在某个对象下由可选 thing_id 决定。
Thing-scoped events are merged into top-level event APIs; optional thing_id decides whether the event belongs to a thing.

/event/* 请求支持可选 ciphertext,网关仅透传密文;路由与优先级字段(如 channel_id/event_id/thing_id/severity)建议保持明文。
/event/* accepts optional ciphertext. Gateway only forwards it; routing/priority fields (for example channel_id/event_id/thing_id/severity) should remain plaintext.

POST /event/create

作用:创建事件并推送。
Purpose: create an event.
约束:/event/create 不接受 event_id,由网关生成。
Rule: /event/create does not accept event_id; gateway generates it.

请求业务字段
Request business field
必填
Required
类型
Type
说明
Notes
title
Yes
string 事件标题。
Event title.
status
Yes
string 事件状态。
Event status.
message
Yes
string 事件内容。
Event message.
severity
Yes
string critical|high|normal|low(不在此范围会返回 400)。
critical|high|normal|low only (otherwise 400).
description
No
string 补充描述。
Description.
tags
No
string[] 标签列表(最多 32 条,每条最多 64 字符)。
Tags (up to 32 items, each up to 64 chars).
images
No
string[] 图片 URL 列表(最多 32 条,每条最多 2048 字符)。
Image URLs (up to 32 items, each up to 2048 chars).
started_at
No
number 开始时间(支持 Unix 秒/毫秒,网关内部归一化为毫秒)。
Start time (Unix seconds or milliseconds; normalized to milliseconds).
event_time
Yes
number 事件时间(支持 Unix 秒/毫秒),作为本次事件分发的业务发生时间;网关内部归一化为毫秒。
Event time accepts Unix seconds or milliseconds and is normalized to milliseconds for dispatch.
thing_id
No
string 可选对象 ID;请直接使用网关返回的 thing_id。有值时视为对象下事件。
Optional thing ID; use the thing_id returned by gateway.
metadata
No
object 本次请求附加信息(仅允许 string/number/bool);key ≤ 64,value ≤ 512。
Request-scoped metadata (string/number/bool only); key ≤ 64, value ≤ 512.
attrs
No
object 用于更新自定义属性;值为 null 表示删除该键;不支持数组。
Used to update custom attributes; null means deleting that key; arrays are not supported.

额外约束:started_at 只在 create 可传;event_id 由网关生成;create 需要 title/status/message/severity
Extra rules: started_at is create-only; event_id is generated by gateway; create requires title/status/message/severity.

响应业务字段
Response business field
类型
Type
说明
Notes
event_id string 网关生成,当前为 32 位小写十六进制。
Generated by gateway; currently 32-char lowercase hex.
op_id string Gateway 生成的发送流水号。
Gateway-generated send operation id.

POST /event/update

作用:更新事件并推送。
Purpose: update an event.

请求业务字段
Request business field
必填
Required
类型
Type
说明
Notes
event_id
Yes
string 待更新事件 ID;请直接使用创建接口返回的 event_id
Event ID to update; use the event_id returned by create API.
status
Yes
string 更新后的状态。
New status.
message
Yes
string 更新后的内容。
New message.
severity
Yes
string critical|high|normal|low(不在此范围会返回 400)。
critical|high|normal|low only (otherwise 400).
event_time
Yes
number 事件时间(支持 Unix 秒/毫秒),作为本次事件分发的业务发生时间;网关内部归一化为毫秒。
Event time accepts Unix seconds or milliseconds and is normalized to milliseconds for dispatch.
title
No
string 可选更新。
Optional title update.
description
No
string 可选更新。
Optional description update.
tags
No
string[] 可选更新(最多 32 条,每条最多 64 字符)。
Optional update (up to 32 items, each up to 64 chars).
images
No
string[] 可选更新(最多 32 条,每条最多 2048 字符)。
Optional update (up to 32 items, each up to 2048 chars).
thing_id
No
string 可选对象 ID;用于本次事件分发的关联信息。
Optional thing ID for this event dispatch.
metadata
No
object 本次请求附加信息(仅允许 string/number/bool);key ≤ 64,value ≤ 512。
Request-scoped metadata (string/number/bool only); key ≤ 64, value ≤ 512.
attrs
No
object 用于更新自定义属性;值为 null 表示删除该键;不支持数组。
Used to update custom attributes; null means deleting that key; arrays are not supported.

额外约束:update 需要 event_id/status/message/severity;不允许传 started_atended_at
Extra rules: update requires event_id/status/message/severity; started_at and ended_at are not allowed.

响应业务字段
Response business field
类型
Type
说明
Notes
event_id string 事件 ID。
Event ID.
op_id string Gateway 生成的发送流水号。
Gateway-generated send operation id.

POST /event/close

作用:关闭事件并推送。
Purpose: close an event.

请求业务字段
Request business field
必填
Required
类型
Type
说明
Notes
event_id
Yes
string 待关闭事件 ID;请直接使用创建接口返回的 event_id
Event ID to close; use the event_id returned by create API.
status
Yes
string 关闭状态文案。
Close status.
message
Yes
string 关闭说明。
Close message.
severity
Yes
string critical|high|normal|low(不在此范围会返回 400)。
critical|high|normal|low only (otherwise 400).
event_time
Yes
number 事件时间(支持 Unix 秒/毫秒),作为本次事件分发的业务发生时间;网关内部归一化为毫秒。
Event time accepts Unix seconds or milliseconds and is normalized to milliseconds for dispatch.
ended_at
No
number 结束时间(支持 Unix 秒/毫秒,仅 close 可传),网关内部归一化为毫秒。
End time accepts Unix seconds or milliseconds (close-only) and is normalized to milliseconds.
thing_id
No
string 可选对象 ID;用于本次事件分发的关联信息。
Optional thing ID for this event dispatch.
metadata
No
object 本次请求附加信息(仅允许 string/number/bool);key ≤ 64,value ≤ 512。
Request-scoped metadata (string/number/bool only); key ≤ 64, value ≤ 512.
attrs
No
object 用于更新自定义属性;值为 null 表示删除该键;不支持数组。
Used to update custom attributes; null means deleting that key; arrays are not supported.

额外约束:close 需要 event_id/status/message/severityended_at 仅 close 可传,started_at 不允许。
Extra rules: close requires event_id/status/message/severity; ended_at is close-only and started_at is not allowed.

响应业务字段
Response business field
类型
Type
说明
Notes
event_id string 事件 ID。
Event ID.
op_id string Gateway 生成的发送流水号。
Gateway-generated send operation id.

对象推送接口
Thing Push APIs

/thing/* 请求支持可选 ciphertext,网关仅透传密文;路由字段(如 channel_id/thing_id)建议保持明文。
/thing/* accepts optional ciphertext. Gateway only forwards it; routing fields (for example channel_id/thing_id) should remain plaintext.

POST /thing/create

作用:创建对象并推送。
Purpose: create a thing.

请求业务字段
Request business field
必填
Required
类型
Type
说明
Notes
title 建议
Recommended
string 建议在 create 传入(产品语义上用于对象主标题);当前网关不会因缺失 title 拒绝请求。
Recommended on create as the primary thing title in product semantics; current gateway does not reject create when title is missing.
description
No
string 对象描述。
Thing description.
tags
No
string[] 标签(最多 32 条,每条最多 64 字符)。
Tags (up to 32 items, each up to 64 chars).
primary_image
No
string 主图 URL。
Primary image URL.
images
No
string[] 附加图片 URL(最多 32 条,每条最多 2048 字符)。
Extra image URLs (up to 32 items, each up to 2048 chars).
created_at
No
number 创建时间(支持 Unix 秒/毫秒,网关内部归一化为毫秒)。
Create time (Unix seconds or milliseconds; normalized to milliseconds).
external_ids
No
object 外部 ID 映射(value 仅支持字符串或 null)。
External ID map (values support string or null only).
location_type
No
string 位置类型;需与 location_value 成对出现。
Location type; must be provided with location_value.
location_value
No
string 位置值;需与 location_type 成对出现。
Location value; must be provided with location_type.
observed_at
Yes
number 观测时间(支持 Unix 秒/毫秒),作为本次对象分发的业务发生时间;网关内部归一化为毫秒。
Observed time accepts Unix seconds or milliseconds and is normalized to milliseconds for dispatch.
metadata
No
object 本次请求附加信息(仅允许 string/number/bool);key ≤ 64,value ≤ 512。
Request-scoped metadata (string/number/bool only); key ≤ 64, value ≤ 512.
attrs
No
object 用于更新对象自定义属性;值为 null 表示删除该键;不支持数组。
Used to update thing custom attributes; null means deleting that key; arrays are not supported.
响应业务字段
Response business field
类型
Type
说明
Notes
thing_id string 网关生成,当前为 32 位小写十六进制。
Generated by gateway; currently 32-char lowercase hex.
op_id string Gateway 生成的发送流水号。
Gateway-generated send operation id.

POST /thing/update

作用:更新对象并推送。
Purpose: update a thing.

请求业务字段
Request business field
必填
Required
类型
Type
说明
Notes
thing_id
Yes
string 待更新对象 ID;请直接使用创建接口返回的 thing_id
Thing ID to update; use the thing_id returned by create API.
title
No
string 对象标题更新。
Thing title update.
description
No
string 对象描述更新。
Thing description update.
tags
No
string[] 标签更新。
Tags update.
primary_image
No
string 主图 URL 更新。
Primary image URL update.
images
No
string[] 附加图片 URL 更新。
Extra image URLs update.
external_ids
No
object 外部 ID 更新。
External ID update.
location_type
No
string 位置类型更新;需与 location_value 成对出现。
Location type update; must be paired with location_value.
location_value
No
string 位置值更新;需与 location_type 成对出现。
Location value update; must be paired with location_type.
observed_at
Yes
number 观测时间(支持 Unix 秒/毫秒),作为本次对象分发的业务发生时间;网关内部归一化为毫秒。
Observed time accepts Unix seconds or milliseconds and is normalized to milliseconds for dispatch.
metadata
No
object 本次请求附加信息(仅允许 string/number/bool);key ≤ 64,value ≤ 512。
Request-scoped metadata (string/number/bool only); key ≤ 64, value ≤ 512.
attrs
No
object 用于更新对象自定义属性;值为 null 表示删除该键;不支持数组。
Used to update thing custom attributes; null means deleting that key; arrays are not supported.
响应业务字段
Response business field
类型
Type
说明
Notes
thing_id string 对象 ID。
Thing ID.
op_id string Gateway 生成的发送流水号。
Gateway-generated send operation id.

POST /thing/archive

作用:归档对象。
Purpose: archive a thing.

请求业务字段
Request business field
必填
Required
类型
Type
说明
Notes
thing_id
Yes
string 待归档对象 ID;请直接使用创建接口返回的 thing_id
Thing ID to archive; use the thing_id returned by create API.
title
No
string 对象标题更新。
Thing title update.
description
No
string 对象描述更新。
Thing description update.
tags
No
string[] 标签更新。
Tags update.
primary_image
No
string 主图 URL 更新。
Primary image URL update.
images
No
string[] 附加图片 URL 更新。
Extra image URLs update.
external_ids
No
object 外部 ID 更新。
External ID update.
location_type
No
string 位置类型更新;需与 location_value 成对出现。
Location type update; must be paired with location_value.
location_value
No
string 位置值更新;需与 location_type 成对出现。
Location value update; must be paired with location_type.
observed_at
Yes
number 观测时间(支持 Unix 秒/毫秒),作为本次对象分发的业务发生时间;网关内部归一化为毫秒。
Observed time accepts Unix seconds or milliseconds and is normalized to milliseconds for dispatch.
metadata
No
object 本次请求附加信息(仅允许 string/number/bool);key ≤ 64,value ≤ 512。
Request-scoped metadata (string/number/bool only); key ≤ 64, value ≤ 512.
attrs
No
object 用于更新对象自定义属性;值为 null 表示删除该键;不支持数组。
Used to update thing custom attributes; null means deleting that key; arrays are not supported.
响应业务字段
Response business field
类型
Type
说明
Notes
thing_id string 对象 ID。
Thing ID.
op_id string Gateway 生成的发送流水号。
Gateway-generated send operation id.

POST /thing/delete

作用:删除对象。
Purpose: delete a thing.

请求业务字段
Request business field
必填
Required
类型
Type
说明
Notes
thing_id
Yes
string 待删除对象 ID;请直接使用创建接口返回的 thing_id
Thing ID to delete; use the thing_id returned by create API.
title
No
string 对象标题更新。
Thing title update.
description
No
string 对象描述更新。
Thing description update.
tags
No
string[] 标签更新。
Tags update.
primary_image
No
string 主图 URL 更新。
Primary image URL update.
images
No
string[] 附加图片 URL 更新。
Extra image URLs update.
external_ids
No
object 外部 ID 更新。
External ID update.
location_type
No
string 位置类型更新;需与 location_value 成对出现。
Location type update; must be paired with location_value.
location_value
No
string 位置值更新;需与 location_type 成对出现。
Location value update; must be paired with location_type.
deleted_at
No
number 删除时间(支持 Unix 秒/毫秒,网关内部归一化为毫秒)。
Delete time (Unix seconds or milliseconds; normalized to milliseconds).
observed_at
Yes
number 观测时间(支持 Unix 秒/毫秒),作为本次对象分发的业务发生时间;网关内部归一化为毫秒。
Observed time accepts Unix seconds or milliseconds and is normalized to milliseconds for dispatch.
metadata
No
object 本次请求附加信息(仅允许 string/number/bool);key ≤ 64,value ≤ 512。
Request-scoped metadata (string/number/bool only); key ≤ 64, value ≤ 512.
attrs
No
object 用于更新对象自定义属性;值为 null 表示删除该键;不支持数组。
Used to update thing custom attributes; null means deleting that key; arrays are not supported.
响应业务字段
Response business field
类型
Type
说明
Notes
thing_id string 对象 ID。
Thing ID.
op_id string Gateway 生成的发送流水号。
Gateway-generated send operation id.

Markdown 支持说明
Markdown support

body 字段按客户端 Markdown 渲染链路处理,无需额外开关或字段;普通纯文本也可直接发送。
The body field goes through the client Markdown rendering pipeline by default, with no extra flags required; plain text also works.

常见 Markdown 写法在 PushGo 客户端总体兼容;不同平台渲染引擎存在细微差异,复杂写法可能展示略有不同。
Common Markdown authoring is broadly compatible across PushGo clients. Rendering can vary slightly between platforms for complex constructs.

若遇到不兼容语法,客户端会尽量保留原文文本,不影响消息可读性。
For unsupported syntax, clients preserve readable plain text whenever possible.

建议写法
Authoring guidance

示例:业务通知
Example: Business notification

# 微信消息转发
> 来源:@alice 在 #渠道运营
**标题:** 新品上线通知
*时间:* 2026-03-20 09:30

[!info] 已将原消息转发到企业微信,请确认是否需要补充说明。

- 重点:==首批库存 2,000== 件
- 文档:查看 [发布说明](https://example.com/release)
- 备注:~~延后发布~~ 改为今天 10:00
1. 负责人:@bob
2. 联系:ops@example.com / 400-800-1234

| 字段 | 值 | 说明 |
| --- | --- | --- |
| 原始群 | 产品内测群 | WeChat |
| 消息 ID | WX-98231 | `msg_id` |
| 链接 | https://wechat.example.com/msg/98231 | 自动识别 |

---

这个消息包含 `inline code` 和 #转发 标签。

示例:监控告警
Example: Monitoring alert

# 服务器监控报警
[!warning] CPU 持续 5 分钟 > 92%,请立即处理。
> 机器:`prod-api-03` (10.2.0.23)
> 时间窗:2026-03-20 10:05-10:10

**影响面:** *支付* 与 *结算* 服务
- 负载:==7.8==
- 错误率:3.2%
- 关联工单:#incident-20260320

1. 检查近期发布:`v2.18.4`
2. 查看日志:https://grafana.example.com/d/abc
3. 值班人:@oncall

| 指标 | 当前 | 阈值 |
| --- | --- | --- |
| CPU | 92% | 85% |
| Memory | 78% | 80% |
| P95 延迟 | 680ms | 500ms |

---

需要升级到 [Runbook](https://example.com/runbook) 或发邮件 ops@example.com。

错误与限制
Errors and limits

兼容接口(附录)
Compatibility Endpoints (Appendix)

本节为迁移与低门槛接入提供的兼容入口,优先级低于标准接口。生产集成建议优先使用 /message/event/*/thing/*
This section provides migration-friendly compatibility endpoints and is secondary to the standard APIs. Prefer /message, /event/*, and /thing/* for production integrations.

鉴权保持 PushGo 基础规则:兼容参数中使用明文 <channel_id>:<password>(称为 compat_key),并借位放入对方风格参数(topic/sendkey/device_key)。
Authentication still follows PushGo rules: use plaintext <channel_id>:<password> as a compatibility key and place it in provider-style parameters (topic/sendkey/device_key).

兼容接口与 GET /message 均不接受 thing_id
thing_id is not accepted by compatibility endpoints and GET /message.

兼容路由
Compatibility routes

类别
Kind
方法
Method
路径
Path
说明
Notes
ntfy POST/PUT /ntfy/{topic} {topic}=compat_key,并兼容 /publish/send/trigger 变体。
Server酱 GET/POST /serverchan/{sendkey} {sendkey}=compat_key,支持 .send 后缀风格。
Bark v1 GET /bark/{device_key}/{body}/bark/{device_key}/{title}/{body} {device_key}=compat_key
Bark v2 POST /bark/push JSON 字段 device_key=compat_key