Sofa
Account

Create or update integration

POST
/account/integrations

Create a new media server integration or update an existing one. Generates a unique webhook token for the provider.

Authorization

session
cookiebetter-auth.session_token<token>

Better Auth session cookie

Request Body

application/json
  1. body

Create a new media server integration

provider*string

Media server provider to integrate

Value in"plex""jellyfin""emby""sonarr""radarr"
enabled?boolean

Whether the integration starts enabled (default: true)

Response Body

Created or updated integration with token

application/json
  1. response

A media server integration configuration

id*string

Integration ID

provider*string

Provider name (plex, jellyfin, etc.)

type*string

Integration type: webhook (Plex/Jellyfin/Emby) or list (Sonarr/Radarr)

Value in"webhook""list"
token*string

Webhook authentication token

enabled*boolean

Whether the integration is active

lastEventAt*|

Last received event timestamp (ISO 8601)

createdAt*string

When the integration was created (ISO 8601)

curl -X POST "https://example.com/account/integrations" \  -H "Content-Type: application/json" \  -d '{    "provider": "plex"  }'
{  "id": "string",  "provider": "string",  "type": "webhook",  "token": "string",  "enabled": true,  "lastEventAt": "string",  "createdAt": "string"}