Class: Sanction
A live Sanction object. Every field from the API response is available directly
on the object (e.g. sanction.type, sanction.reason), and the object also
exposes action methods (update(), revoke(), watch()).
Extends
Constructors
new Sanction()
Internal
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | ClientContext | - |
projectId | string | - |
data | object | - |
data.createdAt | string | Format: date-time Description Creation timestamp |
data.createdByUserId? | string | Description User who created the sanction |
data.endAt? | string | Format: date-time Description When sanction expires (null = permanent) |
data.externalUserId? | string | Description External user ID |
data.id | string | Description Sanction ID |
data.isActive | boolean | Description Whether the sanction is currently active |
data.metadata? | Record<string, never> | Description Additional metadata |
data.participant? | object | Description Participant information (if available) |
data.participant.displayName | string | Description Display name of the participant |
data.participant.externalUserId | string | Description External user ID from ODIN |
data.participant.id | string | Description Participant ID |
data.participant.joinedAt? | string | Format: date-time Description When the participant first joined the project |
data.participant.projectId | string | Description ODIN project ID this participant belongs to |
data.participant.userData? | Record<string, never> | Description User data from ODIN (parsed JSON) |
data.participantId? | string | Description Participant ID (if session-scoped) |
data.reason? | string | Description Reason for sanction |
data.revokedAt? | string | Format: date-time Description When sanction was revoked |
data.revokedByUserId? | string | Description User who revoked the sanction |
data.scope? | Record<string, never> | Description Scope configuration |
data.sessionId? | string | Description Session ID (if session-scoped) |
data.startAt | string | Format: date-time Description When sanction becomes active |
data.status | string | Description Status: active, expired, or revoked |
data.tenantId | string | Description Tenant ID |
data.type | | "warn" | "mute" | "listen_only" | "text_only" | "rate_limit" | "shadow_mute" | "temp_ban" | "perm_ban" | "ranked_restriction" | "queue_delay" | "party_restriction" | "human_review" | Description Type of sanction |
data.updatedAt | string | Format: date-time Description Last update timestamp |
Returns
Inherited from
SanctionResponse.constructor
Defined in
4Players/cortex-typescript-sdk/src/resources/sanctions.ts:174
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
createdAt | string | Format: date-time Description Creation timestamp | SanctionResponse.createdAt | 4Players/cortex-typescript-sdk/src/types.ts:3485 |
createdByUserId? | string | Description User who created the sanction | SanctionResponse.createdByUserId | 4Players/cortex-typescript-sdk/src/types.ts:3480 |
endAt? | string | Format: date-time Description When sanction expires (null = permanent) | SanctionResponse.endAt | 4Players/cortex-typescript-sdk/src/types.ts:3478 |
externalUserId? | string | Description External user ID | SanctionResponse.externalUserId | 4Players/cortex-typescript-sdk/src/types.ts:3455 |
id | string | Description Sanction ID | SanctionResponse.id | 4Players/cortex-typescript-sdk/src/types.ts:3449 |
isActive | boolean | Description Whether the sanction is currently active | SanctionResponse.isActive | 4Players/cortex-typescript-sdk/src/types.ts:3499 |
metadata? | Record<string, never> | Description Additional metadata | SanctionResponse.metadata | 4Players/cortex-typescript-sdk/src/types.ts:3468 |
participant? | object | Description Participant information (if available) | SanctionResponse.participant | 4Players/cortex-typescript-sdk/src/types.ts:3503 |
participant.displayName | string | Description Display name of the participant | - | 4Players/cortex-typescript-sdk/src/types.ts:3436 |
participant.externalUserId | string | Description External user ID from ODIN | - | 4Players/cortex-typescript-sdk/src/types.ts:3438 |
participant.id | string | Description Participant ID | - | 4Players/cortex-typescript-sdk/src/types.ts:3432 |
participant.joinedAt? | string | Format: date-time Description When the participant first joined the project | - | 4Players/cortex-typescript-sdk/src/types.ts:3445 |
participant.projectId | string | Description ODIN project ID this participant belongs to | - | 4Players/cortex-typescript-sdk/src/types.ts:3434 |
participant.userData? | Record<string, never> | Description User data from ODIN (parsed JSON) | - | 4Players/cortex-typescript-sdk/src/types.ts:3440 |
participantId? | string | Description Participant ID (if session-scoped) | SanctionResponse.participantId | 4Players/cortex-typescript-sdk/src/types.ts:3453 |
reason? | string | Description Reason for sanction | SanctionResponse.reason | 4Players/cortex-typescript-sdk/src/types.ts:3466 |
revokedAt? | string | Format: date-time Description When sanction was revoked | SanctionResponse.revokedAt | 4Players/cortex-typescript-sdk/src/types.ts:3495 |
revokedByUserId? | string | Description User who revoked the sanction | SanctionResponse.revokedByUserId | 4Players/cortex-typescript-sdk/src/types.ts:3497 |
scope? | Record<string, never> | Description Scope configuration | SanctionResponse.scope | 4Players/cortex-typescript-sdk/src/types.ts:3464 |
sessionId? | string | Description Session ID (if session-scoped) | SanctionResponse.sessionId | 4Players/cortex-typescript-sdk/src/types.ts:3457 |
startAt | string | Format: date-time Description When sanction becomes active | SanctionResponse.startAt | 4Players/cortex-typescript-sdk/src/types.ts:3473 |
status | string | Description Status: active, expired, or revoked | SanctionResponse.status | 4Players/cortex-typescript-sdk/src/types.ts:3501 |
tenantId | string | Description Tenant ID | SanctionResponse.tenantId | 4Players/cortex-typescript-sdk/src/types.ts:3451 |
type | | "warn" | "mute" | "listen_only" | "text_only" | "rate_limit" | "shadow_mute" | "temp_ban" | "perm_ban" | "ranked_restriction" | "queue_delay" | "party_restriction" | "human_review" | Description Type of sanction | SanctionResponse.type | 4Players/cortex-typescript-sdk/src/types.ts:3462 |
updatedAt | string | Format: date-time Description Last update timestamp | SanctionResponse.updatedAt | 4Players/cortex-typescript-sdk/src/types.ts:3490 |
Accessors
data
The raw API response object.
Deprecated
The response fields are now available directly on this object
(e.g. sanction.type instead of sanction.data.type). This accessor will be
removed before the stable release.
Returns
object
| Name | Type | Description | Defined in |
|---|---|---|---|
createdAt | string | Format: date-time Description Creation timestamp | 4Players/cortex-typescript-sdk/src/types.ts:3485 |
createdByUserId? | string | Description User who created the sanction | 4Players/cortex-typescript-sdk/src/types.ts:3480 |
endAt? | string | Format: date-time Description When sanction expires (null = permanent) | 4Players/cortex-typescript-sdk/src/types.ts:3478 |
externalUserId? | string | Description External user ID | 4Players/cortex-typescript-sdk/src/types.ts:3455 |
id | string | Description Sanction ID | 4Players/cortex-typescript-sdk/src/types.ts:3449 |
isActive | boolean | Description Whether the sanction is currently active | 4Players/cortex-typescript-sdk/src/types.ts:3499 |
metadata? | Record<string, never> | Description Additional metadata | 4Players/cortex-typescript-sdk/src/types.ts:3468 |
participant? | object | Description Participant information (if available) | 4Players/cortex-typescript-sdk/src/types.ts:3503 |
participant.displayName | string | Description Display name of the participant | 4Players/cortex-typescript-sdk/src/types.ts:3436 |
participant.externalUserId | string | Description External user ID from ODIN | 4Players/cortex-typescript-sdk/src/types.ts:3438 |
participant.id | string | Description Participant ID | 4Players/cortex-typescript-sdk/src/types.ts:3432 |
participant.joinedAt? | string | Format: date-time Description When the participant first joined the project | 4Players/cortex-typescript-sdk/src/types.ts:3445 |
participant.projectId | string | Description ODIN project ID this participant belongs to | 4Players/cortex-typescript-sdk/src/types.ts:3434 |
participant.userData? | Record<string, never> | Description User data from ODIN (parsed JSON) | 4Players/cortex-typescript-sdk/src/types.ts:3440 |
participantId? | string | Description Participant ID (if session-scoped) | 4Players/cortex-typescript-sdk/src/types.ts:3453 |
reason? | string | Description Reason for sanction | 4Players/cortex-typescript-sdk/src/types.ts:3466 |
revokedAt? | string | Format: date-time Description When sanction was revoked | 4Players/cortex-typescript-sdk/src/types.ts:3495 |
revokedByUserId? | string | Description User who revoked the sanction | 4Players/cortex-typescript-sdk/src/types.ts:3497 |
scope? | Record<string, never> | Description Scope configuration | 4Players/cortex-typescript-sdk/src/types.ts:3464 |
sessionId? | string | Description Session ID (if session-scoped) | 4Players/cortex-typescript-sdk/src/types.ts:3457 |
startAt | string | Format: date-time Description When sanction becomes active | 4Players/cortex-typescript-sdk/src/types.ts:3473 |
status | string | Description Status: active, expired, or revoked | 4Players/cortex-typescript-sdk/src/types.ts:3501 |
tenantId | string | Description Tenant ID | 4Players/cortex-typescript-sdk/src/types.ts:3451 |
type | | "warn" | "mute" | "listen_only" | "text_only" | "rate_limit" | "shadow_mute" | "temp_ban" | "perm_ban" | "ranked_restriction" | "queue_delay" | "party_restriction" | "human_review" | Description Type of sanction | 4Players/cortex-typescript-sdk/src/types.ts:3462 |
updatedAt | string | Format: date-time Description Last update timestamp | 4Players/cortex-typescript-sdk/src/types.ts:3490 |
Defined in
4Players/cortex-typescript-sdk/src/resources/sanctions.ts:187
Methods
revoke()
Revoke this sanction
Parameters
| Parameter | Type | Description |
|---|---|---|
body | object | Revocation payload (optional reason) |
body.reason? | string | Description Reason for revocation Example False positive from automated detection |
Returns
Promise<object>
Revoked sanction
| Name | Type | Description | Defined in |
|---|---|---|---|
createdAt | string | Format: date-time Description Creation timestamp | 4Players/cortex-typescript-sdk/src/types.ts:3485 |
createdByUserId? | string | Description User who created the sanction | 4Players/cortex-typescript-sdk/src/types.ts:3480 |
endAt? | string | Format: date-time Description When sanction expires (null = permanent) | 4Players/cortex-typescript-sdk/src/types.ts:3478 |
externalUserId? | string | Description External user ID | 4Players/cortex-typescript-sdk/src/types.ts:3455 |
id | string | Description Sanction ID | 4Players/cortex-typescript-sdk/src/types.ts:3449 |
isActive | boolean | Description Whether the sanction is currently active | 4Players/cortex-typescript-sdk/src/types.ts:3499 |
metadata? | Record<string, never> | Description Additional metadata | 4Players/cortex-typescript-sdk/src/types.ts:3468 |
participant? | object | Description Participant information (if available) | 4Players/cortex-typescript-sdk/src/types.ts:3503 |
participant.displayName | string | Description Display name of the participant | 4Players/cortex-typescript-sdk/src/types.ts:3436 |
participant.externalUserId | string | Description External user ID from ODIN | 4Players/cortex-typescript-sdk/src/types.ts:3438 |
participant.id | string | Description Participant ID | 4Players/cortex-typescript-sdk/src/types.ts:3432 |
participant.joinedAt? | string | Format: date-time Description When the participant first joined the project | 4Players/cortex-typescript-sdk/src/types.ts:3445 |
participant.projectId | string | Description ODIN project ID this participant belongs to | 4Players/cortex-typescript-sdk/src/types.ts:3434 |
participant.userData? | Record<string, never> | Description User data from ODIN (parsed JSON) | 4Players/cortex-typescript-sdk/src/types.ts:3440 |
participantId? | string | Description Participant ID (if session-scoped) | 4Players/cortex-typescript-sdk/src/types.ts:3453 |
reason? | string | Description Reason for sanction | 4Players/cortex-typescript-sdk/src/types.ts:3466 |
revokedAt? | string | Format: date-time Description When sanction was revoked | 4Players/cortex-typescript-sdk/src/types.ts:3495 |
revokedByUserId? | string | Description User who revoked the sanction | 4Players/cortex-typescript-sdk/src/types.ts:3497 |
scope? | Record<string, never> | Description Scope configuration | 4Players/cortex-typescript-sdk/src/types.ts:3464 |
sessionId? | string | Description Session ID (if session-scoped) | 4Players/cortex-typescript-sdk/src/types.ts:3457 |
startAt | string | Format: date-time Description When sanction becomes active | 4Players/cortex-typescript-sdk/src/types.ts:3473 |
status | string | Description Status: active, expired, or revoked | 4Players/cortex-typescript-sdk/src/types.ts:3501 |
tenantId | string | Description Tenant ID | 4Players/cortex-typescript-sdk/src/types.ts:3451 |
type | | "warn" | "mute" | "listen_only" | "text_only" | "rate_limit" | "shadow_mute" | "temp_ban" | "perm_ban" | "ranked_restriction" | "queue_delay" | "party_restriction" | "human_review" | Description Type of sanction | 4Players/cortex-typescript-sdk/src/types.ts:3462 |
updatedAt | string | Format: date-time Description Last update timestamp | 4Players/cortex-typescript-sdk/src/types.ts:3490 |
Defined in
4Players/cortex-typescript-sdk/src/resources/sanctions.ts:210
update()
Update this sanction
Parameters
| Parameter | Type | Description |
|---|---|---|
body | object | Updated sanction data |
body.endAt? | string | Description Updated end time |
body.metadata? | Record<string, never> | Description Updated metadata |
body.reason? | string | Description Updated reason |
body.scope? | Record<string, never> | Description Updated scope configuration |
body.type? | | "warn" | "mute" | "listen_only" | "text_only" | "rate_limit" | "shadow_mute" | "temp_ban" | "perm_ban" | "ranked_restriction" | "queue_delay" | "party_restriction" | "human_review" | Description Updated sanction type |
Returns
Promise<object>
Updated sanction
| Name | Type | Description | Defined in |
|---|---|---|---|
createdAt | string | Format: date-time Description Creation timestamp | 4Players/cortex-typescript-sdk/src/types.ts:3485 |
createdByUserId? | string | Description User who created the sanction | 4Players/cortex-typescript-sdk/src/types.ts:3480 |
endAt? | string | Format: date-time Description When sanction expires (null = permanent) | 4Players/cortex-typescript-sdk/src/types.ts:3478 |
externalUserId? | string | Description External user ID | 4Players/cortex-typescript-sdk/src/types.ts:3455 |
id | string | Description Sanction ID | 4Players/cortex-typescript-sdk/src/types.ts:3449 |
isActive | boolean | Description Whether the sanction is currently active | 4Players/cortex-typescript-sdk/src/types.ts:3499 |
metadata? | Record<string, never> | Description Additional metadata | 4Players/cortex-typescript-sdk/src/types.ts:3468 |
participant? | object | Description Participant information (if available) | 4Players/cortex-typescript-sdk/src/types.ts:3503 |
participant.displayName | string | Description Display name of the participant | 4Players/cortex-typescript-sdk/src/types.ts:3436 |
participant.externalUserId | string | Description External user ID from ODIN | 4Players/cortex-typescript-sdk/src/types.ts:3438 |
participant.id | string | Description Participant ID | 4Players/cortex-typescript-sdk/src/types.ts:3432 |
participant.joinedAt? | string | Format: date-time Description When the participant first joined the project | 4Players/cortex-typescript-sdk/src/types.ts:3445 |
participant.projectId | string | Description ODIN project ID this participant belongs to | 4Players/cortex-typescript-sdk/src/types.ts:3434 |
participant.userData? | Record<string, never> | Description User data from ODIN (parsed JSON) | 4Players/cortex-typescript-sdk/src/types.ts:3440 |
participantId? | string | Description Participant ID (if session-scoped) | 4Players/cortex-typescript-sdk/src/types.ts:3453 |
reason? | string | Description Reason for sanction | 4Players/cortex-typescript-sdk/src/types.ts:3466 |
revokedAt? | string | Format: date-time Description When sanction was revoked | 4Players/cortex-typescript-sdk/src/types.ts:3495 |
revokedByUserId? | string | Description User who revoked the sanction | 4Players/cortex-typescript-sdk/src/types.ts:3497 |
scope? | Record<string, never> | Description Scope configuration | 4Players/cortex-typescript-sdk/src/types.ts:3464 |
sessionId? | string | Description Session ID (if session-scoped) | 4Players/cortex-typescript-sdk/src/types.ts:3457 |
startAt | string | Format: date-time Description When sanction becomes active | 4Players/cortex-typescript-sdk/src/types.ts:3473 |
status | string | Description Status: active, expired, or revoked | 4Players/cortex-typescript-sdk/src/types.ts:3501 |
tenantId | string | Description Tenant ID | 4Players/cortex-typescript-sdk/src/types.ts:3451 |
type | | "warn" | "mute" | "listen_only" | "text_only" | "rate_limit" | "shadow_mute" | "temp_ban" | "perm_ban" | "ranked_restriction" | "queue_delay" | "party_restriction" | "human_review" | Description Type of sanction | 4Players/cortex-typescript-sdk/src/types.ts:3462 |
updatedAt | string | Format: date-time Description Last update timestamp | 4Players/cortex-typescript-sdk/src/types.ts:3490 |
Defined in
4Players/cortex-typescript-sdk/src/resources/sanctions.ts:196
watch()
Live-subscribe to this sanction. current reflects status changes including
revocation (the object remains, with status updated).
Returns
DocumentSubscription<object>
A DocumentSubscription for this sanction
| Name | Type | Description | Defined in |
|---|---|---|---|
createdAt | string | Format: date-time Description Creation timestamp | 4Players/cortex-typescript-sdk/src/types.ts:3485 |
createdByUserId? | string | Description User who created the sanction | 4Players/cortex-typescript-sdk/src/types.ts:3480 |
endAt? | string | Format: date-time Description When sanction expires (null = permanent) | 4Players/cortex-typescript-sdk/src/types.ts:3478 |
externalUserId? | string | Description External user ID | 4Players/cortex-typescript-sdk/src/types.ts:3455 |
id | string | Description Sanction ID | 4Players/cortex-typescript-sdk/src/types.ts:3449 |
isActive | boolean | Description Whether the sanction is currently active | 4Players/cortex-typescript-sdk/src/types.ts:3499 |
metadata? | Record<string, never> | Description Additional metadata | 4Players/cortex-typescript-sdk/src/types.ts:3468 |
participant? | object | Description Participant information (if available) | 4Players/cortex-typescript-sdk/src/types.ts:3503 |
participant.displayName | string | Description Display name of the participant | 4Players/cortex-typescript-sdk/src/types.ts:3436 |
participant.externalUserId | string | Description External user ID from ODIN | 4Players/cortex-typescript-sdk/src/types.ts:3438 |
participant.id | string | Description Participant ID | 4Players/cortex-typescript-sdk/src/types.ts:3432 |
participant.joinedAt? | string | Format: date-time Description When the participant first joined the project | 4Players/cortex-typescript-sdk/src/types.ts:3445 |
participant.projectId | string | Description ODIN project ID this participant belongs to | 4Players/cortex-typescript-sdk/src/types.ts:3434 |
participant.userData? | Record<string, never> | Description User data from ODIN (parsed JSON) | 4Players/cortex-typescript-sdk/src/types.ts:3440 |
participantId? | string | Description Participant ID (if session-scoped) | 4Players/cortex-typescript-sdk/src/types.ts:3453 |
reason? | string | Description Reason for sanction | 4Players/cortex-typescript-sdk/src/types.ts:3466 |
revokedAt? | string | Format: date-time Description When sanction was revoked | 4Players/cortex-typescript-sdk/src/types.ts:3495 |
revokedByUserId? | string | Description User who revoked the sanction | 4Players/cortex-typescript-sdk/src/types.ts:3497 |
scope? | Record<string, never> | Description Scope configuration | 4Players/cortex-typescript-sdk/src/types.ts:3464 |
sessionId? | string | Description Session ID (if session-scoped) | 4Players/cortex-typescript-sdk/src/types.ts:3457 |
startAt | string | Format: date-time Description When sanction becomes active | 4Players/cortex-typescript-sdk/src/types.ts:3473 |
status | string | Description Status: active, expired, or revoked | 4Players/cortex-typescript-sdk/src/types.ts:3501 |
tenantId | string | Description Tenant ID | 4Players/cortex-typescript-sdk/src/types.ts:3451 |
type | | "warn" | "mute" | "listen_only" | "text_only" | "rate_limit" | "shadow_mute" | "temp_ban" | "perm_ban" | "ranked_restriction" | "queue_delay" | "party_restriction" | "human_review" | Description Type of sanction | 4Players/cortex-typescript-sdk/src/types.ts:3462 |
updatedAt | string | Format: date-time Description Last update timestamp | 4Players/cortex-typescript-sdk/src/types.ts:3490 |
Defined in
4Players/cortex-typescript-sdk/src/resources/sanctions.ts:224