- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
createApiKeysWorkflow - Medusa Core Workflows Reference
This documentation provides a reference to the createApiKeysWorkflow
. It belongs to the @medusajs/medusa/core-flows
package.
This workflow creates one or more API keys, which can be secret or publishable. It's used by the Create API Key Admin API Route.
You can use this workflow within your customizations or your own custom workflows, allowing you to create API keys within your custom flows.
Source CodeExamples#
Steps#
Workflow Hook
Step conditioned by when
Input#
CreateApiKeysWorkflowInput
CreateApiKeysWorkflowInputThe data to create API keys.
CreateApiKeysWorkflowInput
CreateApiKeysWorkflowInputapi_keys
CreateApiKeyDTO[]The API keys to create.
api_keys
CreateApiKeyDTO[]Output#
CreateApiKeysWorkflowOutput
CreateApiKeysWorkflowOutputThe created API keys.
CreateApiKeysWorkflowOutput
CreateApiKeysWorkflowOutputid
stringThe ID of the API key.
id
stringtoken
stringThe token of the API key.
token
stringredacted
stringThe redacted form of the API key's token. This is useful
when showing portion of the token. For example sk_...123
.
redacted
stringsk_...123
.title
stringThe title of the API key.
title
stringtype
ApiKeyTypeThe type of the API key.
type
ApiKeyTypelast_used_at
null | DateThe date the API key was last used.
last_used_at
null | Datecreated_by
stringWho created the API key.
created_by
stringcreated_at
DateThe date the API key was created.
created_at
Dateupdated_at
DateThe date the API key was updated.
updated_at
Datedeleted_at
null | DateThe date the API key was deleted.
deleted_at
null | Daterevoked_by
null | stringWho revoked the API key. For example,
the ID of the user that revoked it.
revoked_by
null | stringrevoked_at
null | DateThe date the API key was revoked.
revoked_at
null | DateWas this page helpful?