ConnectedAccount
in package
implements
JsonSerializable
uses
JsonSerializableTrait
Table of Contents
Interfaces
- JsonSerializable
Properties
- $accountDisplayName : string|null
- A mutable, non-unique display name for the provider account connection.
- $accountIdentifier : string|null
- A best-effort identifier for the provider account this connection points at. It is correlation metadata, not the connection identifier or a selector.
- $apiKeyLast4 : string|null
- The last four characters of the API key, or `null` for OAuth connections.
- $authMethod : DataIntegrationAuthMethods|null
- The authentication method used for this connection (`oauth`, `api_key`, or `client_credentials`). Defaults to `oauth` if absent.
- $clientId : string|null
- The client ID supplied for this connection. Only present when `auth_method` is `client_credentials`.
- $clientSecretLast4 : string|null
- The last four characters of the client secret supplied for this connection, or `null` when it can't be read. Only present when `auth_method` is `client_credentials`.
- $config : array<string, string>|null
- The connection-level configuration values stored for this connection — the fields the provider declares at `installation` scope, excluding secret and undeclared fields. Returned for every authentication method; empty when no stored values can be disclosed.
- $connectionRole : ConnectedAccountConnectionRole
- Whether this row is the compatibility connection visible to undeclared clients or a standard peer for plural-aware clients. The role does not indicate preference or creation order.
- $createdAt : string
- The timestamp when the connection was created.
- $establishedByUserId : string|null
- The [User](https://workos.com/docs/reference/authkit/user) whose authorization established this connection. `null` when the connection is developer-managed or its establisher is unknown, and when the establishing member lost access to the organization — in which case `state_reason` is `establishing_member_membership_ended`.
- $id : string
- The unique identifier of the connected account.
- $object : string
- Distinguishes the connected account object.
- $organizationId : string|null
- The [Organization](https://workos.com/docs/reference/organization) identifier associated with this connection, or `null` if not scoped to an organization.
- $scopes : array<string|int, string>
- The OAuth scopes granted for this connection.
- $state : ConnectedAccountState
- The state of the connected account: - `connected`: The connection is active and tokens are valid.
- $stateReason : string|null
- Why WorkOS put the connection in its current `state`, or `null` when there is no WorkOS-recorded reason: - `establishing_member_membership_ended`: The member who established this organization-owned connection is no longer an active member of the organization, so its credentials were cleared. An organization admin must provide new credentials.
- $updatedAt : string
- The timestamp when the connection was last updated.
- $userId : string|null
- The [User](https://workos.com/docs/reference/authkit/user) identifier associated with this connection.
- $warnings : array<string|int, ConnectedAccountWarning>|null
- Non-blocking warnings about an explicitly supplied label. Only writes return it, and only when another connection already uses the label; reads omit it.
Methods
- __construct() : mixed
- fromArray() : self
- jsonSerialize() : array<string|int, mixed>|stdClass
- toArray() : array<string|int, mixed>
Properties
$accountDisplayName
A mutable, non-unique display name for the provider account connection.
public
string|null
$accountDisplayName
$accountIdentifier
A best-effort identifier for the provider account this connection points at. It is correlation metadata, not the connection identifier or a selector.
public
string|null
$accountIdentifier
$apiKeyLast4
The last four characters of the API key, or `null` for OAuth connections.
public
string|null
$apiKeyLast4
= null
$authMethod
The authentication method used for this connection (`oauth`, `api_key`, or `client_credentials`). Defaults to `oauth` if absent.
public
DataIntegrationAuthMethods|null
$authMethod
= null
$clientId
The client ID supplied for this connection. Only present when `auth_method` is `client_credentials`.
public
string|null
$clientId
= null
$clientSecretLast4
The last four characters of the client secret supplied for this connection, or `null` when it can't be read. Only present when `auth_method` is `client_credentials`.
public
string|null
$clientSecretLast4
= null
$config
The connection-level configuration values stored for this connection — the fields the provider declares at `installation` scope, excluding secret and undeclared fields. Returned for every authentication method; empty when no stored values can be disclosed.
public
array<string, string>|null
$config
= null
$connectionRole
Whether this row is the compatibility connection visible to undeclared clients or a standard peer for plural-aware clients. The role does not indicate preference or creation order.
public
ConnectedAccountConnectionRole
$connectionRole
$createdAt
The timestamp when the connection was created.
public
string
$createdAt
$establishedByUserId
The [User](https://workos.com/docs/reference/authkit/user) whose authorization established this connection. `null` when the connection is developer-managed or its establisher is unknown, and when the establishing member lost access to the organization — in which case `state_reason` is `establishing_member_membership_ended`.
public
string|null
$establishedByUserId
= null
$id
The unique identifier of the connected account.
public
string
$id
$object
Distinguishes the connected account object.
public
string
$object
$organizationId
The [Organization](https://workos.com/docs/reference/organization) identifier associated with this connection, or `null` if not scoped to an organization.
public
string|null
$organizationId
$scopes
The OAuth scopes granted for this connection.
public
array<string|int, string>
$scopes
$state
The state of the connected account: - `connected`: The connection is active and tokens are valid.
public
ConnectedAccountState
$state
needs_reauthorization: The user needs to reauthorize the connection, typically because required scopes have changed.state_reasonexplains why when WorkOS invalidated the connection itself.disconnected: The connection has been disconnected.
$stateReason
Why WorkOS put the connection in its current `state`, or `null` when there is no WorkOS-recorded reason: - `establishing_member_membership_ended`: The member who established this organization-owned connection is no longer an active member of the organization, so its credentials were cleared. An organization admin must provide new credentials.
public
string|null
$stateReason
= null
Additional values may be added; treat an unrecognized value as an unknown reason.
$updatedAt
The timestamp when the connection was last updated.
public
string
$updatedAt
$userId
The [User](https://workos.com/docs/reference/authkit/user) identifier associated with this connection.
public
string|null
$userId
$warnings
Non-blocking warnings about an explicitly supplied label. Only writes return it, and only when another connection already uses the label; reads omit it.
public
array<string|int, ConnectedAccountWarning>|null
$warnings
= null
Methods
__construct()
public
__construct(string $object, string $id, ConnectedAccountConnectionRole $connectionRole, string|null $accountIdentifier, string|null $accountDisplayName, string|null $userId, string|null $organizationId, array<string|int, mixed> $scopes, ConnectedAccountState $state, string $createdAt, string $updatedAt[, DataIntegrationAuthMethods|null $authMethod = null ][, string|null $apiKeyLast4 = null ][, string|null $clientId = null ][, string|null $clientSecretLast4 = null ][, array<string|int, mixed>|null $config = null ][, string|null $establishedByUserId = null ][, string|null $stateReason = null ][, array<string|int, mixed>|null $warnings = null ]) : mixed
Parameters
- $object : string
- $id : string
- $connectionRole : ConnectedAccountConnectionRole
- $accountIdentifier : string|null
- $accountDisplayName : string|null
- $userId : string|null
- $organizationId : string|null
- $scopes : array<string|int, mixed>
- $state : ConnectedAccountState
- $createdAt : string
- $updatedAt : string
- $authMethod : DataIntegrationAuthMethods|null = null
- $apiKeyLast4 : string|null = null
- $clientId : string|null = null
- $clientSecretLast4 : string|null = null
- $config : array<string|int, mixed>|null = null
- $establishedByUserId : string|null = null
- $stateReason : string|null = null
- $warnings : array<string|int, mixed>|null = null
fromArray()
public
static fromArray(array<string|int, mixed> $data) : self
Parameters
- $data : array<string|int, mixed>
Return values
selfjsonSerialize()
public
jsonSerialize() : array<string|int, mixed>|stdClass
Return values
array<string|int, mixed>|stdClasstoArray()
public
toArray() : array<string|int, mixed>