WorkOS PHP SDK

CreateUserApiKey
in package
implements JsonSerializable uses JsonSerializableTrait

Read onlyYes

Table of Contents

Interfaces

JsonSerializable

Properties

$expiresAt  : DateTimeImmutable|null
The timestamp when the API key should expire. Must be a future timestamp. If omitted, the key does not expire.
$name  : string
A descriptive name for the API key.
$organizationId  : string
The ID of the organization the user API key is associated with. The user must have an active membership in this organization.
$permissions  : array<string|int, string>|null
The permission slugs to assign to the API key. Each permission must be enabled for user API keys.

Methods

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

Properties

$expiresAt

The timestamp when the API key should expire. Must be a future timestamp. If omitted, the key does not expire.

public DateTimeImmutable|null $expiresAt = null

$organizationId

The ID of the organization the user API key is associated with. The user must have an active membership in this organization.

public string $organizationId

$permissions

The permission slugs to assign to the API key. Each permission must be enabled for user API keys.

public array<string|int, string>|null $permissions = null

Methods

__construct()

public __construct(string $name, string $organizationId[, array<string|int, mixed>|null $permissions = null ][, DateTimeImmutable|null $expiresAt = null ]) : mixed
Parameters
$name : string
$organizationId : string
$permissions : array<string|int, mixed>|null = null
$expiresAt : DateTimeImmutable|null = null

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