Skip to main content

Get Preferences

Retrieve preferences for a specific domain.
domain
string
required
Domain to fetch (e.g., music_preferences, food_profile)
curl -X GET "https://api.prefid.dev/v1/preferences/music_preferences" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Get All Preferences

Retrieve all preferences across all domains.
curl -X GET "https://api.prefid.dev/v1/preferences" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Get Preference Atoms

Retrieve individual preference atoms.
domain
string
Filter by domain
limit
number
default:"20"
Number of atoms to return
offset
number
default:"0"
Offset for pagination
curl -X GET "https://api.prefid.dev/v1/preferences/atoms?domain=music_preferences&limit=10" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Update Preferences

Add or update preferences (requires preferences:write scope).
curl -X POST "https://api.prefid.dev/v1/preferences/music_preferences" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "preferences": {
      "favorite_artists": ["AR Rahman", "Coldplay"],
      "genres": ["Indian Classical", "Electronic"]
    }
  }'

Suppress Atom

Mark a preference atom as incorrect (user correction).
curl -X POST "https://api.prefid.dev/v1/preferences/suppress" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "atom_id": "atom_abc123",
    "reason": "not_accurate"
  }'

Export Preferences

Export all user preferences as JSON.
curl -X GET "https://api.prefid.dev/v1/preferences/export" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"