WorkOS PHP SDK

CreateOrganizationConnectedAccount
in package
implements JsonSerializable uses JsonSerializableTrait

Read onlyYes

Table of Contents

Interfaces

JsonSerializable

Properties

$accessToken  : string|null
The OAuth access token for the connected account.
$accountDisplayName  : string|null
A mutable, non-unique connection label; null clears it. Not an account identifier.
$accountIdentifier  : string|null
A developer-attested account identifier; null clears it.
$connectionIntent  : string|null
Set to `add` to create another connected account. Omit this field for permanent compatibility behavior.
$expiresAt  : DateTimeImmutable|null
The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
$refreshToken  : string|null
The OAuth refresh token for the connected account.
$scopes  : array<string|int, string>|null
The OAuth scopes granted for this connection.
$state  : PipeConnectedAccountState|null
Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
$userId  : string
The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.

Methods

__construct()  : mixed
fromArray()  : self
jsonSerialize()  : array<string|int, mixed>
toArray()  : array<string|int, mixed>

Properties

$accountDisplayName

A mutable, non-unique connection label; null clears it. Not an account identifier.

public string|null $accountDisplayName = null

$connectionIntent

Set to `add` to create another connected account. Omit this field for permanent compatibility behavior.

public string|null $connectionIntent = null

$expiresAt

The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.

public DateTimeImmutable|null $expiresAt = null

$userId

The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.

public string $userId

Methods

__construct()

public __construct(string $userId[, string|null $accountDisplayName = null ][, string|null $accountIdentifier = null ][, string|null $accessToken = null ][, string|null $refreshToken = null ][, DateTimeImmutable|null $expiresAt = null ][, array<string|int, mixed>|null $scopes = null ][, PipeConnectedAccountState|null $state = null ][, string|null $connectionIntent = null ]) : mixed
Parameters
$userId : string
$accountDisplayName : string|null = null
$accountIdentifier : string|null = null
$accessToken : string|null = null
$refreshToken : string|null = null
$expiresAt : DateTimeImmutable|null = null
$scopes : array<string|int, mixed>|null = null
$state : PipeConnectedAccountState|null = null
$connectionIntent : string|null = null

jsonSerialize()

public jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>
On this page

Search results