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.
Generates 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 @- <<'BODY' | |
| { | |
| "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT" | |
| } | |
| BODY |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const { url } = await workos.pipes.authorizeDataIntegration({ | |
| slug: 'github', | |
| userId: 'user_01EHZNVPK3SFK441A1RGBFSHRT', | |
| }); |
| # workos:manual - preserve required legacy parameters until oagen supports optional-intent unions | |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.pipes.authorize_data_integration( | |
| slug: "github", | |
| user_id: "user_01EHZNVPK3SFK441A1RGBFSHRT" | |
| ) |
| # workos:manual - preserve required legacy parameters until oagen supports optional-intent unions | |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.pipes.authorize_data_integration( | |
| slug="github", user_id="user_01EHZNVPK3SFK441A1RGBFSHRT" | |
| ) |
| // workos:manual - preserve required legacy parameters until oagen supports optional-intent unions | |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v10" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Pipes().AuthorizeDataIntegration(context.Background(), "github", &workos.PipesAuthorizeDataIntegrationParams{ | |
| UserID: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| }) | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| // workos:manual - preserve required legacy parameters until oagen supports optional-intent unions | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->pipes() | |
| ->authorizeDataIntegration( | |
| slug: "github", | |
| userId: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| ); |
| // workos:manual - preserve required legacy parameters until oagen supports | |
| // optional-intent unions | |
| import com.workos.WorkOS; | |
| import com.workos.pipes.PipesApi.AuthorizeDataIntegrationOptions; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| AuthorizeDataIntegrationOptions options = AuthorizeDataIntegrationOptions.builder() | |
| .userId("user_01EHZNVPK3SFK441A1RGBFSHRT") | |
| .build(); | |
| workos.pipes.authorizeDataIntegration("github", options); |
| // workos:manual - preserve required legacy parameters until oagen supports optional-intent unions | |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Pipes.AuthorizeDataIntegrationAsync("github", new PipesAuthorizeDataIntegrationOptions { | |
| UserId = "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| }); |
| // workos:manual - preserve required legacy parameters until oagen supports optional-intent unions | |
| use workos::Client; | |
| use workos::pipes::AuthorizeDataIntegrationParams; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .pipes() | |
| .authorize_data_integration( | |
| "github", | |
| AuthorizeDataIntegrationParams { | |
| user_id: "user_01EHZNVPK3SFK441A1RGBFSHRT".into(), | |
| ..Default::default() | |
| } | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "url": "https://api.workos.com/data-integrations/q2czJKmVAraSBg8xFpT7M9uR/authorize-redirect" | |
| } |
POST/data-integrations /:slug /authorize
Parameters
Returns
Imports a connected account for a user by directly providing OAuth tokens. This is useful for migrating existing connections from another system.
The state field is derived from the token combination when not explicitly set. If no tokens are provided, the state defaults to needs_reauthorization.
| curl --request POST \ | |
| --url "https://api.workos.com/user_management/users/user_01EHZNVPK3SFK441A1RGBFSHRT/connected_accounts/github" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.pipes.create_user_connected_account( | |
| user_id: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| slug: "github" | |
| ) |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.pipes.create_user_connected_account( | |
| user_id="user_01EHZNVPK3SFK441A1RGBFSHRT", slug="github" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v10" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Pipes().CreateUserConnectedAccount(context.Background(), "user_01EHZNVPK3SFK441A1RGBFSHRT", "github") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->pipes() | |
| ->createUserConnectedAccount( | |
| userId: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| slug: "github", | |
| ); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.pipes.createUserConnectedAccount("user_01EHZNVPK3SFK441A1RGBFSHRT", "github"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Pipes.CreateUserConnectedAccountAsync("user_01EHZNVPK3SFK441A1RGBFSHRT", "github"); |
| use workos::Client; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .pipes() | |
| .create_user_connected_account( | |
| "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "github" | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "connected_account", | |
| "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "connection_role": "compatibility", | |
| "account_identifier": "workspace_123", | |
| "account_display_name": "Acme production", | |
| "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "organization_id": null, | |
| "scopes": [ | |
| "repo", | |
| "user:email" | |
| ], | |
| "auth_method": "oauth", | |
| "api_key_last_4": null, | |
| "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", | |
| "client_secret_last_4": "cdef", | |
| "config": { | |
| "instance_url": "https://example.my.salesforce.com" | |
| }, | |
| "state": "connected", | |
| "established_by_user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "state_reason": null, | |
| "created_at": "2024-01-16T14:20:00.000Z", | |
| "updated_at": "2024-01-16T14:20:00.000Z", | |
| "warnings": [ | |
| { | |
| "code": "duplicate_account_display_name", | |
| "message": "Another connection for this provider and owner has the same label." | |
| } | |
| ] | |
| } |
POST/user_management /users /:user_id /connected_accounts /:slug
Parameters
Returns
Token combinations are validated on create. Invalid combinations – such as providing only expires_at without an access_token – will return a 422 error. See the token validation rules below.
When creating a connected account, the following token combination rules apply:
- No tokens provided →
stateis set toneeds_reauthorization. access_tokenwithexpires_atandrefresh_token→ valid,stateisconnected.access_tokenonly (noexpires_at) → valid,stateisconnected.access_tokenwithexpires_atbut norefresh_token→ rejected (422).refresh_tokenonly (noaccess_token) → valid,expires_atis set to now.expires_atonly (noaccess_token) → rejected (422).
- 409 Conflict: A connected account already exists for this user, integration, and organization.
- 422: Invalid token combination or the data integration is not in a valid state.
Retrieves a user’s connected account for a specific provider.
| curl "https://api.workos.com/user_management/users/user_01EHZNVPK3SFK441A1RGBFSHRT/connected_accounts/github" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const connectedAccount = await workos.pipes.getUserConnectedAccount({ | |
| userId: 'user_01EHZNVPK3SFK441A1RGBFSHRT', | |
| slug: 'github', | |
| }); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.pipes.get_user_connected_account( | |
| user_id: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| slug: "github" | |
| ) |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.pipes.get_user_connected_account( | |
| user_id="user_01EHZNVPK3SFK441A1RGBFSHRT", slug="github" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v10" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Pipes().GetUserConnectedAccount(context.Background(), "user_01EHZNVPK3SFK441A1RGBFSHRT", "github") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->pipes() | |
| ->getUserConnectedAccount( | |
| userId: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| slug: "github", | |
| ); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.pipes.getUserConnectedAccount("user_01EHZNVPK3SFK441A1RGBFSHRT", "github"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Pipes.GetUserConnectedAccountAsync("user_01EHZNVPK3SFK441A1RGBFSHRT", "github"); |
| use workos::Client; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .pipes() | |
| .get_user_connected_account( | |
| "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "github" | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "connected_account", | |
| "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "connection_role": "compatibility", | |
| "account_identifier": "workspace_123", | |
| "account_display_name": "Acme production", | |
| "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "organization_id": null, | |
| "scopes": [ | |
| "repo", | |
| "user:email" | |
| ], | |
| "auth_method": "oauth", | |
| "api_key_last_4": null, | |
| "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", | |
| "client_secret_last_4": "cdef", | |
| "config": { | |
| "instance_url": "https://example.my.salesforce.com" | |
| }, | |
| "state": "connected", | |
| "established_by_user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "state_reason": null, | |
| "created_at": "2024-01-16T14:20:00.000Z", | |
| "updated_at": "2024-01-16T14:20:00.000Z" | |
| } |
GET/user_management /users /:user_id /connected_accounts /:slug
Parameters
Returns
Updates a user’s connected account tokens, scopes, or state for a specific provider.
| curl --request PUT \ | |
| --url "https://api.workos.com/user_management/users/user_01EHZNVPK3SFK441A1RGBFSHRT/connected_accounts/github" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ | |
| --header "Content-Type: application/json" \ | |
| -d @- <<'BODY' | |
| { | |
| "account_display_name": "Acme production", | |
| "account_identifier": "workspace_123", | |
| "access_token": "gho_16C7e42F292c6912E7710c838347Ae178B4a", | |
| "refresh_token": "ghr_xxxxxxxxxxxxxxxxxxxx", | |
| "expires_at": "2025-12-31T23:59:59.000Z", | |
| "scopes": [ | |
| "repo", | |
| "user:email" | |
| ], | |
| "state": "connected" | |
| } | |
| BODY |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.pipes.update_user_connected_account( | |
| user_id: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| slug: "github" | |
| ) |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.pipes.update_user_connected_account( | |
| user_id="user_01EHZNVPK3SFK441A1RGBFSHRT", slug="github" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v10" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Pipes().UpdateUserConnectedAccount(context.Background(), "user_01EHZNVPK3SFK441A1RGBFSHRT", "github") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->pipes() | |
| ->updateUserConnectedAccount( | |
| userId: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| slug: "github", | |
| ); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.pipes.updateUserConnectedAccount("user_01EHZNVPK3SFK441A1RGBFSHRT", "github"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Pipes.UpdateUserConnectedAccountAsync("user_01EHZNVPK3SFK441A1RGBFSHRT", "github"); |
| use workos::Client; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .pipes() | |
| .update_user_connected_account( | |
| "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "github" | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "connected_account", | |
| "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "connection_role": "compatibility", | |
| "account_identifier": "workspace_123", | |
| "account_display_name": "Acme production", | |
| "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "organization_id": null, | |
| "scopes": [ | |
| "repo", | |
| "user:email" | |
| ], | |
| "auth_method": "oauth", | |
| "api_key_last_4": null, | |
| "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", | |
| "client_secret_last_4": "cdef", | |
| "config": { | |
| "instance_url": "https://example.my.salesforce.com" | |
| }, | |
| "state": "connected", | |
| "established_by_user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "state_reason": null, | |
| "created_at": "2024-01-16T14:20:00.000Z", | |
| "updated_at": "2024-01-16T14:20:00.000Z", | |
| "warnings": [ | |
| { | |
| "code": "duplicate_account_display_name", | |
| "message": "Another connection for this provider and owner has the same label." | |
| } | |
| ] | |
| } |
PUT/user_management /users /:user_id /connected_accounts /:slug
Parameters
Returns
Unlike the create endpoint, update does not validate token combinations. The provided values are applied directly, so callers are responsible for maintaining valid token and state combinations. For example, setting state to connected without providing valid tokens will leave the connected account in an inconsistent state.
- 404 Not Found: No connected account exists for the given user and slug.
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" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| await workos.pipes.deleteUserConnectedAccount({ | |
| userId: 'user_01EHZNVPK3SFK441A1RGBFSHRT', | |
| slug: 'github', | |
| }); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.pipes.delete_user_connected_account( | |
| user_id: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| slug: "github" | |
| ) |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.pipes.delete_user_connected_account( | |
| user_id="user_01EHZNVPK3SFK441A1RGBFSHRT", slug="github" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v10" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Pipes().DeleteUserConnectedAccount(context.Background(), "user_01EHZNVPK3SFK441A1RGBFSHRT", "github") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->pipes() | |
| ->deleteUserConnectedAccount( | |
| userId: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| slug: "github", | |
| ); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.pipes.deleteUserConnectedAccount("user_01EHZNVPK3SFK441A1RGBFSHRT", "github"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Pipes.DeleteUserConnectedAccountAsync("user_01EHZNVPK3SFK441A1RGBFSHRT", "github"); |
| use workos::Client; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .pipes() | |
| .delete_user_connected_account( | |
| "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "github" | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
DELETE/user_management /users /:user_id /connected_accounts /:slug
Parameters
Returns
Creates or updates an API-key-based installation for the specified integration, owned by the user or, when connection_owner is organization, shared by the organization. If an installation already exists, the stored API key is rotated to the new value. To create another connection, use POST.
| curl --request PUT \ | |
| --url "https://api.workos.com/data-integrations/github/api-key" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ | |
| --header "Content-Type: application/json" \ | |
| -d @- <<'BODY' | |
| { | |
| "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "secret": "sk-1234567890abcdef" | |
| } | |
| BODY |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| await workos.pipes.updateDataIntegrationApiKey({ | |
| slug: 'github', | |
| userId: 'user_01EHZNVPK3SFK441A1RGBFSHRT', | |
| secret: 'sk-1234567890abcdef', | |
| }); |
| # workos:manual - preserve required legacy parameters until oagen supports optional-intent unions | |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.pipes.update_data_integration_api_key( | |
| slug: "github", | |
| user_id: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| secret: "sk-1234567890abcdef" | |
| ) |
| # workos:manual - preserve required legacy parameters until oagen supports optional-intent unions | |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.pipes.update_data_integration_api_key( | |
| slug="github", | |
| user_id="user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| secret="sk-1234567890abcdef", | |
| ) |
| // workos:manual - preserve required legacy parameters until oagen supports optional-intent unions | |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v10" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Pipes().UpdateDataIntegrationAPIKey(context.Background(), "github", &workos.PipesUpdateDataIntegrationAPIKeyParams{ | |
| UserID: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| Secret: "sk-1234567890abcdef", | |
| }) | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| // workos:manual - preserve required legacy parameters until oagen supports optional-intent unions | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->pipes() | |
| ->updateDataIntegrationApiKey( | |
| slug: "github", | |
| userId: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| secret: "sk-1234567890abcdef", | |
| ); |
| // workos:manual - preserve required legacy parameters until oagen supports | |
| // optional-intent unions | |
| import com.workos.WorkOS; | |
| import com.workos.pipes.PipesApi.UpdateDataIntegrationApiKeyOptions; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| UpdateDataIntegrationApiKeyOptions options = | |
| UpdateDataIntegrationApiKeyOptions.builder() | |
| .userId("user_01EHZNVPK3SFK441A1RGBFSHRT") | |
| .secret("sk-1234567890abcdef") | |
| .build(); | |
| workos.pipes.updateDataIntegrationApiKey("github", options); |
| // workos:manual - preserve required legacy parameters until oagen supports optional-intent unions | |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Pipes.UpdateDataIntegrationApiKeyAsync("github", new PipesUpdateDataIntegrationApiKeyOptions { | |
| UserId = "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| Secret = "sk-1234567890abcdef", | |
| }); |
| // workos:manual - preserve required legacy parameters until oagen supports optional-intent unions | |
| use workos::Client; | |
| use workos::pipes::UpdateDataIntegrationApiKeyParams; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .pipes() | |
| .update_data_integration_api_key( | |
| "github", | |
| UpdateDataIntegrationApiKeyParams { | |
| user_id: "user_01EHZNVPK3SFK441A1RGBFSHRT".into(), | |
| secret: "sk-1234567890abcdef".into(), | |
| ..Default::default() | |
| } | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "connected_account", | |
| "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "connection_role": "compatibility", | |
| "account_identifier": "workspace_123", | |
| "account_display_name": "Acme production", | |
| "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "scopes": [], | |
| "auth_method": "api_key", | |
| "api_key_last_4": "cdef", | |
| "state": "connected", | |
| "created_at": "2024-01-16T14:20:00.000Z", | |
| "updated_at": "2024-01-16T14:20:00.000Z" | |
| } |
PUT/data-integrations /:slug /api-key
Parameters
Returns
Creates or updates a client-credentials-based installation for the specified integration, owned by the user or, when connection_owner is organization, shared by the organization. If an installation already exists, the stored client credentials are rotated to the new values. To create another connection, use POST.
| curl --request PUT \ | |
| --url "https://api.workos.com/data-integrations/salesforce/client-credentials" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ | |
| --header "Content-Type: application/json" \ | |
| -d @- <<'BODY' | |
| { | |
| "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "client_id": "3MVG9...", | |
| "client_secret": "shhh-secret" | |
| } | |
| BODY |
| # workos:manual - preserve required legacy parameters until oagen supports optional-intent unions | |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.pipes.update_data_integration_client_credentials( | |
| slug: "salesforce", | |
| user_id: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| client_id: "3MVG9...", | |
| client_secret: "shhh-secret" | |
| ) |
| # workos:manual - preserve required legacy parameters until oagen supports optional-intent unions | |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.pipes.update_data_integration_client_credentials( | |
| slug="salesforce", | |
| user_id="user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| client_id="3MVG9...", | |
| client_secret="shhh-secret", | |
| ) |
| // workos:manual - preserve required legacy parameters until oagen supports optional-intent unions | |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v10" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Pipes().UpdateDataIntegrationClientCredentials(context.Background(), "salesforce", &workos.PipesUpdateDataIntegrationClientCredentialsParams{ | |
| UserID: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| ClientID: "3MVG9...", | |
| ClientSecret: "shhh-secret", | |
| }) | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| // workos:manual - preserve required legacy parameters until oagen supports optional-intent unions | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->pipes() | |
| ->updateDataIntegrationClientCredentials( | |
| slug: "salesforce", | |
| userId: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| clientId: "3MVG9...", | |
| clientSecret: "shhh-secret", | |
| ); |
| // workos:manual - preserve required legacy parameters until oagen supports | |
| // optional-intent unions | |
| import com.workos.WorkOS; | |
| import com.workos.pipes.PipesApi.UpdateDataIntegrationClientCredentialsOptions; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| UpdateDataIntegrationClientCredentialsOptions options = | |
| UpdateDataIntegrationClientCredentialsOptions.builder() | |
| .userId("user_01EHZNVPK3SFK441A1RGBFSHRT") | |
| .clientId("3MVG9...") | |
| .clientSecret("shhh-secret") | |
| .build(); | |
| workos.pipes.updateDataIntegrationClientCredentials("salesforce", options); |
| // workos:manual - preserve required legacy parameters until oagen supports optional-intent unions | |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Pipes.UpdateDataIntegrationClientCredentialsAsync("salesforce", | |
| new PipesUpdateDataIntegrationClientCredentialsOptions { | |
| UserId = "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| ClientId = "3MVG9...", | |
| ClientSecret = "shhh-secret", | |
| }); |
| // workos:manual - preserve required legacy parameters until oagen supports optional-intent unions | |
| use workos::Client; | |
| use workos::pipes::UpdateDataIntegrationClientCredentialsParams; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .pipes() | |
| .update_data_integration_client_credentials( | |
| "salesforce", | |
| UpdateDataIntegrationClientCredentialsParams { | |
| user_id: "user_01EHZNVPK3SFK441A1RGBFSHRT".into(), | |
| client_id: "3MVG9...".into(), | |
| client_secret: "shhh-secret".into(), | |
| ..Default::default() | |
| } | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "connected_account", | |
| "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "connection_role": "compatibility", | |
| "account_identifier": "workspace_123", | |
| "account_display_name": "Acme production", | |
| "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "scopes": [], | |
| "auth_method": "client_credentials", | |
| "state": "connected", | |
| "created_at": "2024-01-16T14:20:00.000Z", | |
| "updated_at": "2024-01-16T14:20:00.000Z" | |
| } |
PUT/data-integrations /:slug /client-credentials
Parameters
Returns
Retrieves an organization’s connected account for a specific provider.
| curl "https://api.workos.com/organizations/org_01EHZNVPK3SFK441A1RGBFSHRT/connected_accounts/github" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.organizations_data_providers.get_organization_connected_account( | |
| organization_id: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| slug: "github" | |
| ) |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.organizations_data_providers.get_organization_connected_account( | |
| organization_id="org_01EHZNVPK3SFK441A1RGBFSHRT", slug="github" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v10" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.OrganizationsDataProviders().GetConnectedAccount(context.Background(), "org_01EHZNVPK3SFK441A1RGBFSHRT", "github") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->organizationsDataProviders() | |
| ->getOrganizationConnectedAccount( | |
| organizationId: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| slug: "github", | |
| ); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.organizationsDataProviders.getOrganizationConnectedAccount( | |
| "org_01EHZNVPK3SFK441A1RGBFSHRT", "github"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.OrganizationsDataProviders.GetConnectedAccountAsync("org_01EHZNVPK3SFK441A1RGBFSHRT", "github"); |
| use workos::Client; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .organizations_data_providers() | |
| .get_organization_connected_account( | |
| "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "github" | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "connected_account", | |
| "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "user_id": null, | |
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "connection_role": "compatibility", | |
| "account_identifier": "workspace_123", | |
| "account_display_name": "Acme production", | |
| "scopes": [ | |
| "repo", | |
| "user:email" | |
| ], | |
| "auth_method": "oauth", | |
| "api_key_last_4": null, | |
| "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", | |
| "client_secret_last_4": "cdef", | |
| "config": { | |
| "instance_url": "https://example.my.salesforce.com" | |
| }, | |
| "state": "connected", | |
| "established_by_user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "state_reason": null, | |
| "created_at": "2024-01-16T14:20:00.000Z", | |
| "updated_at": "2024-01-16T14:20:00.000Z" | |
| } |
GET/organizations /:organization_id /connected_accounts /:slug
Parameters
Returns
Imports an organization-owned connected account by providing OAuth tokens directly. Omit connection_intent to create only the compatibility connection, or set it to add to explicitly create another connection. This creation-only endpoint does not accept connected_account_id or reauthorization intent.
| curl --request POST \ | |
| --url "https://api.workos.com/organizations/org_01EHZNVPK3SFK441A1RGBFSHRT/connected_accounts/github" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ | |
| --header "Content-Type: application/json" \ | |
| -d @- <<'BODY' | |
| { | |
| "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT" | |
| } | |
| BODY |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.organizations_data_providers.create_organization_connected_account( | |
| organization_id: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| slug: "github", | |
| user_id: "user_01EHZNVPK3SFK441A1RGBFSHRT" | |
| ) |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.organizations_data_providers.create_organization_connected_account( | |
| organization_id="org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| slug="github", | |
| user_id="user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v10" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.OrganizationsDataProviders().CreateConnectedAccount(context.Background(), "org_01EHZNVPK3SFK441A1RGBFSHRT", "github", &workos.OrganizationsDataProvidersCreateConnectedAccountParams{ | |
| UserID: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| }) | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->organizationsDataProviders() | |
| ->createOrganizationConnectedAccount( | |
| organizationId: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| slug: "github", | |
| userId: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| ); |
| import com.workos.WorkOS; | |
| import com.workos.organizationsdataproviders.OrganizationsDataProvidersApi.CreateOrganizationConnectedAccountOptions; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| CreateOrganizationConnectedAccountOptions options = | |
| CreateOrganizationConnectedAccountOptions.builder() | |
| .userId("user_01EHZNVPK3SFK441A1RGBFSHRT") | |
| .build(); | |
| workos.organizationsDataProviders.createOrganizationConnectedAccount( | |
| "org_01EHZNVPK3SFK441A1RGBFSHRT", "github", options); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.OrganizationsDataProviders.CreateConnectedAccountAsync( | |
| "org_01EHZNVPK3SFK441A1RGBFSHRT", "github", | |
| new OrganizationsDataProvidersCreateConnectedAccountOptions { | |
| UserId = "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| }); |
| use workos::Client; | |
| use workos::organizations_data_providers::CreateOrganizationConnectedAccountParams; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .organizations_data_providers() | |
| .create_organization_connected_account( | |
| "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "github", | |
| CreateOrganizationConnectedAccountParams { | |
| user_id: "user_01EHZNVPK3SFK441A1RGBFSHRT".into(), | |
| ..Default::default() | |
| } | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "connected_account", | |
| "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "user_id": null, | |
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "connection_role": "compatibility", | |
| "account_identifier": "workspace_123", | |
| "account_display_name": "Acme production", | |
| "scopes": [ | |
| "repo", | |
| "user:email" | |
| ], | |
| "auth_method": "oauth", | |
| "api_key_last_4": null, | |
| "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", | |
| "client_secret_last_4": "cdef", | |
| "config": { | |
| "instance_url": "https://example.my.salesforce.com" | |
| }, | |
| "state": "connected", | |
| "established_by_user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "state_reason": null, | |
| "created_at": "2024-01-16T14:20:00.000Z", | |
| "updated_at": "2024-01-16T14:20:00.000Z" | |
| } |
POST/organizations /:organization_id /connected_accounts /:slug
Parameters
Returns
Updates an organization’s connected account tokens, scopes, or state for a specific provider.
| curl --request PUT \ | |
| --url "https://api.workos.com/organizations/org_01EHZNVPK3SFK441A1RGBFSHRT/connected_accounts/github" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ | |
| --header "Content-Type: application/json" \ | |
| -d @- <<'BODY' | |
| { | |
| "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT" | |
| } | |
| BODY |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.organizations_data_providers.update_organization_connected_account( | |
| organization_id: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| slug: "github", | |
| user_id: "user_01EHZNVPK3SFK441A1RGBFSHRT" | |
| ) |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.organizations_data_providers.update_organization_connected_account( | |
| organization_id="org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| slug="github", | |
| user_id="user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v10" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.OrganizationsDataProviders().UpdateConnectedAccount(context.Background(), "org_01EHZNVPK3SFK441A1RGBFSHRT", "github", &workos.OrganizationsDataProvidersUpdateConnectedAccountParams{ | |
| UserID: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| }) | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->organizationsDataProviders() | |
| ->updateOrganizationConnectedAccount( | |
| organizationId: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| slug: "github", | |
| userId: "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| ); |
| import com.workos.WorkOS; | |
| import com.workos.organizationsdataproviders.OrganizationsDataProvidersApi.UpdateOrganizationConnectedAccountOptions; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| UpdateOrganizationConnectedAccountOptions options = | |
| UpdateOrganizationConnectedAccountOptions.builder() | |
| .userId("user_01EHZNVPK3SFK441A1RGBFSHRT") | |
| .build(); | |
| workos.organizationsDataProviders.updateOrganizationConnectedAccount( | |
| "org_01EHZNVPK3SFK441A1RGBFSHRT", "github", options); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.OrganizationsDataProviders.UpdateConnectedAccountAsync( | |
| "org_01EHZNVPK3SFK441A1RGBFSHRT", "github", | |
| new OrganizationsDataProvidersUpdateConnectedAccountOptions { | |
| UserId = "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| }); |
| use workos::Client; | |
| use workos::organizations_data_providers::UpdateOrganizationConnectedAccountParams; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .organizations_data_providers() | |
| .update_organization_connected_account( | |
| "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "github", | |
| UpdateOrganizationConnectedAccountParams { | |
| user_id: "user_01EHZNVPK3SFK441A1RGBFSHRT".into(), | |
| ..Default::default() | |
| } | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "connected_account", | |
| "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "user_id": null, | |
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "connection_role": "compatibility", | |
| "account_identifier": "workspace_123", | |
| "account_display_name": "Acme production", | |
| "scopes": [ | |
| "repo", | |
| "user:email" | |
| ], | |
| "auth_method": "oauth", | |
| "api_key_last_4": null, | |
| "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", | |
| "client_secret_last_4": "cdef", | |
| "config": { | |
| "instance_url": "https://example.my.salesforce.com" | |
| }, | |
| "state": "connected", | |
| "established_by_user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "state_reason": null, | |
| "created_at": "2024-01-16T14:20:00.000Z", | |
| "updated_at": "2024-01-16T14:20:00.000Z" | |
| } |
PUT/organizations /:organization_id /connected_accounts /:slug
Parameters
Returns
Disconnects the organization’s account for the provider, including removing any stored access and refresh tokens. A member will need to reauthorize if the organization wants to reconnect. This does not revoke access on the provider side.
| curl --request DELETE \ | |
| --url "https://api.workos.com/organizations/org_01EHZNVPK3SFK441A1RGBFSHRT/connected_accounts/github" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.organizations_data_providers.delete_organization_connected_account( | |
| organization_id: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| slug: "github" | |
| ) |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.organizations_data_providers.delete_organization_connected_account( | |
| organization_id="org_01EHZNVPK3SFK441A1RGBFSHRT", slug="github" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v10" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.OrganizationsDataProviders().DeleteConnectedAccount(context.Background(), "org_01EHZNVPK3SFK441A1RGBFSHRT", "github") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->organizationsDataProviders() | |
| ->deleteOrganizationConnectedAccount( | |
| organizationId: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| slug: "github", | |
| ); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.organizationsDataProviders.deleteOrganizationConnectedAccount( | |
| "org_01EHZNVPK3SFK441A1RGBFSHRT", "github"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.OrganizationsDataProviders.DeleteConnectedAccountAsync("org_01EHZNVPK3SFK441A1RGBFSHRT", "github"); |
| use workos::Client; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .organizations_data_providers() | |
| .delete_organization_connected_account( | |
| "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "github" | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
DELETE/organizations /:organization_id /connected_accounts /:slug
Parameters
Returns
Retrieves the organization-owned providers configured for your environment and the organization’s connected account information for each. Providers owned by individual users are not included.
| curl "https://api.workos.com/organizations/org_01EHZNVPK3SFK441A1RGBFSHRT/data_providers" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.organizations_data_providers.list_organization_data_providers(organization_id: "org_01EHZNVPK3SFK441A1RGBFSHRT") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.organizations_data_providers.list_organization_data_providers( | |
| organization_id="org_01EHZNVPK3SFK441A1RGBFSHRT" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v10" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.OrganizationsDataProviders().List(context.Background(), "org_01EHZNVPK3SFK441A1RGBFSHRT") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->organizationsDataProviders() | |
| ->listOrganizationDataProviders( | |
| organizationId: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| ); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.organizationsDataProviders.listOrganizationDataProviders( | |
| "org_01EHZNVPK3SFK441A1RGBFSHRT"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.OrganizationsDataProviders.ListAsync("org_01EHZNVPK3SFK441A1RGBFSHRT"); |
| use workos::Client; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .organizations_data_providers() | |
| .list_organization_data_providers("org_01EHZNVPK3SFK441A1RGBFSHRT") | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "list", | |
| "data": [ | |
| { | |
| "object": "data_provider", | |
| "id": "data_integration_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "name": "GitHub", | |
| "description": "Connect your GitHub account to access repositories.", | |
| "slug": "github", | |
| "integration_type": "github", | |
| "credentials_type": "oauth2", | |
| "scopes": [ | |
| "repo", | |
| "user:email" | |
| ], | |
| "auth_methods": [ | |
| "oauth" | |
| ], | |
| "connection_owner": "organization", | |
| "ownership": "organization", | |
| "created_at": "2024-01-15T10:30:00.000Z", | |
| "updated_at": "2024-01-15T10:30:00.000Z", | |
| "integrationType": "github", | |
| "credentialsType": "oauth2", | |
| "createdAt": "2024-01-15T10:30:00.000Z", | |
| "updatedAt": "2024-01-15T10:30:00.000Z", | |
| "connected_account": { | |
| "object": "connected_account", | |
| "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "user_id": null, | |
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "connection_role": "compatibility", | |
| "account_identifier": "workspace_123", | |
| "account_display_name": "Acme production", | |
| "scopes": [ | |
| "repo", | |
| "user:email" | |
| ], | |
| "auth_method": "oauth", | |
| "api_key_last_4": null, | |
| "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", | |
| "client_secret_last_4": "cdef", | |
| "config": { | |
| "instance_url": "https://example.my.salesforce.com" | |
| }, | |
| "state": "connected", | |
| "established_by_user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "state_reason": null, | |
| "created_at": "2024-01-16T14:20:00.000Z", | |
| "updated_at": "2024-01-16T14:20:00.000Z", | |
| "userlandUserId": null, | |
| "organizationId": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "createdAt": "2024-01-16T14:20:00.000Z", | |
| "updatedAt": "2024-01-16T14:20:00.000Z" | |
| }, | |
| "connected_accounts": [ | |
| { | |
| "object": "connected_account", | |
| "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "user_id": null, | |
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "connection_role": "compatibility", | |
| "account_identifier": "workspace_123", | |
| "account_display_name": "Acme production", | |
| "scopes": [ | |
| "repo", | |
| "user:email" | |
| ], | |
| "auth_method": "oauth", | |
| "api_key_last_4": null, | |
| "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", | |
| "client_secret_last_4": "cdef", | |
| "config": { | |
| "instance_url": "https://example.my.salesforce.com" | |
| }, | |
| "state": "connected", | |
| "established_by_user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "state_reason": null, | |
| "created_at": "2024-01-16T14:20:00.000Z", | |
| "updated_at": "2024-01-16T14:20:00.000Z", | |
| "userlandUserId": null, | |
| "organizationId": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "createdAt": "2024-01-16T14:20:00.000Z", | |
| "updatedAt": "2024-01-16T14:20:00.000Z" | |
| } | |
| ] | |
| } | |
| ] | |
| } |
GET/organizations /:organization_id /data_providers
Parameters
Returns
Creates another API key-based connected account for the specified integration, owned by the user or, when connection_owner is organization, shared by the organization. Requires connection_intent: add and does not accept connected_account_id; use PUT to create or rotate the compatibility connection or to update an exact connection. Creating an additional connection is not yet available: until it is, this endpoint succeeds only when the owner has no connection for this integration, which creates the compatibility connection, and otherwise returns 404 multiple_connections_unavailable.
| curl --request POST \ | |
| --url "https://api.workos.com/data-integrations/github/api-key" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ | |
| --header "Content-Type: application/json" \ | |
| -d @- <<'BODY' | |
| { | |
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "account_identifier": "workspace_123", | |
| "account_display_name": "Acme production", | |
| "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "secret": "sk-1234567890abcdef", | |
| "connection_intent": "add" | |
| } | |
| BODY |
| { | |
| "object": "connected_account", | |
| "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "connection_role": "standard", | |
| "account_identifier": "workspace_123", | |
| "account_display_name": "Acme production", | |
| "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "scopes": [], | |
| "auth_method": "api_key", | |
| "api_key_last_4": "cdef", | |
| "state": "connected", | |
| "created_at": "2024-01-16T14:20:00.000Z", | |
| "updated_at": "2024-01-16T14:20:00.000Z" | |
| } |
POST/data-integrations /:slug /api-key
Parameters
Returns
Creates another client credentials-based connected account for the specified integration, owned by the user or, when connection_owner is organization, shared by the organization. Requires connection_intent: add and does not accept connected_account_id; use PUT to create or rotate the compatibility connection or to update an exact connection. Creating an additional connection is not yet available: until it is, this endpoint succeeds only when the owner has no connection for this integration, which creates the compatibility connection, and otherwise returns 404 multiple_connections_unavailable.
| curl --request POST \ | |
| --url "https://api.workos.com/data-integrations/salesforce/client-credentials" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ | |
| --header "Content-Type: application/json" \ | |
| -d @- <<'BODY' | |
| { | |
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "account_identifier": "workspace_123", | |
| "account_display_name": "Acme production", | |
| "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "client_id": "3MVG9...", | |
| "client_secret": "shhh-secret", | |
| "connection_intent": "add" | |
| } | |
| BODY |
| { | |
| "object": "connected_account", | |
| "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "connection_role": "standard", | |
| "account_identifier": "workspace_123", | |
| "account_display_name": "Acme production", | |
| "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "scopes": [], | |
| "auth_method": "client_credentials", | |
| "state": "connected", | |
| "created_at": "2024-01-16T14:20:00.000Z", | |
| "updated_at": "2024-01-16T14:20:00.000Z" | |
| } |
POST