A connected account represents a user’s authorized connection to a third-party provider through Pipes. Connected accounts store the OAuth credentials and scopes granted during the authorization flow.
When listing providers for a user, each provider includes a nested connected_account showing the user’s connection status.
{ "object": "connected_account", "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", "organization_id": null, "scopes": ["repo", "user:email"], "state": "connected", "created_at": "2024-01-16T14:20:00.000Z", "updated_at": "2024-01-16T14:20:00.000Z" }
connected_accountGenerates an OAuth authorization URL to initiate the connection flow for a user. Redirect the user to the returned URL to begin the OAuth flow with the third-party provider.
curl --request POST \ --url https://api.workos.com/data-integrations/github/authorize \ --header "Authorization: Bearer sk_example_123456789" \ --header "Content-Type: application/json" \ -d '{"user_id":"user_01EHZNVPK3SFK441A1RGBFSHRT"}'
POST/data-integrations /:slug /authorizeParameters Returns objectRetrieves a user’s connected account for a specific provider.
curl --request GET \ --url "https://api.workos.com/user_management/users/user_01EHZNVPK3SFK441A1RGBFSHRT/connected_accounts/github" \ --header "Authorization: Bearer sk_example_123456789"
GET/user_management /users /:user_id /connected_accounts /:slugParameters Returns Disconnects WorkOS’s account for the user, including removing any stored access and refresh tokens. The user will need to reauthorize if they want to reconnect.
This does not revoke access on the provider side. The user may need to disconnect the application directly from the provider’s settings.
Returns a 204 No Content response on success.
curl --request DELETE \ --url "https://api.workos.com/user_management/users/user_01EHZNVPK3SFK441A1RGBFSHRT/connected_accounts/github" \ --header "Authorization: Bearer sk_example_123456789"
DELETE/user_management /users /:user_id /connected_accounts /:slugParameters Returns