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

# Chatbot Api Keys

## Retrieves an existing API key

> \
> \
> \*\*Required Permission:\*\* \`chatbots.apikey.get\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Chatbot api-keys","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/workspaces/{workspaceId}/chatbots/{chatbotId}/api/{index}":{"get":{"operationId":"ChatbotApikeyController_getApiKey[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The ID of the chatbot.","schema":{"type":"string"}},{"name":"index","required":true,"in":"path","description":"The index of the key (e.g., 1 or 2)","schema":{"type":"number"}},{"name":"workspaceId","required":true,"in":"path","description":"The ID of the workspace.","schema":{"type":"string"}}],"responses":{"200":{"description":"The API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Retrieves an existing API key","tags":["Chatbot api-keys"],"description":"\n\n**Required Permission:** `chatbots.apikey.get`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"ApiKeyResponseDto":{"type":"object","properties":{"apiKey":{"type":"string","description":"The generated API key. Only fully displayed upon creation."},"error":{"type":"string","description":"Optional error message."}}}}}}
```

## Generates a new API key

> \
> \
> \*\*Required Permission:\*\* \`chatbots.apikey.create\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Chatbot api-keys","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/workspaces/{workspaceId}/chatbots/{chatbotId}/api/{index}":{"post":{"operationId":"ChatbotApikeyController_generateApiKey[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The ID of the chatbot.","schema":{"type":"string"}},{"name":"index","required":true,"in":"path","description":"The index of the key (e.g., 1 or 2)","schema":{"type":"number"}},{"name":"workspaceId","required":true,"in":"path","description":"The ID of the workspace.","schema":{"type":"string"}}],"responses":{"201":{"description":"The newly generated API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Generates a new API key","tags":["Chatbot api-keys"],"description":"\n\n**Required Permission:** `chatbots.apikey.create`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"ApiKeyResponseDto":{"type":"object","properties":{"apiKey":{"type":"string","description":"The generated API key. Only fully displayed upon creation."},"error":{"type":"string","description":"Optional error message."}}}}}}
```
