updateApiKeys - API Key Module Reference

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

NoteYou should only use this methods when implementing complex customizations. For common cases, check out available workflows instead.

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

This method updates an existing API key.

Example#

Code
1const apiKey = await apiKeyModuleService.updateApiKeys("apk_123", {2  title: "My development key"3})

Parameters#

idstring
The ID of the API key.
The attributes to update in the API key.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<ApiKeyDTO>
The updated API key.

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

This method updates existing API keys.

Example#

Code
1const apiKey = await apiKeyModuleService.updateApiKeys(2  {3    title: "Development key",4  },5  {6    title: "My development key",7  }8)

Parameters#

The filters that specify which API keys should be updated.
The attributes to update in the API keys.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<ApiKeyDTO[]>
The updated API keys.
Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break