Skip to main content

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()

new Sanction(
ctx,
projectId,
data): Sanction

Internal

Parameters

ParameterTypeDescription
ctxClientContext-
projectIdstring-
dataobject-
data.createdAtstringFormat: date-time Description Creation timestamp
data.createdByUserId?stringDescription User who created the sanction
data.endAt?stringFormat: date-time Description When sanction expires (null = permanent)
data.externalUserId?stringDescription External user ID
data.idstringDescription Sanction ID
data.isActivebooleanDescription Whether the sanction is currently active
data.metadata?Record<string, never>Description Additional metadata
data.participant?objectDescription Participant information (if available)
data.participant.displayNamestringDescription Display name of the participant
data.participant.externalUserIdstringDescription External user ID from ODIN
data.participant.idstringDescription Participant ID
data.participant.joinedAt?stringFormat: date-time Description When the participant first joined the project
data.participant.projectIdstringDescription ODIN project ID this participant belongs to
data.participant.userData?Record<string, never>Description User data from ODIN (parsed JSON)
data.participantId?stringDescription Participant ID (if session-scoped)
data.reason?stringDescription Reason for sanction
data.revokedAt?stringFormat: date-time Description When sanction was revoked
data.revokedByUserId?stringDescription User who revoked the sanction
data.scope?Record<string, never>Description Scope configuration
data.sessionId?stringDescription Session ID (if session-scoped)
data.startAtstringFormat: date-time Description When sanction becomes active
data.statusstringDescription Status: active, expired, or revoked
data.tenantIdstringDescription 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.updatedAtstringFormat: date-time Description Last update timestamp

Returns

Sanction

Inherited from

SanctionResponse.constructor

Defined in

4Players/cortex-typescript-sdk/src/resources/sanctions.ts:174

Properties

PropertyTypeDescriptionInherited fromDefined in
createdAtstringFormat: date-time Description Creation timestampSanctionResponse.createdAt4Players/cortex-typescript-sdk/src/types.ts:3485
createdByUserId?stringDescription User who created the sanctionSanctionResponse.createdByUserId4Players/cortex-typescript-sdk/src/types.ts:3480
endAt?stringFormat: date-time Description When sanction expires (null = permanent)SanctionResponse.endAt4Players/cortex-typescript-sdk/src/types.ts:3478
externalUserId?stringDescription External user IDSanctionResponse.externalUserId4Players/cortex-typescript-sdk/src/types.ts:3455
idstringDescription Sanction IDSanctionResponse.id4Players/cortex-typescript-sdk/src/types.ts:3449
isActivebooleanDescription Whether the sanction is currently activeSanctionResponse.isActive4Players/cortex-typescript-sdk/src/types.ts:3499
metadata?Record<string, never>Description Additional metadataSanctionResponse.metadata4Players/cortex-typescript-sdk/src/types.ts:3468
participant?objectDescription Participant information (if available)SanctionResponse.participant4Players/cortex-typescript-sdk/src/types.ts:3503
participant.displayNamestringDescription Display name of the participant-4Players/cortex-typescript-sdk/src/types.ts:3436
participant.externalUserIdstringDescription External user ID from ODIN-4Players/cortex-typescript-sdk/src/types.ts:3438
participant.idstringDescription Participant ID-4Players/cortex-typescript-sdk/src/types.ts:3432
participant.joinedAt?stringFormat: date-time Description When the participant first joined the project-4Players/cortex-typescript-sdk/src/types.ts:3445
participant.projectIdstringDescription 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?stringDescription Participant ID (if session-scoped)SanctionResponse.participantId4Players/cortex-typescript-sdk/src/types.ts:3453
reason?stringDescription Reason for sanctionSanctionResponse.reason4Players/cortex-typescript-sdk/src/types.ts:3466
revokedAt?stringFormat: date-time Description When sanction was revokedSanctionResponse.revokedAt4Players/cortex-typescript-sdk/src/types.ts:3495
revokedByUserId?stringDescription User who revoked the sanctionSanctionResponse.revokedByUserId4Players/cortex-typescript-sdk/src/types.ts:3497
scope?Record<string, never>Description Scope configurationSanctionResponse.scope4Players/cortex-typescript-sdk/src/types.ts:3464
sessionId?stringDescription Session ID (if session-scoped)SanctionResponse.sessionId4Players/cortex-typescript-sdk/src/types.ts:3457
startAtstringFormat: date-time Description When sanction becomes activeSanctionResponse.startAt4Players/cortex-typescript-sdk/src/types.ts:3473
statusstringDescription Status: active, expired, or revokedSanctionResponse.status4Players/cortex-typescript-sdk/src/types.ts:3501
tenantIdstringDescription Tenant IDSanctionResponse.tenantId4Players/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 sanctionSanctionResponse.type4Players/cortex-typescript-sdk/src/types.ts:3462
updatedAtstringFormat: date-time Description Last update timestampSanctionResponse.updatedAt4Players/cortex-typescript-sdk/src/types.ts:3490

Accessors

data

get data(): object

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

NameTypeDescriptionDefined in
createdAtstringFormat: date-time Description Creation timestamp4Players/cortex-typescript-sdk/src/types.ts:3485
createdByUserId?stringDescription User who created the sanction4Players/cortex-typescript-sdk/src/types.ts:3480
endAt?stringFormat: date-time Description When sanction expires (null = permanent)4Players/cortex-typescript-sdk/src/types.ts:3478
externalUserId?stringDescription External user ID4Players/cortex-typescript-sdk/src/types.ts:3455
idstringDescription Sanction ID4Players/cortex-typescript-sdk/src/types.ts:3449
isActivebooleanDescription Whether the sanction is currently active4Players/cortex-typescript-sdk/src/types.ts:3499
metadata?Record<string, never>Description Additional metadata4Players/cortex-typescript-sdk/src/types.ts:3468
participant?objectDescription Participant information (if available)4Players/cortex-typescript-sdk/src/types.ts:3503
participant.displayNamestringDescription Display name of the participant4Players/cortex-typescript-sdk/src/types.ts:3436
participant.externalUserIdstringDescription External user ID from ODIN4Players/cortex-typescript-sdk/src/types.ts:3438
participant.idstringDescription Participant ID4Players/cortex-typescript-sdk/src/types.ts:3432
participant.joinedAt?stringFormat: date-time Description When the participant first joined the project4Players/cortex-typescript-sdk/src/types.ts:3445
participant.projectIdstringDescription ODIN project ID this participant belongs to4Players/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?stringDescription Participant ID (if session-scoped)4Players/cortex-typescript-sdk/src/types.ts:3453
reason?stringDescription Reason for sanction4Players/cortex-typescript-sdk/src/types.ts:3466
revokedAt?stringFormat: date-time Description When sanction was revoked4Players/cortex-typescript-sdk/src/types.ts:3495
revokedByUserId?stringDescription User who revoked the sanction4Players/cortex-typescript-sdk/src/types.ts:3497
scope?Record<string, never>Description Scope configuration4Players/cortex-typescript-sdk/src/types.ts:3464
sessionId?stringDescription Session ID (if session-scoped)4Players/cortex-typescript-sdk/src/types.ts:3457
startAtstringFormat: date-time Description When sanction becomes active4Players/cortex-typescript-sdk/src/types.ts:3473
statusstringDescription Status: active, expired, or revoked4Players/cortex-typescript-sdk/src/types.ts:3501
tenantIdstringDescription Tenant ID4Players/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 sanction4Players/cortex-typescript-sdk/src/types.ts:3462
updatedAtstringFormat: date-time Description Last update timestamp4Players/cortex-typescript-sdk/src/types.ts:3490

Defined in

4Players/cortex-typescript-sdk/src/resources/sanctions.ts:187

Methods

revoke()

revoke(body): Promise<object>

Revoke this sanction

Parameters

ParameterTypeDescription
bodyobjectRevocation payload (optional reason)
body.reason?stringDescription Reason for revocation Example False positive from automated detection

Returns

Promise<object>

Revoked sanction

NameTypeDescriptionDefined in
createdAtstringFormat: date-time Description Creation timestamp4Players/cortex-typescript-sdk/src/types.ts:3485
createdByUserId?stringDescription User who created the sanction4Players/cortex-typescript-sdk/src/types.ts:3480
endAt?stringFormat: date-time Description When sanction expires (null = permanent)4Players/cortex-typescript-sdk/src/types.ts:3478
externalUserId?stringDescription External user ID4Players/cortex-typescript-sdk/src/types.ts:3455
idstringDescription Sanction ID4Players/cortex-typescript-sdk/src/types.ts:3449
isActivebooleanDescription Whether the sanction is currently active4Players/cortex-typescript-sdk/src/types.ts:3499
metadata?Record<string, never>Description Additional metadata4Players/cortex-typescript-sdk/src/types.ts:3468
participant?objectDescription Participant information (if available)4Players/cortex-typescript-sdk/src/types.ts:3503
participant.displayNamestringDescription Display name of the participant4Players/cortex-typescript-sdk/src/types.ts:3436
participant.externalUserIdstringDescription External user ID from ODIN4Players/cortex-typescript-sdk/src/types.ts:3438
participant.idstringDescription Participant ID4Players/cortex-typescript-sdk/src/types.ts:3432
participant.joinedAt?stringFormat: date-time Description When the participant first joined the project4Players/cortex-typescript-sdk/src/types.ts:3445
participant.projectIdstringDescription ODIN project ID this participant belongs to4Players/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?stringDescription Participant ID (if session-scoped)4Players/cortex-typescript-sdk/src/types.ts:3453
reason?stringDescription Reason for sanction4Players/cortex-typescript-sdk/src/types.ts:3466
revokedAt?stringFormat: date-time Description When sanction was revoked4Players/cortex-typescript-sdk/src/types.ts:3495
revokedByUserId?stringDescription User who revoked the sanction4Players/cortex-typescript-sdk/src/types.ts:3497
scope?Record<string, never>Description Scope configuration4Players/cortex-typescript-sdk/src/types.ts:3464
sessionId?stringDescription Session ID (if session-scoped)4Players/cortex-typescript-sdk/src/types.ts:3457
startAtstringFormat: date-time Description When sanction becomes active4Players/cortex-typescript-sdk/src/types.ts:3473
statusstringDescription Status: active, expired, or revoked4Players/cortex-typescript-sdk/src/types.ts:3501
tenantIdstringDescription Tenant ID4Players/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 sanction4Players/cortex-typescript-sdk/src/types.ts:3462
updatedAtstringFormat: date-time Description Last update timestamp4Players/cortex-typescript-sdk/src/types.ts:3490

Defined in

4Players/cortex-typescript-sdk/src/resources/sanctions.ts:210


update()

update(body): Promise<object>

Update this sanction

Parameters

ParameterTypeDescription
bodyobjectUpdated sanction data
body.endAt?stringDescription Updated end time
body.metadata?Record<string, never>Description Updated metadata
body.reason?stringDescription 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

NameTypeDescriptionDefined in
createdAtstringFormat: date-time Description Creation timestamp4Players/cortex-typescript-sdk/src/types.ts:3485
createdByUserId?stringDescription User who created the sanction4Players/cortex-typescript-sdk/src/types.ts:3480
endAt?stringFormat: date-time Description When sanction expires (null = permanent)4Players/cortex-typescript-sdk/src/types.ts:3478
externalUserId?stringDescription External user ID4Players/cortex-typescript-sdk/src/types.ts:3455
idstringDescription Sanction ID4Players/cortex-typescript-sdk/src/types.ts:3449
isActivebooleanDescription Whether the sanction is currently active4Players/cortex-typescript-sdk/src/types.ts:3499
metadata?Record<string, never>Description Additional metadata4Players/cortex-typescript-sdk/src/types.ts:3468
participant?objectDescription Participant information (if available)4Players/cortex-typescript-sdk/src/types.ts:3503
participant.displayNamestringDescription Display name of the participant4Players/cortex-typescript-sdk/src/types.ts:3436
participant.externalUserIdstringDescription External user ID from ODIN4Players/cortex-typescript-sdk/src/types.ts:3438
participant.idstringDescription Participant ID4Players/cortex-typescript-sdk/src/types.ts:3432
participant.joinedAt?stringFormat: date-time Description When the participant first joined the project4Players/cortex-typescript-sdk/src/types.ts:3445
participant.projectIdstringDescription ODIN project ID this participant belongs to4Players/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?stringDescription Participant ID (if session-scoped)4Players/cortex-typescript-sdk/src/types.ts:3453
reason?stringDescription Reason for sanction4Players/cortex-typescript-sdk/src/types.ts:3466
revokedAt?stringFormat: date-time Description When sanction was revoked4Players/cortex-typescript-sdk/src/types.ts:3495
revokedByUserId?stringDescription User who revoked the sanction4Players/cortex-typescript-sdk/src/types.ts:3497
scope?Record<string, never>Description Scope configuration4Players/cortex-typescript-sdk/src/types.ts:3464
sessionId?stringDescription Session ID (if session-scoped)4Players/cortex-typescript-sdk/src/types.ts:3457
startAtstringFormat: date-time Description When sanction becomes active4Players/cortex-typescript-sdk/src/types.ts:3473
statusstringDescription Status: active, expired, or revoked4Players/cortex-typescript-sdk/src/types.ts:3501
tenantIdstringDescription Tenant ID4Players/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 sanction4Players/cortex-typescript-sdk/src/types.ts:3462
updatedAtstringFormat: date-time Description Last update timestamp4Players/cortex-typescript-sdk/src/types.ts:3490

Defined in

4Players/cortex-typescript-sdk/src/resources/sanctions.ts:196


watch()

watch(): DocumentSubscription<object>

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

NameTypeDescriptionDefined in
createdAtstringFormat: date-time Description Creation timestamp4Players/cortex-typescript-sdk/src/types.ts:3485
createdByUserId?stringDescription User who created the sanction4Players/cortex-typescript-sdk/src/types.ts:3480
endAt?stringFormat: date-time Description When sanction expires (null = permanent)4Players/cortex-typescript-sdk/src/types.ts:3478
externalUserId?stringDescription External user ID4Players/cortex-typescript-sdk/src/types.ts:3455
idstringDescription Sanction ID4Players/cortex-typescript-sdk/src/types.ts:3449
isActivebooleanDescription Whether the sanction is currently active4Players/cortex-typescript-sdk/src/types.ts:3499
metadata?Record<string, never>Description Additional metadata4Players/cortex-typescript-sdk/src/types.ts:3468
participant?objectDescription Participant information (if available)4Players/cortex-typescript-sdk/src/types.ts:3503
participant.displayNamestringDescription Display name of the participant4Players/cortex-typescript-sdk/src/types.ts:3436
participant.externalUserIdstringDescription External user ID from ODIN4Players/cortex-typescript-sdk/src/types.ts:3438
participant.idstringDescription Participant ID4Players/cortex-typescript-sdk/src/types.ts:3432
participant.joinedAt?stringFormat: date-time Description When the participant first joined the project4Players/cortex-typescript-sdk/src/types.ts:3445
participant.projectIdstringDescription ODIN project ID this participant belongs to4Players/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?stringDescription Participant ID (if session-scoped)4Players/cortex-typescript-sdk/src/types.ts:3453
reason?stringDescription Reason for sanction4Players/cortex-typescript-sdk/src/types.ts:3466
revokedAt?stringFormat: date-time Description When sanction was revoked4Players/cortex-typescript-sdk/src/types.ts:3495
revokedByUserId?stringDescription User who revoked the sanction4Players/cortex-typescript-sdk/src/types.ts:3497
scope?Record<string, never>Description Scope configuration4Players/cortex-typescript-sdk/src/types.ts:3464
sessionId?stringDescription Session ID (if session-scoped)4Players/cortex-typescript-sdk/src/types.ts:3457
startAtstringFormat: date-time Description When sanction becomes active4Players/cortex-typescript-sdk/src/types.ts:3473
statusstringDescription Status: active, expired, or revoked4Players/cortex-typescript-sdk/src/types.ts:3501
tenantIdstringDescription Tenant ID4Players/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 sanction4Players/cortex-typescript-sdk/src/types.ts:3462
updatedAtstringFormat: date-time Description Last update timestamp4Players/cortex-typescript-sdk/src/types.ts:3490

Defined in

4Players/cortex-typescript-sdk/src/resources/sanctions.ts:224