Skip to content

Create API key

POST/admin/v1/stores/{store_id}/api-keys
  • api_keys:manage
  • Idempotency-Key supported

Issue an API key. The token is returned once.

Path parameters

  • store_idstringrequired

    The store's ID, like store_01k8qs5s…. Apps get it with the install, in the OAuth redirect and the token response.

Headers

  • Idempotency-Keystring

    Send the same key to retry safely: the first answer is replayed for 24 hours.

  • shop-api-versionYYYY-MM

    The version to answer in. Without it, your app’s pinned version, else the newest.

Body

  • kindenumrequired

    What a key can be used for.

    • publishable
    • secret
  • namestringrequired
  • permissionsarray of strings · or null

    Secret keys only. Defaults to every non-sensitive permission you hold.

  • storefront_urlstring · or null

    Publishable keys only: the headless storefront's address (https://…).

  • allowed_originsarray of strings

    Publishable keys only: the origins its storefronts run on (https://shop.example.com), at most 20. Empty: any origin.

Returns

201 Key created; copy the token now.

Errors

  • 403forbiddenMissing permission.
  • 422validation_failedValidation failed.