Raw
1 ---
2 sidebar_label: "Manage Publishable API Keys"
3 tags:
4 - user guide
5 - api key
6 products:
7 - api key
8 ---
9
10 import { Table } from "docs-ui"
11 import { EllipsisHorizontal } from "@medusajs/icons"
12
13 export const metadata = {
14 title: `Manage Publishable API Keys in Medusa Admin`,
15 }
16
17 # {metadata.title}
18
19 In this guide, you'll learn how to create and manage publishable API keys in the Medusa Admin.
20
21 <Note>
22
23 This guide is mainly useful for developers and technical teams building customizations for a Medusa application.
24
25 </Note>
26
27 ## What is a Publishable API Key?
28
29 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.
30
31 To learn how to pass the publishable API key in request headers, refer to the [API Reference](!api!/store/publishable-api-key).
32
33 ---
34
35 ## View Publishable API Keys
36
37 To view the publishable API keys in the Medusa Admin, go to Settings -> Publishable API Keys.
38
39 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.
40
41 ![Publishable API keys list](https://res.cloudinary.com/dza7lstvk/image/upload/v1740489989/User%20Guide/Screenshot_2025-02-25_at_3.26.09_PM_xmpxdw.png)
42
43 ---
44
45 ## Create Publishable API Key
46
47 To create a new publishable API key:
48
49 1. Go to Settings -> Publishable API Keys.
50 2. Click the Create button in the main section's header.
51 3. In the form that opens, enter the publishable API key's title.
52 4. Once you're done, click the Save button.
53
54 ![Create publishable API key form](https://res.cloudinary.com/dza7lstvk/image/upload/v1740490166/User%20Guide/Screenshot_2025-02-25_at_3.28.44_PM_aosbhw.png)
55
56 ---
57
58 ## View Publishable API Key Details
59
60 To view the details of a publishable API key:
61
62 1. Go to Settings -> Publishable API Keys.
63 2. Click on a publishable API key from the list.
64
65 This opens the publishable API key's details page where you can also manage the API key.
66
67 ![Publishable API key details page](https://res.cloudinary.com/dza7lstvk/image/upload/v1740490244/User%20Guide/Screenshot_2025-02-25_at_3.30.35_PM_bgcl23.png)
68
69 ### Publishable API Key Status
70
71 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:
72
73 <Table>
74 <Table.Header>
75 <Table.Row>
76 <Table.HeaderCell>
77 Status
78 </Table.HeaderCell>
79 <Table.HeaderCell>
80 Description
81 </Table.HeaderCell>
82 </Table.Row>
83 </Table.Header>
84 <Table.Body>
85 <Table.Row>
86 <Table.Cell>Active</Table.Cell>
87 <Table.Cell>The API key is active and can be used in requests.</Table.Cell>
88 </Table.Row>
89 <Table.Row>
90 <Table.Cell>Revoked</Table.Cell>
91 <Table.Cell>The API key has been revoked and can't be used in requests.</Table.Cell>
92 </Table.Row>
93 </Table.Body>
94 </Table>
95
96 ---
97
98 ## Copy Publishable API Key
99
100 To copy a publishable API key:
101
102 1. Go to the publishable API key's details page.
103 2. In the first section, click on the truncated key to copy it to your clipboard.
104
105 ![Copy publishable API key](https://res.cloudinary.com/dza7lstvk/image/upload/v1740500116/User%20Guide/Screenshot_2025-02-25_at_6.14.15_PM_muwq9e.png)
106
107 ---
108
109 ## Edit Publishable API Key
110
111 To edit a publishable API key:
112
113 1. Go to the publishable API key's details page.
114 2. Click the <InlineIcon Icon={EllipsisHorizontal} alt="three-dots" /> in the first section's header.
115 3. Choose "Edit" from the dropdown.
116 4. In the side window that opens, you can edit the publishable API key's title.
117 5. Once you're done, click the Save button.
118
119 ![Edit publishable API key form](https://res.cloudinary.com/dza7lstvk/image/upload/v1740490481/User%20Guide/Screenshot_2025-02-25_at_3.34.28_PM_hxppxj.png)
120
121 ---
122
123 ## Manage Publishable API Key's Sales Channels
124
125 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.
126
127 ### Add Sales Channels
128
129 To add a sales channel to a publishable API key:
130
131 1. Go to the publishable API key's details page.
132 2. Click the "Add" button in the "Sales Channels" section's header.
133 3. In the list that opens, check the sales channels you want to add the API key to.
134 4. Once you're done, click the Save button.
135
136 ![Add sales channels form](https://res.cloudinary.com/dza7lstvk/image/upload/v1740490636/User%20Guide/Screenshot_2025-02-25_at_3.37.05_PM_ontnzy.png)
137
138 ### Remove Sales Channels
139
140 To remove a sales channel from a publishable API key:
141
142 1. Go to the publishable API key's details page.
143 2. Check the checkbox next to the sales channel you want to remove in the "Sales Channels" section.
144 3. Press <Kbd>R</Kbd> or click the Remove button at the bottom center of the page.
145 4. Confirm removing the sales channels by clicking the Continue button.
146
147 ![Remove sales channels from publishable API key](https://res.cloudinary.com/dza7lstvk/image/upload/v1740490931/User%20Guide/Screenshot_2025-02-25_at_3.38.41_PM_pmlbqk.png)
148
149 ---
150
151 ## Revoke Publishable API Key
152
153 <Note type="warning">
154
155 Revoking a publishable API key is irreversible. You can't use the key in requests after revoking it or reactivate it.
156
157 </Note>
158
159 To revoke a publishable API key:
160
161 1. Go to the publishable API key's details page.
162 2. Click the <InlineIcon Icon={EllipsisHorizontal} alt="three-dots" /> in the first section's header.
163 3. Choose "Revoke API key" from the dropdown.
164 4. Confirm revoking the API key by clicking the "Revoke API key" button in the pop-up.
165
166 ---
167
168 ## Delete Publishable API Key
169
170 <Note type="warning">
171
172 Deleting a publishable API key is irreversible.
173
174 </Note>
175
176 You can only delete a publishable API key after [revoking it](#revoke-publishable-api-key). To delete a publishable API key:
177
178 1. Go to the publishable API key's details page.
179 2. Click the <InlineIcon Icon={EllipsisHorizontal} alt="three-dots" /> in the first section's header.
180 3. Choose "Delete" from the dropdown.
181 4. Confirm deleting the API key by clicking the Delete button in the pop-up.