Skip to main content
Skip to main content

revoke - API Key Module Reference

This documentation provides a reference to the revoke method. This belongs to the API Key Module.

revoke(selector, data, sharedContext?): Promise<ApiKeyDTO[]>

This method revokes API keys based on the filters provided.

Example

const apiKey = await apiKeyModuleService.revoke(
{
id: "apk_123",
},
{
revoked_by: "user_123",
// 1 minute
revoke_in: 60,
}
)

Parameters

selectorFilterableApiKeyPropsRequired
The filters to specify which API keys should be revoked.
dataRevokeApiKeyDTORequired
The details of revoking the API keys.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<ApiKeyDTO[]>Required
The revoked API keys.

revoke(id, data, sharedContext?): Promise<ApiKeyDTO>

This method revokes an API key based on the ID provided.

Example

const apiKey = await apiKeyModuleService.revoke("apk_123", {
revoked_by: "user_123",
// 1 minute
revoke_in: 60,
})

Parameters

idstringRequired
The ID of the API key to revoke.
dataRevokeApiKeyDTORequired
The details of revoking the API key.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<ApiKeyDTO>Required
The revoked API key.
Was this section helpful?