Reference
Spotify
Set up Spotify OAuth for music data, playlists, and listening history
Overview
Section titled “Overview”Connect your users to Spotify for music data, playlist management, playback control, and listening history.
| Property | Value |
|---|---|
| Provider ID | spotify |
| Category | Social |
| PKCE | Supported |
| Token refresh | Automatic |
| Redirect URI | Shown in Developer Portal |
Step 1: Create a Spotify OAuth App
Section titled “Step 1: Create a Spotify OAuth App”Go to the Spotify Developer Dashboard
Navigate to developer.spotify.com/dashboard and sign in.
Create a new app
Click Create app, fill in the app name and description, and accept the terms.
Configure the redirect URI
Under Edit settings, add the Alter callback URL from the Developer Portal to the Redirect URIs field.
Get credentials
Copy the Client ID and Client Secret from the app dashboard.
Step 2: Add to Alter Vault
Section titled “Step 2: Add to Alter Vault”Open the Developer Portal
Go to portal.alterauth.com and navigate to the application.
Add Spotify provider
Go to OAuth Providers > Add Provider > Spotify.
Enter credentials
- Client ID: Paste your Spotify Client ID
- Client Secret: Paste your Spotify Client Secret
Select scopes
Choose the scopes the application needs.
Save
Click Save. The provider is now active.
Available Scopes
Section titled “Available Scopes”| Scope | Description |
|---|---|
user-read-email | Read the user’s email address |
user-read-private | Read the user’s subscription details and country |
ugc-image-upload | Upload user-provided images such as custom playlist cover art |
playlist-read-private | View the user’s private playlists |
playlist-read-collaborative | Include collaborative playlists when requesting the user’s playlists |
playlist-modify-public | Create and modify the user’s public playlists |
playlist-modify-private | Create and modify the user’s private playlists |
user-library-read | View the user’s saved tracks, albums, and shows |
user-library-modify | Save and remove tracks, albums, and shows in the user’s library |
user-follow-read | View the artists and users the user follows |
user-follow-modify | Follow and unfollow artists and users |
user-top-read | View the user’s top artists and tracks |
user-read-recently-played | View the user’s recently played tracks |
user-read-playback-position | Read the user’s playback position in podcasts and other content |
user-read-playback-state | Read the user’s currently playing content and Spotify Connect devices |
user-modify-playback-state | Control playback on the user’s Spotify clients and Connect devices |
user-read-currently-playing | Read the user’s currently playing content and queue |
user-personalized | Get personalized content recommendations for the user |
streaming | Control playback via the Web Playback SDK (Premium required) |
- Spotify access tokens expire after 1 hour. Alter Vault handles automatic refresh.
- See the Spotify Web API authorization documentation for more details.
Policy-cataloged operations
Section titled “Policy-cataloged operations”Alter policy rules can target these attested operations and families for operation-level and parameter-aware controls.
| Operation ID | Families | Method | Provider path |
|---|---|---|---|
get-current-users-profile | read | GET | /me |
get-a-list-of-current-users-playlists | read | GET | /me/playlists |
get-playlist | read | GET | /playlists/{playlist_id} |
get-playlists-tracks | read | GET | /playlists/{playlist_id}/tracks |
create-playlist | write | POST | /users/{user_id}/playlists |
change-playlist-details | write | PUT | /playlists/{playlist_id} |
add-tracks-to-playlist | write | POST | /playlists/{playlist_id}/tracks |
remove-tracks-playlist | delete | DELETE | /playlists/{playlist_id}/tracks |
follow-playlist | write | PUT | /playlists/{playlist_id}/followers |
unfollow-playlist | delete | DELETE | /playlists/{playlist_id}/followers |
follow-artists-users | write | PUT | /me/following |
unfollow-artists-users | delete | DELETE | /me/following |
get-followed | read | GET | /me/following |
save-albums-user | write | PUT | /me/albums |
remove-albums-user | delete | DELETE | /me/albums |
get-users-saved-albums | read | GET | /me/albums |
save-tracks-user | write | PUT | /me/tracks |
remove-tracks-user | delete | DELETE | /me/tracks |
get-users-saved-tracks | read | GET | /me/tracks |
search | read | GET | /search |
get-track | read | GET | /tracks/{id} |
get-several-tracks | read | GET | /tracks |
get-recommendations | read | GET | /recommendations |
get-users-top-artists-and-tracks | read | GET | /me/top/{type} |
get-information-about-the-users-current-playback | read | GET | /me/player |
transfer-a-users-playback | write | PUT | /me/player |
start-a-users-playback | write | PUT | /me/player/play |
pause-a-users-playback | write | PUT | /me/player/pause |
add-to-queue | write | POST | /me/player/queue |
get-recently-played | read | GET | /me/player/recently-played |