API keys

A shop API key lets a program act for one shop without a person signing in. Keys are narrow. Read this page before you plan an integration around one.

What a key is

  • A key belongs to one shop. It can only ever see that shop's data.
  • It is shown once, when it is made. Tienda stores it hashed and cannot show it again. If it is lost, revoke it and make a new one.
  • A key has a name, an active flag, and a "last used" time that is updated when the key is used on the products feed.
  • Revoking a key switches it off at once. It cannot be switched on again.
  • A key stands for the shop, not for a person. It has no role and no profile.
  • Only an administrator of the shop can list, make and revoke keys.

A shop key starts with mkt_. Keep it as secret as a password.

Make a key

In the back office: Settings, API keys, New key. Give it a name that says where it is used, then copy it. The steps are in the manual: Integrations, API keys.

The same thing over the API, signed in as a shop administrator:

Method and pathWhat
GET /api/v1/admin/api_keysList keys: id, name, active, last_used_at, created_at.
POST /api/v1/admin/api_keys with {"name": "Marketplace feed"}Make a key. The answer holds raw_key, once.
DELETE /api/v1/admin/api_keys/:idRevoke the key.

How to send a key

Put it in the X-Api-Key header:

GET /api/v1/market/products HTTP/1.1
Host: shop.example.com
X-Api-Key: mkt_<your key>

The endpoint also accepts the key as an api_key query parameter. Do not use that: URLs end up in logs. Without a key, or with a wrong, revoked or unknown key, the answer is 401 with {"error": "API key required"} or {"error": "Invalid API key"}.

What a key can do

Over the REST API, one thing: read the products feed, GET /api/v1/market/products. No other /api/v1 endpoint accepts a key. They all need a person's token (API overview).

The MCP endpoint refuses a shop API key. An AI agent uses an agent key, which a shop administrator makes under Settings > AI agents, or an OAuth connection that the person approves there (see the MCP overview).

The manual says more than the API does

The back office text next to the keys page says a key lets a program "read and change the data of this shop". Over the REST API that is not so today: a key reads products and nothing else. If you need to write data from a program, there is no key-based way to do it on the REST API.

What a key cannot do

  • Write anything over the REST API.
  • Read orders, customers, stock, prices lists beyond the feed, or settings.
  • Reach another shop.
  • Be limited to part of the catalog, or to a time window. Not available yet.
  • Be given a role. Not available yet.