www/apps/user-guide/app/settings/developer/publishable-api-keys/page.mdx
import { Table } from "docs-ui" import { EllipsisHorizontal } from "@medusajs/icons"
export const metadata = {
title: Manage Publishable API Keys in Medusa Admin,
}
In this guide, you'll learn how to create and manage publishable API keys in the Medusa Admin.
<Note>This guide is mainly useful for developers and technical teams building customizations for a Medusa application.
</Note>A publishable API key is a client key scoped to one or more sales channels. When you build a storefront, you must pass a publishable API key in the request headers indicating the sales channel to scope the request to. This impacts the products retrieved, available stock quantities, and other data.
To learn how to pass the publishable API key in request headers, refer to the API Reference.
To view the publishable API keys in the Medusa Admin, go to Settings -> Publishable API Keys.
Here, you can see a list of all the publishable API keys you have set up in your store. You can also search, filter, and sort the API keys to find the one you are looking for.
To create a new publishable API key:
To view the details of a publishable API key:
This opens the publishable API key's details page where you can also manage the API key.
You can see the status of the publishable API key in the header of the first section in the details page. A publishable API key's status can be:
<Table> <Table.Header> <Table.Row> <Table.HeaderCell>Status</Table.HeaderCell> <Table.HeaderCell>Description</Table.HeaderCell> </Table.Row> </Table.Header> <Table.Body> <Table.Row> <Table.Cell>Active</Table.Cell> <Table.Cell>The API key is active and can be used in requests.</Table.Cell> </Table.Row> <Table.Row> <Table.Cell>Revoked</Table.Cell> <Table.Cell>The API key has been revoked and can't be used in requests.</Table.Cell> </Table.Row> </Table.Body> </Table>To copy a publishable API key:
To edit a publishable API key:
You can manage the sales channels of a publishable API key in its details page. By adding sales channels to the publishable API key, it becomes part of the scope in requests made with the key.
To add a sales channel to a publishable API key:
To remove a sales channel from a publishable API key:
Revoking a publishable API key is irreversible. You can't use the key in requests after revoking it or reactivate it.
</Note>To revoke a publishable API key:
Deleting a publishable API key is irreversible.
</Note>You can only delete a publishable API key after revoking it. To delete a publishable API key: