Spotify WebHooks documentation. This app is still very new, so I'm sure there are some bugs and improvements that need to be made. If you have any questions, please email me at jakewhiteyo@gmail.com
Every webhook we send includes a signature so you can verify it came from us and wasn't tampered with.
The Signature Format
Every webhook includes two headers for verification:
x-webhook-timestamp- The Unix timestamp (seconds since epoch) when the webhook was sentx-webhook-signature- The HMAC-SHA256 signature of the webhook
x-webhook-timestamp: 1704067200
x-webhook-signature: sha256=a1b2c3d4e5f6789...The signature format is: sha256=signature
How to Verify It
Here's the simple process to verify a webhook signature:
- Get the timestamp from the
x-webhook-timestampheader - Get the signature from the
x-webhook-signatureheader - Create a signed payload by concatenating the timestamp and payload:
{timestamp}.{payload} - Create an HMAC-SHA256 hash of the signed payload using your webhook secret
- Compare your hash with the signature in the header
Example Code
// Node.js example - verifying a webhook
const crypto = require('crypto');
function verifyWebhook(payload, timestamp, signature, secret) {
// Extract the signature value (remove 'sha256=' prefix)
const sigValue = signature.replace('sha256=', '');
// Create the signed payload: timestamp + '.' + payload
const signedPayload = `${timestamp}.${payload}`;
// Generate HMAC-SHA256 using your secret
const expectedSig = crypto
.createHmac('sha256', secret)
.update(signedPayload)
.digest('hex');
// Compare signatures (use constant-time comparison in production)
return expectedSig === sigValue;
}
// Usage in your webhook endpoint
app.post('/webhook', (req, res) => {
const timestamp = req.headers['x-webhook-timestamp'];
const signature = req.headers['x-webhook-signature'];
const payload = JSON.stringify(req.body);
if (!timestamp || !signature) {
return res.status(401).send('Missing required headers');
}
if (verifyWebhook(payload, timestamp, signature, process.env.WEBHOOK_SECRET)) {
// Webhook is authentic, process it
console.log('Webhook verified successfully');
res.status(200).send('OK');
} else {
// Webhook is invalid
res.status(401).send('Unauthorized');
}
});Important Notes
- • Always verify signatures before processing webhooks
- • The signature is created from
{timestamp}.{payload}, not just the payload - • Your webhook secret is found in your webhook settings
- • Keep your secret secure and never share it
- • Use constant-time comparison when comparing signatures in production
Understanding the structure and content of webhook payloads sent by our service.
Payload Structure
All webhook payloads follow a consistent JSON structure:
Content-Type: application/jsonEvent Types
We currently support the following event types:
artist_release- When an artist releases new musicepisode_release- When a podcast you follow publishes a new episode
Example Payload: artist_release
{
"content": "**New music released** from MANARËM\n• **Soma Ethër** by MANARËM\n https://open.spotify.com/album/1NdENIXQlh6ZX6ZBBCgrdF\n• **MOVMËNT** by MANARËM\n https://open.spotify.com/album/5NpCujo7sYaHNsR0sbuZOM",
"event": {
"id": "f6b7fc10-8bcb-4092-bc1e-1d01ac9671ee",
"subscriptionId": "cmj6c58wy0002reobx6mmbvs1",
"type": "artist_release"
},
"releases": [
{
"id": "b5a7bf2a-5865-4138-92c3-c9ad204550c6",
"name": "Soma Ethër",
"type": "single",
"spotify_id": "1NdENIXQlh6ZX6ZBBCgrdF",
"href": "https://open.spotify.com/album/1NdENIXQlh6ZX6ZBBCgrdF",
"release_date": "2025-10-30",
"album_type": "single",
"images": [
{
"url": "https://i.scdn.co/image/ab67616d0000b2739b5f419fca0004811db41034",
"height": 640,
"width": 640
},
{
"url": "https://i.scdn.co/image/ab67616d00001e029b5f419fca0004811db41034",
"height": 300,
"width": 300
},
{
"url": "https://i.scdn.co/image/ab67616d000048519b5f419fca0004811db41034",
"height": 64,
"width": 64
}
],
"artists": [
{
"id": "5BQdp2NlYGiwVgnCJB3gyX",
"name": "MANARËM",
"href": "https://open.spotify.com/artist/5BQdp2NlYGiwVgnCJB3gyX"
}
],
"total_tracks": 1
},
{
"id": "c060f85e-fd17-4bb4-9340-0ecb29e72d2f",
"name": "MOVMËNT",
"type": "album",
"spotify_id": "5NpCujo7sYaHNsR0sbuZOM",
"href": "https://open.spotify.com/album/5NpCujo7sYaHNsR0sbuZOM",
"release_date": "2025-12-03",
"album_type": "album",
"images": [
{
"url": "https://i.scdn.co/image/ab67616d0000b27367391d19d1030ad575a129e5",
"height": 640,
"width": 640
},
{
"url": "https://i.scdn.co/image/ab67616d00001e0267391d19d1030ad575a129e5",
"height": 300,
"width": 300
},
{
"url": "https://i.scdn.co/image/ab67616d0000485167391d19d1030ad575a129e5",
"height": 64,
"width": 64
}
],
"artists": [
{
"id": "5BQdp2NlYGiwVgnCJB3gyX",
"name": "MANARËM",
"href": "https://open.spotify.com/artist/5BQdp2NlYGiwVgnCJB3gyX"
}
],
"total_tracks": 13
}
]
}Example Payload: episode_release
Podcast webhooks receive an episodes array instead of releases. Each episode includes its show, and description is truncated to 500 characters.
{
"content": "**New episode** of Huberman Lab\n• **Essentials: Nicotine's Effects on the Brain & Body & How to Quit Smoking or Vaping**\n https://open.spotify.com/episode/6edPzaOiV5CUA2eoUaO6A0",
"event": {
"id": "cmh1x2y3z0000episode0001",
"triggeredAt": "2026-11-20T15:00:12.345Z",
"subscriptionId": "cmh0a1b2c0000subscript01",
"type": "episode_release"
},
"episodes": [
{
"id": "cmh1x2y3z0001episode0002",
"spotify_id": "6edPzaOiV5CUA2eoUaO6A0",
"name": "Essentials: Nicotine's Effects on the Brain & Body & How to Quit Smoking or Vaping",
"href": "https://open.spotify.com/episode/6edPzaOiV5CUA2eoUaO6A0",
"release_date": "2026-11-19",
"duration_ms": 2146752,
"description": "In this Huberman Lab Essentials episode, I explain how nicotine affects the brain and body, including how it increases dopamine, acetylcholine and norepinephrine to boost motivation, focus and alertness.",
"images": [
{
"url": "https://i.scdn.co/image/ab6765630000ba8a0df785e9d7caa5da9ae49fb2",
"height": 640,
"width": 640
}
],
"show": {
"id": "79CkJF3UJTHFV8Dse3Oy0P",
"name": "Huberman Lab",
"publisher": "Scicomm Media",
"href": "https://open.spotify.com/show/79CkJF3UJTHFV8Dse3Oy0P"
}
}
]
}