> For the complete documentation index, see [llms.txt](https://docs.gobtcpay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gobtcpay.com/api-reference/merchant-api/api-keys.md).

# API Keys

Issue, list, rotate, and revoke Web SDK integration keys (publishable / secret).

## Create API key

> Issues a Web SDK integration key of the given \`type\` (\`publishable\` / \`secret\`), optionally scoped to a \`storeId\`. The response includes the full \`secret\` \*\*shown only once\*\*.

```json
{"openapi":"3.1.0","info":{"title":"GoBTC Pay Merchant Account API","version":"1.45.2"},"tags":[{"name":"API Keys","description":"Issue, list, rotate, and revoke Web SDK integration keys (publishable / secret)."}],"servers":[{"url":"https://api.gobtcpay.com/public/api/v1.1"}],"security":[{"merchantAuth":[]}],"components":{"securitySchemes":{"merchantAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Merchant dashboard access token obtained from `/merchant/auth/login` (or the OAuth / passkey / 2FA login flows). Send it as `Authorization: Bearer <accessToken>`. Refresh it via `/merchant/auth/refresh` when it expires."}}},"paths":{"/merchant/api-key/create":{"post":{"summary":"Create API key","description":"Issues a Web SDK integration key of the given `type` (`publishable` / `secret`), optionally scoped to a `storeId`. The response includes the full `secret` **shown only once**.","tags":["API Keys"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","description":"Human-readable label for the API key."},"type":{"type":"string","enum":["publishable","secret"]},"storeId":{"type":"string"}},"required":["label","type"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"object","properties":{"$case":{"type":"string","const":"success"},"success":{"type":"object","properties":{"apiKey":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string","description":"Human-readable label for the API key."},"type":{"type":"string","enum":["publishable","secret"]},"prefix":{"type":"string","description":"Non-secret key prefix shown for identification (e.g. `pk_live_ab12`)."},"lastUsedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"UnixTime (seconds since epoch)"},{"type":"null"}]},"createdAt":{"type":"integer","minimum":0,"description":"Creation time as a Unix timestamp (seconds)."},"secret":{"type":"string","description":"The secret key value. Returned only on create — shown once, store it securely."}},"required":["id","label","type","prefix","lastUsedAt","createdAt","secret"],"additionalProperties":false,"description":"Secret API key of the POS terminal. Store it securely — it authenticates the terminal."}},"required":["apiKey"],"additionalProperties":false}},"required":["$case","success"],"additionalProperties":false}},"required":["id","result"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"500":{"description":"Error response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"statusCode":{"type":"number","description":"Numeric error status code."},"description":{"type":"string","description":"Human-readable description."},"statusMessage":{"type":"string","description":"Short machine-readable error message."}},"required":["statusCode","description","statusMessage"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}}}}}}}
```

## List API keys

> Lists integration keys (masked — \`prefix\` only, never the full secret) with optional \`pagination\` and a \`storeId\` filter. Returns \`items\` and \`totalCount\`.

```json
{"openapi":"3.1.0","info":{"title":"GoBTC Pay Merchant Account API","version":"1.45.2"},"tags":[{"name":"API Keys","description":"Issue, list, rotate, and revoke Web SDK integration keys (publishable / secret)."}],"servers":[{"url":"https://api.gobtcpay.com/public/api/v1.1"}],"security":[{"merchantAuth":[]}],"components":{"securitySchemes":{"merchantAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Merchant dashboard access token obtained from `/merchant/auth/login` (or the OAuth / passkey / 2FA login flows). Send it as `Authorization: Bearer <accessToken>`. Refresh it via `/merchant/auth/refresh` when it expires."}}},"paths":{"/merchant/api-key/list":{"post":{"summary":"List API keys","description":"Lists integration keys (masked — `prefix` only, never the full secret) with optional `pagination` and a `storeId` filter. Returns `items` and `totalCount`.","tags":["API Keys"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pagination":{"type":"object","properties":{"limit":{"type":"number","minimum":1,"maximum":100,"default":20},"skip":{"type":"number","minimum":0,"default":0}},"additionalProperties":false},"filters":{"type":"object","properties":{"storeId":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"object","properties":{"$case":{"type":"string","const":"success"},"success":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string","description":"Human-readable label for the POS terminal (optional)."},"type":{"type":"string","enum":["publishable","secret"]},"prefix":{"type":"string","description":"Non-secret key prefix shown for identification (e.g. `pk_live_ab12`)."},"lastUsedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"UnixTime (seconds since epoch)"},{"type":"null"}]},"createdAt":{"type":"integer","minimum":0,"description":"Creation time as a Unix timestamp (seconds)."}},"required":["id","label","type","prefix","lastUsedAt","createdAt"],"additionalProperties":false}},"totalCount":{"type":"number","description":"Total number of records matching the filters."}},"required":["items","totalCount"],"additionalProperties":false}},"required":["$case","success"],"additionalProperties":false}},"required":["id","result"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"500":{"description":"Error response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"statusCode":{"type":"number","description":"Numeric error status code."},"description":{"type":"string","description":"Human-readable description."},"statusMessage":{"type":"string","description":"Short machine-readable error message."}},"required":["statusCode","description","statusMessage"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}}}}}}}
```

## Rotate API key

> Rotates the key identified by \`apiKeyId\`, invalidating the previous secret and returning a fresh \`secret\` (shown only once).

```json
{"openapi":"3.1.0","info":{"title":"GoBTC Pay Merchant Account API","version":"1.45.2"},"tags":[{"name":"API Keys","description":"Issue, list, rotate, and revoke Web SDK integration keys (publishable / secret)."}],"servers":[{"url":"https://api.gobtcpay.com/public/api/v1.1"}],"security":[{"merchantAuth":[]}],"components":{"securitySchemes":{"merchantAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Merchant dashboard access token obtained from `/merchant/auth/login` (or the OAuth / passkey / 2FA login flows). Send it as `Authorization: Bearer <accessToken>`. Refresh it via `/merchant/auth/refresh` when it expires."}}},"paths":{"/merchant/api-key/rotate":{"post":{"summary":"Rotate API key","description":"Rotates the key identified by `apiKeyId`, invalidating the previous secret and returning a fresh `secret` (shown only once).","tags":["API Keys"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"apiKeyId":{"type":"string"}},"required":["apiKeyId"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"object","properties":{"$case":{"type":"string","const":"success"},"success":{"type":"object","properties":{"apiKey":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string","description":"Human-readable label for the POS terminal (optional)."},"type":{"type":"string","enum":["publishable","secret"]},"prefix":{"type":"string","description":"Non-secret key prefix shown for identification (e.g. `pk_live_ab12`)."},"lastUsedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"UnixTime (seconds since epoch)"},{"type":"null"}]},"createdAt":{"type":"integer","minimum":0,"description":"Creation time as a Unix timestamp (seconds)."},"secret":{"type":"string","description":"The freshly rotated secret key value. Shown once — store it securely."}},"required":["id","label","type","prefix","lastUsedAt","createdAt","secret"],"additionalProperties":false,"description":"Secret API key of the POS terminal. Store it securely — it authenticates the terminal."}},"required":["apiKey"],"additionalProperties":false}},"required":["$case","success"],"additionalProperties":false}},"required":["id","result"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"500":{"description":"Error response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"statusCode":{"type":"number","description":"Numeric error status code."},"description":{"type":"string","description":"Human-readable description."},"statusMessage":{"type":"string","description":"Short machine-readable error message."}},"required":["statusCode","description","statusMessage"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}}}}}}}
```

## Revoke API key

> Revokes the key identified by \`apiKeyId\`. Returns \`{ ok }\`.

```json
{"openapi":"3.1.0","info":{"title":"GoBTC Pay Merchant Account API","version":"1.45.2"},"tags":[{"name":"API Keys","description":"Issue, list, rotate, and revoke Web SDK integration keys (publishable / secret)."}],"servers":[{"url":"https://api.gobtcpay.com/public/api/v1.1"}],"security":[{"merchantAuth":[]}],"components":{"securitySchemes":{"merchantAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Merchant dashboard access token obtained from `/merchant/auth/login` (or the OAuth / passkey / 2FA login flows). Send it as `Authorization: Bearer <accessToken>`. Refresh it via `/merchant/auth/refresh` when it expires."}}},"paths":{"/merchant/api-key/revoke":{"post":{"summary":"Revoke API key","description":"Revokes the key identified by `apiKeyId`. Returns `{ ok }`.","tags":["API Keys"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"apiKeyId":{"type":"string"}},"required":["apiKeyId"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"object","properties":{"$case":{"type":"string","const":"success"},"success":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}},"required":["$case","success"],"additionalProperties":false}},"required":["id","result"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"500":{"description":"Error response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"statusCode":{"type":"number","description":"Numeric error status code."},"description":{"type":"string","description":"Human-readable description."},"statusMessage":{"type":"string","description":"Short machine-readable error message."}},"required":["statusCode","description","statusMessage"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gobtcpay.com/api-reference/merchant-api/api-keys.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
