Set Bucket Webhooks

Replace the webhook notification rules of a bucket you own.
EndpointMethodAdmin Required
/api/v1/buckets/:bucketName/notificationsPUTNo

Replaces the webhook notification rules for a bucket you own, overwriting the existing configuration entirely. Send an empty rules array to remove all webhooks. See Webhooks for payload format, signing, and retry behavior.

Path Parameters

bucketName
string required
The name of the bucket.

Request Body

rules
array required
Up to 16 rules. Each rule has the fields below.

Rule fields

id
string required
The rule's UUID. Send the all-zero UUID (00000000-0000-0000-0000-000000000000) for a new rule - the server assigns a real id and returns it.
url
string required
The http or https endpoint to deliver events to. URLs resolving to private, loopback, or link-local addresses can only be set by administrators.
secret
string
Optional signing secret. When set, each delivery carries an X-Alarik-Signature-256 HMAC-SHA256 header the receiver can verify.
events
array required
One or more event types to subscribe to (see below). At least one is required.
prefix
string
Optional key prefix filter - only objects whose key starts with this value trigger the rule.
suffix
string
Optional key suffix filter - only objects whose key ends with this value trigger the rule.
enabled
boolean required
Whether the rule is active. Disabled rules are stored but never deliver.

Supported event types

EventFires when
s3:ObjectCreated:*Any object creation
s3:ObjectCreated:PutA PutObject
s3:ObjectCreated:CopyA CopyObject
s3:ObjectCreated:CompleteMultipartUploadA multipart upload completes
s3:ObjectRemoved:*Any object removal
s3:ObjectRemoved:DeleteA permanent delete
s3:ObjectRemoved:DeleteMarkerCreatedA delete marker is created (versioned bucket)
s3:LifecycleExpiration:*Any lifecycle expiration
s3:LifecycleExpiration:DeleteA lifecycle rule permanently deletes an object
s3:LifecycleExpiration:DeleteMarkerCreatedA lifecycle rule creates a delete marker

Example

{
    "rules": [
        {
            "id": "00000000-0000-0000-0000-000000000000",
            "url": "https://example.com/webhook",
            "secret": "a-shared-signing-secret",
            "events": ["s3:ObjectCreated:*"],
            "prefix": "uploads/",
            "suffix": ".jpg",
            "enabled": true
        }
    ]
}

Response

Returns the saved rules, each with its server-assigned id:

{
    "rules": [
        {
            "id": "6ff08747-4ec0-48fd-a0b1-f5adda6d3161",
            "url": "https://example.com/webhook",
            "events": ["s3:ObjectCreated:*"],
            "prefix": "uploads/",
            "suffix": ".jpg",
            "enabled": true
        }
    ]
}

Errors

StatusReason
400Missing bucket name, invalid URL, unknown event type, no events, or more than 16 rules
403A non-admin tried to set a private/loopback URL
404Bucket not found (or not owned by you)