WorkOS PHP SDK

ApiKey
in package
implements JsonSerializable uses JsonSerializableTrait

Read onlyYes

The API Key object if the value is valid, or `null` if invalid.

Table of Contents

Interfaces

JsonSerializable

Properties

$createdAt  : DateTimeImmutable
An ISO 8601 timestamp.
$id  : string
Unique identifier of the API Key.
$lastUsedAt  : DateTimeImmutable|null
Timestamp of when the API Key was last used.
$name  : string
A descriptive name for the API Key.
$obfuscatedValue  : string
An obfuscated representation of the API Key value.
$object  : string
Distinguishes the API Key object.
$owner  : ApiKeyOwner
The entity that owns the API Key.
$permissions  : array<string|int, string>
The permission slugs assigned to the API Key.
$updatedAt  : DateTimeImmutable
An ISO 8601 timestamp.

Methods

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

Properties

$createdAt

An ISO 8601 timestamp.

public DateTimeImmutable $createdAt

$id

Unique identifier of the API Key.

public string $id

$lastUsedAt

Timestamp of when the API Key was last used.

public DateTimeImmutable|null $lastUsedAt

$name

A descriptive name for the API Key.

public string $name

$obfuscatedValue

An obfuscated representation of the API Key value.

public string $obfuscatedValue

$object

Distinguishes the API Key object.

public string $object

$permissions

The permission slugs assigned to the API Key.

public array<string|int, string> $permissions

$updatedAt

An ISO 8601 timestamp.

public DateTimeImmutable $updatedAt

Methods

__construct()

public __construct(string $object, string $id, ApiKeyOwner $owner, string $name, string $obfuscatedValue, DateTimeImmutable|null $lastUsedAt, array<string|int, mixed> $permissions, DateTimeImmutable $createdAt, DateTimeImmutable $updatedAt) : mixed
Parameters
$object : string
$id : string
$owner : ApiKeyOwner
$name : string
$obfuscatedValue : string
$lastUsedAt : DateTimeImmutable|null
$permissions : array<string|int, mixed>
$createdAt : DateTimeImmutable
$updatedAt : DateTimeImmutable

fromArray()

public static fromArray(array<string|int, mixed> $data) : self
Parameters
$data : array<string|int, mixed>
Return values
self

jsonSerialize()

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

toArray()

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results