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?objectDescription 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?objectDescription 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?objectDescription 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:3086
createdByUserId?stringDescription User who created the sanctionSanctionResponse.createdByUserId4Players/cortex-typescript-sdk/src/types.ts:3081
endAt?stringFormat: date-time Description When sanction expires (null = permanent)SanctionResponse.endAt4Players/cortex-typescript-sdk/src/types.ts:3079
externalUserId?stringDescription External user IDSanctionResponse.externalUserId4Players/cortex-typescript-sdk/src/types.ts:3052
idstringDescription Sanction IDSanctionResponse.id4Players/cortex-typescript-sdk/src/types.ts:3046
isActivebooleanDescription Whether the sanction is currently activeSanctionResponse.isActive4Players/cortex-typescript-sdk/src/types.ts:3100
metadata?objectDescription Additional metadataSanctionResponse.metadata4Players/cortex-typescript-sdk/src/types.ts:3067
participant?objectDescription Participant information (if available)SanctionResponse.participant4Players/cortex-typescript-sdk/src/types.ts:3104
participant.displayNamestringDescription Display name of the participant-4Players/cortex-typescript-sdk/src/types.ts:3031
participant.externalUserIdstringDescription External user ID from ODIN-4Players/cortex-typescript-sdk/src/types.ts:3033
participant.idstringDescription Participant ID-4Players/cortex-typescript-sdk/src/types.ts:3027
participant.joinedAt?stringFormat: date-time Description When the participant first joined the project-4Players/cortex-typescript-sdk/src/types.ts:3042
participant.projectIdstringDescription ODIN project ID this participant belongs to-4Players/cortex-typescript-sdk/src/types.ts:3029
participant.userData?objectDescription User data from ODIN (parsed JSON)-4Players/cortex-typescript-sdk/src/types.ts:3035
participantId?stringDescription Participant ID (if session-scoped)SanctionResponse.participantId4Players/cortex-typescript-sdk/src/types.ts:3050
reason?stringDescription Reason for sanctionSanctionResponse.reason4Players/cortex-typescript-sdk/src/types.ts:3065
revokedAt?stringFormat: date-time Description When sanction was revokedSanctionResponse.revokedAt4Players/cortex-typescript-sdk/src/types.ts:3096
revokedByUserId?stringDescription User who revoked the sanctionSanctionResponse.revokedByUserId4Players/cortex-typescript-sdk/src/types.ts:3098
scope?objectDescription Scope configurationSanctionResponse.scope4Players/cortex-typescript-sdk/src/types.ts:3061
sessionId?stringDescription Session ID (if session-scoped)SanctionResponse.sessionId4Players/cortex-typescript-sdk/src/types.ts:3054
startAtstringFormat: date-time Description When sanction becomes activeSanctionResponse.startAt4Players/cortex-typescript-sdk/src/types.ts:3074
statusstringDescription Status: active, expired, or revokedSanctionResponse.status4Players/cortex-typescript-sdk/src/types.ts:3102
tenantIdstringDescription Tenant IDSanctionResponse.tenantId4Players/cortex-typescript-sdk/src/types.ts:3048
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:3059
updatedAtstringFormat: date-time Description Last update timestampSanctionResponse.updatedAt4Players/cortex-typescript-sdk/src/types.ts:3091

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:3086
createdByUserId?stringDescription User who created the sanction4Players/cortex-typescript-sdk/src/types.ts:3081
endAt?stringFormat: date-time Description When sanction expires (null = permanent)4Players/cortex-typescript-sdk/src/types.ts:3079
externalUserId?stringDescription External user ID4Players/cortex-typescript-sdk/src/types.ts:3052
idstringDescription Sanction ID4Players/cortex-typescript-sdk/src/types.ts:3046
isActivebooleanDescription Whether the sanction is currently active4Players/cortex-typescript-sdk/src/types.ts:3100
metadata?objectDescription Additional metadata4Players/cortex-typescript-sdk/src/types.ts:3067
participant?objectDescription Participant information (if available)4Players/cortex-typescript-sdk/src/types.ts:3104
participant.displayNamestringDescription Display name of the participant4Players/cortex-typescript-sdk/src/types.ts:3031
participant.externalUserIdstringDescription External user ID from ODIN4Players/cortex-typescript-sdk/src/types.ts:3033
participant.idstringDescription Participant ID4Players/cortex-typescript-sdk/src/types.ts:3027
participant.joinedAt?stringFormat: date-time Description When the participant first joined the project4Players/cortex-typescript-sdk/src/types.ts:3042
participant.projectIdstringDescription ODIN project ID this participant belongs to4Players/cortex-typescript-sdk/src/types.ts:3029
participant.userData?objectDescription User data from ODIN (parsed JSON)4Players/cortex-typescript-sdk/src/types.ts:3035
participantId?stringDescription Participant ID (if session-scoped)4Players/cortex-typescript-sdk/src/types.ts:3050
reason?stringDescription Reason for sanction4Players/cortex-typescript-sdk/src/types.ts:3065
revokedAt?stringFormat: date-time Description When sanction was revoked4Players/cortex-typescript-sdk/src/types.ts:3096
revokedByUserId?stringDescription User who revoked the sanction4Players/cortex-typescript-sdk/src/types.ts:3098
scope?objectDescription Scope configuration4Players/cortex-typescript-sdk/src/types.ts:3061
sessionId?stringDescription Session ID (if session-scoped)4Players/cortex-typescript-sdk/src/types.ts:3054
startAtstringFormat: date-time Description When sanction becomes active4Players/cortex-typescript-sdk/src/types.ts:3074
statusstringDescription Status: active, expired, or revoked4Players/cortex-typescript-sdk/src/types.ts:3102
tenantIdstringDescription Tenant ID4Players/cortex-typescript-sdk/src/types.ts:3048
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:3059
updatedAtstringFormat: date-time Description Last update timestamp4Players/cortex-typescript-sdk/src/types.ts:3091

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:3086
createdByUserId?stringDescription User who created the sanction4Players/cortex-typescript-sdk/src/types.ts:3081
endAt?stringFormat: date-time Description When sanction expires (null = permanent)4Players/cortex-typescript-sdk/src/types.ts:3079
externalUserId?stringDescription External user ID4Players/cortex-typescript-sdk/src/types.ts:3052
idstringDescription Sanction ID4Players/cortex-typescript-sdk/src/types.ts:3046
isActivebooleanDescription Whether the sanction is currently active4Players/cortex-typescript-sdk/src/types.ts:3100
metadata?objectDescription Additional metadata4Players/cortex-typescript-sdk/src/types.ts:3067
participant?objectDescription Participant information (if available)4Players/cortex-typescript-sdk/src/types.ts:3104
participant.displayNamestringDescription Display name of the participant4Players/cortex-typescript-sdk/src/types.ts:3031
participant.externalUserIdstringDescription External user ID from ODIN4Players/cortex-typescript-sdk/src/types.ts:3033
participant.idstringDescription Participant ID4Players/cortex-typescript-sdk/src/types.ts:3027
participant.joinedAt?stringFormat: date-time Description When the participant first joined the project4Players/cortex-typescript-sdk/src/types.ts:3042
participant.projectIdstringDescription ODIN project ID this participant belongs to4Players/cortex-typescript-sdk/src/types.ts:3029
participant.userData?objectDescription User data from ODIN (parsed JSON)4Players/cortex-typescript-sdk/src/types.ts:3035
participantId?stringDescription Participant ID (if session-scoped)4Players/cortex-typescript-sdk/src/types.ts:3050
reason?stringDescription Reason for sanction4Players/cortex-typescript-sdk/src/types.ts:3065
revokedAt?stringFormat: date-time Description When sanction was revoked4Players/cortex-typescript-sdk/src/types.ts:3096
revokedByUserId?stringDescription User who revoked the sanction4Players/cortex-typescript-sdk/src/types.ts:3098
scope?objectDescription Scope configuration4Players/cortex-typescript-sdk/src/types.ts:3061
sessionId?stringDescription Session ID (if session-scoped)4Players/cortex-typescript-sdk/src/types.ts:3054
startAtstringFormat: date-time Description When sanction becomes active4Players/cortex-typescript-sdk/src/types.ts:3074
statusstringDescription Status: active, expired, or revoked4Players/cortex-typescript-sdk/src/types.ts:3102
tenantIdstringDescription Tenant ID4Players/cortex-typescript-sdk/src/types.ts:3048
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:3059
updatedAtstringFormat: date-time Description Last update timestamp4Players/cortex-typescript-sdk/src/types.ts:3091

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?objectDescription Updated metadata
body.reason?stringDescription Updated reason
body.scope?objectDescription 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:3086
createdByUserId?stringDescription User who created the sanction4Players/cortex-typescript-sdk/src/types.ts:3081
endAt?stringFormat: date-time Description When sanction expires (null = permanent)4Players/cortex-typescript-sdk/src/types.ts:3079
externalUserId?stringDescription External user ID4Players/cortex-typescript-sdk/src/types.ts:3052
idstringDescription Sanction ID4Players/cortex-typescript-sdk/src/types.ts:3046
isActivebooleanDescription Whether the sanction is currently active4Players/cortex-typescript-sdk/src/types.ts:3100
metadata?objectDescription Additional metadata4Players/cortex-typescript-sdk/src/types.ts:3067
participant?objectDescription Participant information (if available)4Players/cortex-typescript-sdk/src/types.ts:3104
participant.displayNamestringDescription Display name of the participant4Players/cortex-typescript-sdk/src/types.ts:3031
participant.externalUserIdstringDescription External user ID from ODIN4Players/cortex-typescript-sdk/src/types.ts:3033
participant.idstringDescription Participant ID4Players/cortex-typescript-sdk/src/types.ts:3027
participant.joinedAt?stringFormat: date-time Description When the participant first joined the project4Players/cortex-typescript-sdk/src/types.ts:3042
participant.projectIdstringDescription ODIN project ID this participant belongs to4Players/cortex-typescript-sdk/src/types.ts:3029
participant.userData?objectDescription User data from ODIN (parsed JSON)4Players/cortex-typescript-sdk/src/types.ts:3035
participantId?stringDescription Participant ID (if session-scoped)4Players/cortex-typescript-sdk/src/types.ts:3050
reason?stringDescription Reason for sanction4Players/cortex-typescript-sdk/src/types.ts:3065
revokedAt?stringFormat: date-time Description When sanction was revoked4Players/cortex-typescript-sdk/src/types.ts:3096
revokedByUserId?stringDescription User who revoked the sanction4Players/cortex-typescript-sdk/src/types.ts:3098
scope?objectDescription Scope configuration4Players/cortex-typescript-sdk/src/types.ts:3061
sessionId?stringDescription Session ID (if session-scoped)4Players/cortex-typescript-sdk/src/types.ts:3054
startAtstringFormat: date-time Description When sanction becomes active4Players/cortex-typescript-sdk/src/types.ts:3074
statusstringDescription Status: active, expired, or revoked4Players/cortex-typescript-sdk/src/types.ts:3102
tenantIdstringDescription Tenant ID4Players/cortex-typescript-sdk/src/types.ts:3048
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:3059
updatedAtstringFormat: date-time Description Last update timestamp4Players/cortex-typescript-sdk/src/types.ts:3091

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:3086
createdByUserId?stringDescription User who created the sanction4Players/cortex-typescript-sdk/src/types.ts:3081
endAt?stringFormat: date-time Description When sanction expires (null = permanent)4Players/cortex-typescript-sdk/src/types.ts:3079
externalUserId?stringDescription External user ID4Players/cortex-typescript-sdk/src/types.ts:3052
idstringDescription Sanction ID4Players/cortex-typescript-sdk/src/types.ts:3046
isActivebooleanDescription Whether the sanction is currently active4Players/cortex-typescript-sdk/src/types.ts:3100
metadata?objectDescription Additional metadata4Players/cortex-typescript-sdk/src/types.ts:3067
participant?objectDescription Participant information (if available)4Players/cortex-typescript-sdk/src/types.ts:3104
participant.displayNamestringDescription Display name of the participant4Players/cortex-typescript-sdk/src/types.ts:3031
participant.externalUserIdstringDescription External user ID from ODIN4Players/cortex-typescript-sdk/src/types.ts:3033
participant.idstringDescription Participant ID4Players/cortex-typescript-sdk/src/types.ts:3027
participant.joinedAt?stringFormat: date-time Description When the participant first joined the project4Players/cortex-typescript-sdk/src/types.ts:3042
participant.projectIdstringDescription ODIN project ID this participant belongs to4Players/cortex-typescript-sdk/src/types.ts:3029
participant.userData?objectDescription User data from ODIN (parsed JSON)4Players/cortex-typescript-sdk/src/types.ts:3035
participantId?stringDescription Participant ID (if session-scoped)4Players/cortex-typescript-sdk/src/types.ts:3050
reason?stringDescription Reason for sanction4Players/cortex-typescript-sdk/src/types.ts:3065
revokedAt?stringFormat: date-time Description When sanction was revoked4Players/cortex-typescript-sdk/src/types.ts:3096
revokedByUserId?stringDescription User who revoked the sanction4Players/cortex-typescript-sdk/src/types.ts:3098
scope?objectDescription Scope configuration4Players/cortex-typescript-sdk/src/types.ts:3061
sessionId?stringDescription Session ID (if session-scoped)4Players/cortex-typescript-sdk/src/types.ts:3054
startAtstringFormat: date-time Description When sanction becomes active4Players/cortex-typescript-sdk/src/types.ts:3074
statusstringDescription Status: active, expired, or revoked4Players/cortex-typescript-sdk/src/types.ts:3102
tenantIdstringDescription Tenant ID4Players/cortex-typescript-sdk/src/types.ts:3048
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:3059
updatedAtstringFormat: date-time Description Last update timestamp4Players/cortex-typescript-sdk/src/types.ts:3091

Defined in

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