API key
An API key is a value included with a request to a service to identify the connection, associate usage with an account, or grant access, according to the provider's rules. The key type determines what it allows and whether it must be kept secret.
On this page
Source content checked . English translation published 2026-10-27.
In business automation
An API key identifies a connection to a service and sometimes determines which actions it is allowed to perform. In automation, you need to know who is responsible for the connection, what it is allowed to do, and which workflows will be affected by replacing it. Store the secret key in a designated place so you can update the connection without searching for copies throughout the workflow.
What the key identifies and what it does not identify
The term API key alone does not say who has been granted access. In Google Cloud, a standard key associates requests with a project for billing and quota purposes, without identifying the actor making them. An authorization key authenticates a request using a service account's identity and acts according to its permissions, so it must be kept secret. This is a distinction between Google key types, not a definition that applies to every provider.
Google warns against using authorization keys in production for APIs that create or manage resources in Google Cloud. The documentation describes an exception for the Gemini API, provided no IAM roles have been assigned to the service account associated with the key. This distinction explains the key type and is not a recommendation to choose it.
In Stripe, a publishable key is also intended for code that runs on the user's device, while secret and restricted keys must be kept secret. A restricted key lets you set permissions. Test environment keys are also separate from live environment keys. Check the service documentation to determine what type of key you have, not just the name of the field where you paste it.
A key shared across different workflows does not, by itself, show who ran each workflow. For useful usage records, include the workflow name, environment, and action result, without logging the key value.
Where to store it in automation
Store a secret key in the credentials mechanism of the automation tool or in an organization-approved secrets manager. The workflow should reference the stored item instead of copying its value into fields, sample files, or messages. In n8n, credentials are encrypted before they are saved to the database. Encryption at rest is not permission to print them during execution.
Google recommends restricting keys and keeping them out of client code and code repositories. In the Google APIs documentation, it also recommends avoiding passing the key as a URL parameter. For another provider, follow its documented authentication method and distinguish a secret key from one it explicitly identifies as publishable.
Record the name of the entry in the credentials mechanism and the action the connection needs to perform in the inventory. Where the service supports it, tailor permissions to that need. If a workflow only needs to read documents, check whether the provider lets you restrict it to read access before also granting it permission to make changes.
How to replace a key without missing a dependent workflow
For a planned replacement, start with a list of workflows that use the key, including scheduled jobs and test environments. Check whether the provider allows the old and new keys to work at the same time. There is no standard overlap period across all services. Stripe documents a gradual transition and checking usage of the old key before it expires.
After the authorized owner makes the change, check that access works in every dependent workflow and that the expected result was read or saved. Prefer a read-only check where possible. You do not need to send a customer a message or create a real charge to prove the key works. A scheduled workflow that has not run yet has not been checked.
Plan in advance what to do if the transition fails: stop in a controlled way, fix the configuration, or use a recovery method supported by the provider. Reverting to the old key is possible only if it is still valid and has not been exposed. After revocation, do not assume that restoring a configuration file will make it work again.
What to check when a key is exposed
Exposure of a secret key is an incident that requires urgent handling. According to OWASP, an exposed key should be revoked quickly. Notify the service owner, identify dependent workflows, and handle revocation and replacement according to the incident procedure. Do not wait for a complete inventory while unauthorized use is possible; workflows may need to be stopped temporarily.
Deleting the key from a message or file does not revoke its access. Check the key status and usage logs with the provider, and keep a redacted record of what you find. A revocation check may include a safe read request with the old key, performed only by an authorized person and according to the provider's documentation. A generic error by itself is not proof that the key was revoked.
Document the plan, the replacement that was performed, and evidence that the new key works and the old one no longer grants access, separately. All execution fields in the attached card are blank: it is intended for preparation and documentation, and does not indicate that any system was checked.
Ownership and permissions card to fill in
Copy the card for each connection into an internal copy with restricted access. The public table and download file are blank. Even an inventory without secrets may reveal internal structure, so share only a redacted copy outside the team.
No replacement, revocation, or access check was performed here. Fill in results only after performing and checking the work.
Scroll the table sideways to read every column.
| Field | How to fill it in | Your documentation |
|---|---|---|
| Service and connection | Generic name of the service and the connection's role. In a public example, write 'sample service'; do not add a real account identifier. | |
| Connection owner | The role responsible for handling and replacing the key. In a public version, write a sample role, without a name or personal contact details. | |
| Environment | Test or live, using the service's labels. Leave blank if it is not yet known. | |
| Key type | The exact type in the provider's documentation and whether it is secret. Do not copy any value, prefix, or suffix from the key. | |
| Required action and permissions | Describe the required action and the permissions actually configured. Distinguish the requirement from anything not yet checked. | |
| Usage restrictions | Describe which restrictions are supported and which have been checked. Do not include IP addresses, private domains, or identifiers in a public version. | |
| Storage location | Generic name of an item in the credentials mechanism or secrets manager. Do not include the key value, an internal path, or a link that grants access. | |
| Dependent workflows | List internal workflow names only in a protected copy. Include scheduled workflows and other environments that use the same connection. | |
| Replacement plan | Who will perform it, the order for updating dependencies, and whether the provider allows overlap. This is a plan, not confirmation that the change was made. | |
| Recovery plan | What will be stopped and how work will resume if the transition fails. Reverting to the old key depends on it being valid and not exposed. | |
| New key verification | Only after completion: time of check, workflow checked, and result read back. Do not include personal information or the key value. | |
| Old key revocation verification | Only after completion: key status with the provider and evidence of revocation. A rejection check should be done only when safe and permitted; a generic error is not enough. | |
| Tracking status | Choose planned, partially completed, or verified, and explain what is still missing. Blank means no check was documented, not that the connection is working. |
Examples
These examples illustrate a possible workflow. Adapt the connections and rules to your own systems.
Business process example
A document processing workflow receives a dedicated key for a service. The key is stored in the credentials mechanism, and the workflow uses it without printing it in logs or passing it into content sent to a model.
- Record who is responsible for the connection, which environment it runs in, and what action it needs to perform.
- Select the saved credentials item in the workflow, and check that no copy of the key appears in the document content or run output.
- Before replacement, also map the scheduled job that uses the same connection. After an approved replacement, check its result separately.
This makes it possible to know what else still needs checking even if the document processing workflow has already succeeded. This is an illustrative example, not a record of a connection that was set up.
Relevant tools
- n8n
- The credentials mechanism lets you connect services without inserting the key into every workflow field. n8n encrypts credentials at rest; you still need to check which workflows use them and what is written to run output.
What to check
- Do not store a secret key in public code, a URL, or a sample file. If the provider requires a particular method for passing the key, also check how to prevent it from appearing in logs.
- A limited permission does not make a secret key safe to publish. In Stripe, a restricted key is still secret.
- Do not mark a replacement complete just because the credentials screen was saved. Check all dependent workflows and the status of the old key.
- Do not assume a webhook signing secret is an API key. In Stripe, these are separate secrets; replacing one is not a substitute for handling the other.
Related terms
Sources
- Google Cloud: API key types (reviewed Oct 19, 2026)
- Stripe: Key types, permissions, and rotation (reviewed Oct 19, 2026)
- Google Cloud: Storing and restricting keys (reviewed Oct 19, 2026)
- n8n: Encrypting credentials at rest (reviewed Oct 19, 2026)
- OWASP: Secrets management, ownership, and revoking access (reviewed Oct 19, 2026)