Keys

设置该 Key 的完成回调 / Set the key's completion webhook

作品到达终态(finished / failed)时向 url POST JSON { event: "generation.finished", generation },请求头 X-Taoyuan-Signature: sha256=<HMAC-SHA256(body, 该 Key 的 webhook secret)>。传 null 关闭。

When a generation started with this key reaches a terminal state, we POST { event: "generation.finished", generation } to url with header X-Taoyuan-Signature: sha256=<hex HMAC-SHA256 of the raw body using the key's webhook secret>. Send null to turn it off.

put/v1/api-keys/{id}/webhook

Request

  • Base URL: https://api.musicsforyou.com
  • URL: https://api.musicsforyou.com/v1/api-keys/{id}/webhook
  • Auth: OAuth 2 (authorization code, authorization URL https://www.musicsforyou.com/oauth/authorize, token URL https://api.musicsforyou.com/oauth/token, scopes: music)

Path parameters

idstring required

key id

Request body

urlstring uri nullable required

HTTPS 地址;null 表示关闭 / HTTPS URL, or null to turn off

Response

OK

successtrue required
webhookUrlstring uri nullable required

Changes

No recorded changes to this operation across all 1 revision of this API.