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

projectId is a public field of the API response since sanctions became project-scoped, so it is set by the Object.assign below; the projectId parameter only serves as a fallback for responses of older API versions.

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.gatheringId?stringDescription Gathering the sanction was issued in (if any)
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.projectIdstringDescription Project the sanction belongs to
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​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sanctions.ts:179

Properties​

PropertyTypeDescriptionInherited fromDefined in
createdAtstringFormat: date-time Description Creation timestampSanctionResponse.createdAtodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4446
createdByUserId?stringDescription User who created the sanctionSanctionResponse.createdByUserIdodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4441
endAt?stringFormat: date-time Description When sanction expires (null = permanent)SanctionResponse.endAtodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4439
externalUserId?stringDescription External user IDSanctionResponse.externalUserIdodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4410
gatheringId?stringDescription Gathering the sanction was issued in (if any)SanctionResponse.gatheringIdodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4414
idstringDescription Sanction IDSanctionResponse.idodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4402
isActivebooleanDescription Whether the sanction is currently activeSanctionResponse.isActiveodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4460
metadata?objectDescription Additional metadataSanctionResponse.metadataodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4427
participant?objectDescription Participant information (if available)SanctionResponse.participantodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4464
participant.displayNamestringDescription Display name of the participant-odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4387
participant.externalUserIdstringDescription External user ID from ODIN-odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4389
participant.idstringDescription Participant ID-odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4383
participant.joinedAt?stringFormat: date-time Description When the participant first joined the project-odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4398
participant.projectIdstringDescription ODIN project ID this participant belongs to-odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4385
participant.userData?objectDescription User data from ODIN (parsed JSON)-odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4391
participantId?stringDescription Participant ID (if session-scoped)SanctionResponse.participantIdodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4408
projectIdstringDescription Project the sanction belongs toSanctionResponse.projectIdodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4406
reason?stringDescription Reason for sanctionSanctionResponse.reasonodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4425
revokedAt?stringFormat: date-time Description When sanction was revokedSanctionResponse.revokedAtodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4456
revokedByUserId?stringDescription User who revoked the sanctionSanctionResponse.revokedByUserIdodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4458
scope?objectDescription Scope configurationSanctionResponse.scopeodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4421
sessionId?stringDescription Session ID (if session-scoped)SanctionResponse.sessionIdodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4412
startAtstringFormat: date-time Description When sanction becomes activeSanctionResponse.startAtodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4434
statusstringDescription Status: active, expired, or revokedSanctionResponse.statusodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4462
tenantIdstringDescription Tenant IDSanctionResponse.tenantIdodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4404
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.typeodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4419
updatedAtstringFormat: date-time Description Last update timestampSanctionResponse.updatedAtodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4451

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 timestampodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4446
createdByUserId?stringDescription User who created the sanctionodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4441
endAt?stringFormat: date-time Description When sanction expires (null = permanent)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4439
externalUserId?stringDescription External user IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4410
gatheringId?stringDescription Gathering the sanction was issued in (if any)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4414
idstringDescription Sanction IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4402
isActivebooleanDescription Whether the sanction is currently activeodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4460
metadata?objectDescription Additional metadataodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4427
participant?objectDescription Participant information (if available)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4464
participant.displayNamestringDescription Display name of the participantodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4387
participant.externalUserIdstringDescription External user ID from ODINodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4389
participant.idstringDescription Participant IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4383
participant.joinedAt?stringFormat: date-time Description When the participant first joined the projectodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4398
participant.projectIdstringDescription ODIN project ID this participant belongs toodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4385
participant.userData?objectDescription User data from ODIN (parsed JSON)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4391
participantId?stringDescription Participant ID (if session-scoped)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4408
projectIdstringDescription Project the sanction belongs toodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4406
reason?stringDescription Reason for sanctionodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4425
revokedAt?stringFormat: date-time Description When sanction was revokedodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4456
revokedByUserId?stringDescription User who revoked the sanctionodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4458
scope?objectDescription Scope configurationodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4421
sessionId?stringDescription Session ID (if session-scoped)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4412
startAtstringFormat: date-time Description When sanction becomes activeodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4434
statusstringDescription Status: active, expired, or revokedodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4462
tenantIdstringDescription Tenant IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4404
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 sanctionodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4419
updatedAtstringFormat: date-time Description Last update timestampodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4451

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sanctions.ts:191

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 timestampodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4446
createdByUserId?stringDescription User who created the sanctionodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4441
endAt?stringFormat: date-time Description When sanction expires (null = permanent)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4439
externalUserId?stringDescription External user IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4410
gatheringId?stringDescription Gathering the sanction was issued in (if any)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4414
idstringDescription Sanction IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4402
isActivebooleanDescription Whether the sanction is currently activeodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4460
metadata?objectDescription Additional metadataodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4427
participant?objectDescription Participant information (if available)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4464
participant.displayNamestringDescription Display name of the participantodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4387
participant.externalUserIdstringDescription External user ID from ODINodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4389
participant.idstringDescription Participant IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4383
participant.joinedAt?stringFormat: date-time Description When the participant first joined the projectodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4398
participant.projectIdstringDescription ODIN project ID this participant belongs toodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4385
participant.userData?objectDescription User data from ODIN (parsed JSON)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4391
participantId?stringDescription Participant ID (if session-scoped)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4408
projectIdstringDescription Project the sanction belongs toodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4406
reason?stringDescription Reason for sanctionodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4425
revokedAt?stringFormat: date-time Description When sanction was revokedodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4456
revokedByUserId?stringDescription User who revoked the sanctionodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4458
scope?objectDescription Scope configurationodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4421
sessionId?stringDescription Session ID (if session-scoped)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4412
startAtstringFormat: date-time Description When sanction becomes activeodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4434
statusstringDescription Status: active, expired, or revokedodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4462
tenantIdstringDescription Tenant IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4404
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 sanctionodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4419
updatedAtstringFormat: date-time Description Last update timestampodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4451

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sanctions.ts:214


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 timestampodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4446
createdByUserId?stringDescription User who created the sanctionodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4441
endAt?stringFormat: date-time Description When sanction expires (null = permanent)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4439
externalUserId?stringDescription External user IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4410
gatheringId?stringDescription Gathering the sanction was issued in (if any)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4414
idstringDescription Sanction IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4402
isActivebooleanDescription Whether the sanction is currently activeodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4460
metadata?objectDescription Additional metadataodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4427
participant?objectDescription Participant information (if available)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4464
participant.displayNamestringDescription Display name of the participantodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4387
participant.externalUserIdstringDescription External user ID from ODINodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4389
participant.idstringDescription Participant IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4383
participant.joinedAt?stringFormat: date-time Description When the participant first joined the projectodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4398
participant.projectIdstringDescription ODIN project ID this participant belongs toodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4385
participant.userData?objectDescription User data from ODIN (parsed JSON)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4391
participantId?stringDescription Participant ID (if session-scoped)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4408
projectIdstringDescription Project the sanction belongs toodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4406
reason?stringDescription Reason for sanctionodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4425
revokedAt?stringFormat: date-time Description When sanction was revokedodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4456
revokedByUserId?stringDescription User who revoked the sanctionodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4458
scope?objectDescription Scope configurationodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4421
sessionId?stringDescription Session ID (if session-scoped)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4412
startAtstringFormat: date-time Description When sanction becomes activeodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4434
statusstringDescription Status: active, expired, or revokedodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4462
tenantIdstringDescription Tenant IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4404
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 sanctionodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4419
updatedAtstringFormat: date-time Description Last update timestampodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4451

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sanctions.ts:200


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 timestampodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4446
createdByUserId?stringDescription User who created the sanctionodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4441
endAt?stringFormat: date-time Description When sanction expires (null = permanent)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4439
externalUserId?stringDescription External user IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4410
gatheringId?stringDescription Gathering the sanction was issued in (if any)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4414
idstringDescription Sanction IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4402
isActivebooleanDescription Whether the sanction is currently activeodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4460
metadata?objectDescription Additional metadataodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4427
participant?objectDescription Participant information (if available)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4464
participant.displayNamestringDescription Display name of the participantodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4387
participant.externalUserIdstringDescription External user ID from ODINodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4389
participant.idstringDescription Participant IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4383
participant.joinedAt?stringFormat: date-time Description When the participant first joined the projectodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4398
participant.projectIdstringDescription ODIN project ID this participant belongs toodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4385
participant.userData?objectDescription User data from ODIN (parsed JSON)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4391
participantId?stringDescription Participant ID (if session-scoped)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4408
projectIdstringDescription Project the sanction belongs toodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4406
reason?stringDescription Reason for sanctionodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4425
revokedAt?stringFormat: date-time Description When sanction was revokedodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4456
revokedByUserId?stringDescription User who revoked the sanctionodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4458
scope?objectDescription Scope configurationodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4421
sessionId?stringDescription Session ID (if session-scoped)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4412
startAtstringFormat: date-time Description When sanction becomes activeodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4434
statusstringDescription Status: active, expired, or revokedodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4462
tenantIdstringDescription Tenant IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4404
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 sanctionodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4419
updatedAtstringFormat: date-time Description Last update timestampodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4451

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sanctions.ts:228