Connected Accounts

Update connected account credentials

Updates authentication credentials and configuration for an existing connected account. Modify OAuth tokens, refresh tokens, access scopes, or API configuration settings. Specify the account by ID, or by combination of organization/user, connector, and identifier. Returns the updated account with new token expiry and status information.

put/api/v1/connected_accounts

Request body

connectorstring

Connector identifier (e.g., 'notion', 'slack', 'google'). Alphanumeric characters, spaces, hyphens, underscores, and colons are allowed.

idstring

Unique identifier for the connected account to update

identifierstring

The unique identifier for the connected account within the third-party service (e.g., email address, user ID, workspace identifier).

organization_idstring

Organization ID for the connector

user_idstring

User ID for the connector

Example request

{
  "connected_account": {
    "api_config": {
      "rate_limit": 2000,
      "timeout": 60
    },
    "authorization_details": {
      "google_dwd": {
        "access_token": "ya29.a0AfH6SMBx...",
        "scopes": [
          "openid",
          "https://www.googleapis.com/auth/userinfo.email"
        ],
        "subject": "user@example.com"
      },
      "oauth_token": {
        "access_token": "ya29.a0AfH6SMBx...",
        "domain": "example.com",
        "refresh_token": "1//0gHJxZ-Lb2...",
        "scopes": [
          "https://www.googleapis.com/auth/drive.readonly",
          "https://www.googleapis.com/auth/userinfo.email"
        ]
      },
      "static_auth": {
        "details": {
          "api_key": "sk_live_...",
          "api_secret": "..."
        }
      },
      "trusted_idp": {
        "access_key_id": "ASIA...",
        "db_user": "analytics_reader"
      }
    }
  },
  "connector": "notion",
  "id": "ca_123",
  "identifier": "user@example.com",
  "organization_id": "org_121312434123312",
  "user_id": "user_121312434123312"
}

Response

Connected account updated successfully with new credentials or configuration

Example response

{
  "connected_account": {
    "api_config": {
      "base_url": "https://api.custom-domain.com",
      "rate_limit": 1000,
      "timeout": 30
    },
    "authorization_details": {
      "google_dwd": {
        "access_token": "ya29.a0AfH6SMBx...",
        "scopes": [
          "openid",
          "https://www.googleapis.com/auth/userinfo.email"
        ],
        "subject": "user@example.com"
      },
      "oauth_token": {
        "access_token": "ya29.a0AfH6SMBx...",
        "domain": "example.com",
        "refresh_token": "1//0gHJxZ-Lb2...",
        "scopes": [
          "https://www.googleapis.com/auth/drive.readonly",
          "https://www.googleapis.com/auth/userinfo.email"
        ]
      },
      "static_auth": {
        "details": {
          "api_key": "sk_live_...",
          "api_secret": "..."
        }
      },
      "trusted_idp": {
        "access_key_id": "ASIA...",
        "db_user": "analytics_reader"
      }
    },
    "connection_id": "conn_24834495392086178",
    "connector": "notion",
    "id": "ca_24834495392086178",
    "identifier": "user@example.com",
    "last_used_at": "2024-03-20T14:30:00Z",
    "provider": "google",
    "token_expires_at": "2024-12-31T23:59:59Z",
    "updated_at": "2024-03-20T15:04:05Z"
  }
}

Changes

Changed in 1 of the 8 revisions of this API.1

    • added the new NO_AUTH enum value to the connected_account/authorization_type response property for the response status 200

      response-property-enum-value-added