# API Key

<div align="left"><figure><img src="/files/OpRlqoVvWU8f8v0lu84w" alt="" width="188"><figcaption></figcaption></figure></div>

The API Key service allows your app to securely store sensitive information like API keys, SSH keys, passwords, secrets, etc and access them within your Cloud Flow Web Hooks and Background Tasks.

***

## Profile Settings

{% hint style="success" %}
NOTE: All profile settings are encrypted and stored in Zingy's cloud infrastructure.
{% endhint %}

### Secret

<div align="left"><figure><img src="/files/qCUt18FYhVwOk5mZEYam" alt="" width="375"><figcaption></figcaption></figure></div>

Paste or enter the API key, SSH key, password, secret, etc here.

### Secret2/Secret3/Secret4 (optional)

<div align="left"><figure><img src="/files/YiK5irayVfkSBQz88xbo" alt="" width="375"><figcaption></figcaption></figure></div>

Optionally store up-to 3 other related key/secret values as part of the profile.

***

## Connection Settings

The API Key service does not have any connection specific settings.

***

## Operations/Commands

The [Execute Connection Command](/app-editor/page-flow/toolbox-blocks/execute-connection-command.md) block is available in both [Page Flow](/app-editor/page-flow.md) and [Cloud Flow](/app-editor/cloud-flow.md). Using this block you can add logic to trigger the operations/commands supported by the API Key service.

{% hint style="success" %}
For security purposes, all operations/commands offered by the API Key service are only available in [Cloud Flow](/app-editor/cloud-flow.md) and cannot be used in [Page Flow](/app-editor/page-flow.md).
{% endhint %}

### Retrieve

Use this command to retrieve the values for the API key, SSH key, password, secret, etc.

#### Input Data

None

#### Output

Object representing the key/secret values:

<table><thead><tr><th width="149">Property</th><th width="95">Type</th><th>Description</th></tr></thead><tbody><tr><td>secret1</td><td><a href="/pages/dvPsioDBbuLzDEPy8DhX">text</a></td><td>The main secret value</td></tr><tr><td>secret2, secret3, secret4</td><td><a href="/pages/dvPsioDBbuLzDEPy8DhX">text</a></td><td>Additional secret values</td></tr></tbody></table>

***

## Advanced Functionality

In your app's Cloud Flow Web Hooks and Background Tasks, the [Custom Code](/app-editor/page-flow/toolbox-blocks/custom-code.md) block can also be used to retrieve keys/secrets stored using this service.

```java
const keyInfo = zingyConn.apikey(connectionName);
```

The `keyInfo` object contains the `secret1` , `secret2` , `secret3` and `secret4` properties for the key/secret values.


---

# Agent Instructions: 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:

```
GET https://docs.zingy.ai/app-editor/connections/services/api-key.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
