Skip to content

Create a webhook

gerome12 edited this page Sep 21, 2020 · 14 revisions

Used to create a new webhook to an album. The user must be an admin.

URL : /albums/{album_id}/webhooks

Method : POST

Auth Required : Authorization with a JWT Bearer token with the user as the sub claim.

Headers

  • Accept : If present, require that this value be application/json
  • Content-Type : Must be : application/x-www-form-urlencoded

Parameters

  • url={url}
    max 1024 characters
    the scheme can only be http or https
  • name={description}
    min 1, max 255 characters
  • secret={secret} (Optional)
    min 1, max 1024 characters
  • event={event}
    • event : new_series, new_user, remove_series, delete_album.
      event can be send multiple times.
  • enabled={true/false} by default : true (Optional)

Success Response

  • Status : 201 Created
{
    "id": "QAdfIstxuOvwkcm39WEO",
    "url": "https://webhook.site/123456",
    "name": "the name of the webhook",
    "use_secret": false,
    "events": ["new_series","new_user"],
    "enabled": true,
    "last_triggers": [],
    "number_of_triggers": 0
}

Error Response

If the user is not found
If the album is not found

  • Status : 404 Not Found

If a parameter is wrong

  • Status : 400 Bad Request
Clone this wiki locally