Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
docs: add docs for rotation and app connection
adilson65581cd370b6
diff --git a/docs/api-reference/endpoints/app-connections/openai/available.mdx b/docs/api-reference/endpoints/app-connections/openai/available.mdxnew file mode 100644index 0000000000..de6d54f8da--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/openai/available.mdx@@ -0,0 +1,4 @@+---+title: "Available"+openapi: "GET /api/v1/app-connections/openai/available"+---diff --git a/docs/api-reference/endpoints/app-connections/openai/create.mdx b/docs/api-reference/endpoints/app-connections/openai/create.mdxnew file mode 100644index 0000000000..6e1b46b48f--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/openai/create.mdx@@ -0,0 +1,54 @@+---+title: "Create"+openapi: "POST /api/v1/app-connections/openai"+---++<Note>+ Check out the configuration docs for [OpenAI Connections](/integrations/app-connections/openai) to learn how to obtain the required credentials.+</Note>++Creates an OpenAI app connection using an Admin API key. The connection can then be used for [OpenAI Admin API Key secret rotations](/documentation/platform/secret-rotation/openai-admin-api-key).++## Request body++| Field | Type | Required | Description |+|-------|------|----------|-------------|+| `name` | string | Yes | A unique name for the connection. |+| `method` | string | Yes | Must be `"api-key"`. |+| `credentials.apiKey` | string | Yes | Your OpenAI [Admin API key](https://platform.openai.com/settings/organization/admin-keys). |++## Sample request++```bash+curl --request POST \+ --url https://app.infisical.com/api/v1/app-connections/openai \+ --header 'Content-Type: application/json' \+ --header 'Authorization: Bearer <ACCESS_TOKEN>' \+ --data '{+ "name": "my-openai-connection",+ "method": "api-key",+ "credentials": {+ "apiKey": "<YOUR-ADMIN-API-KEY>"+ }+ }'+```++## Sample response++```json+{+ "appConnection": {+ "id": "<connection-id>",+ "name": "my-openai-connection",+ "description": null,+ "version": 1,+ "orgId": "<org-id>",+ "createdAt": "<ISO8601>",+ "updatedAt": "<ISO8601>",+ "isPlatformManagedCredentials": false,+ "app": "openai",+ "method": "api-key",+ "credentials": {}+ }+}+```diff --git a/docs/api-reference/endpoints/app-connections/openai/delete.mdx b/docs/api-reference/endpoints/app-connections/openai/delete.mdxnew file mode 100644index 0000000000..085fa8c217--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/openai/delete.mdx@@ -0,0 +1,4 @@+---+title: "Delete"+openapi: "DELETE /api/v1/app-connections/openai/{connectionId}"+---diff --git a/docs/api-reference/endpoints/app-connections/openai/get-by-id.mdx b/docs/api-reference/endpoints/app-connections/openai/get-by-id.mdxnew file mode 100644index 0000000000..375744b666--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/openai/get-by-id.mdx@@ -0,0 +1,4 @@+---+title: "Get by ID"+openapi: "GET /api/v1/app-connections/openai/{connectionId}"+---diff --git a/docs/api-reference/endpoints/app-connections/openai/get-by-name.mdx b/docs/api-reference/endpoints/app-connections/openai/get-by-name.mdxnew file mode 100644index 0000000000..2a11bbee9e--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/openai/get-by-name.mdx@@ -0,0 +1,4 @@+---+title: "Get by Name"+openapi: "GET /api/v1/app-connections/openai/connection-name/{connectionName}"+---diff --git a/docs/api-reference/endpoints/app-connections/openai/list.mdx b/docs/api-reference/endpoints/app-connections/openai/list.mdxnew file mode 100644index 0000000000..e483fbe09e--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/openai/list.mdx@@ -0,0 +1,4 @@+---+title: "List"+openapi: "GET /api/v1/app-connections/openai"+---diff --git a/docs/api-reference/endpoints/app-connections/openai/update.mdx b/docs/api-reference/endpoints/app-connections/openai/update.mdxnew file mode 100644index 0000000000..bd1c262e7c--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/openai/update.mdx@@ -0,0 +1,8 @@+---+title: "Update"+openapi: "PATCH /api/v1/app-connections/openai/{connectionId}"+---++<Note>+ Check out the configuration docs for [OpenAI Connections](/integrations/app-connections/openai) to learn how to obtain the required credentials.+</Note>diff --git a/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/create.mdx b/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/create.mdxnew file mode 100644index 0000000000..bfe6d6f01b--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/create.mdx@@ -0,0 +1,74 @@+---+title: "Create"+openapi: "POST /api/v2/secret-rotations/openai-admin-api-key"+---++<Note>+ Check out the configuration docs for [OpenAI Admin API Key Rotations](/documentation/platform/secret-rotation/openai-admin-api-key) to learn how to obtain the required parameters.+</Note>++Creates an OpenAI Admin API Key secret rotation. Infisical will create and rotate admin API keys via your [OpenAI connection](/integrations/app-connections/openai) and write them to the specified secret path.++## Request body++| Field | Type | Required | Description |+|-------|------|----------|-------------|+| `name` | string | Yes | A unique name for the rotation (max 100 characters). |+| `projectId` | string (UUID) | Yes | The project ID. |+| `connectionId` | string (UUID) | Yes | ID of the OpenAI app connection (Admin API key). |+| `environment` | string | Yes | Environment slug (e.g. `dev`, `prod`). |+| `secretPath` | string | Yes | Path where the generated API key secret will be stored. |+| `isAutoRotationEnabled` | boolean | Yes | Whether to rotate automatically on the schedule. |+| `rotationInterval` | number | Yes | Days between rotations (e.g. `30`). |+| `rotateAtUtc` | object | Yes | Time of day (UTC) to run rotation: `{ "hours", "minutes" }`. |+| `parameters.name` | string | Yes | Name for the generated admin API key in OpenAI (max 100 characters). |+| `secretsMapping.apiKey` | string | Yes | Secret key name to store the generated API key (e.g. `OPENAI_ADMIN_API_KEY`). |+| `description` | string | No | Optional description. |++## Sample request++```bash+curl --request POST \+ --url https://us.infisical.com/api/v2/secret-rotations/openai-admin-api-key \+ --header 'Content-Type: application/json' \+ --header 'Authorization: Bearer <ACCESS_TOKEN>' \+ --data '{+ "name": "my-openai-rotation",+ "projectId": "<project-id>",+ "description": "OpenAI admin API key rotation",+ "connectionId": "<openai-connection-id>",+ "environment": "dev",+ "secretPath": "/",+ "isAutoRotationEnabled": true,+ "rotationInterval": 30,+ "rotateAtUtc": { "hours": 0, "minutes": 0 },+ "parameters": {+ "name": "my-app-key"+ },+ "secretsMapping": {+ "apiKey": "OPENAI_ADMIN_API_KEY"+ }+ }'+```++## Sample response++```json+{+ "secretRotation": {+ "id": "<rotation-id>",+ "name": "my-openai-rotation",+ "description": "OpenAI admin API key rotation",+ "secretsMapping": { "apiKey": "OPENAI_ADMIN_API_KEY" },+ "isAutoRotationEnabled": true,+ "activeIndex": 0,+ "connectionId": "<openai-connection-id>",+ "rotationInterval": 30,+ "rotateAtUtc": { "hours": 0, "minutes": 0 },+ "type": "openai-admin-api-key",+ "parameters": {+ "name": "my-app-key"+ }+ }+}+```diff --git a/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/delete.mdx b/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/delete.mdxnew file mode 100644index 0000000000..6b63654a59--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/delete.mdx@@ -0,0 +1,4 @@+---+title: "Delete"+openapi: "DELETE /api/v2/secret-rotations/openai-admin-api-key/{rotationId}"+---diff --git a/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/get-by-id.mdx b/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/get-by-id.mdxnew file mode 100644index 0000000000..1d101b67bb--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/get-by-id.mdx@@ -0,0 +1,4 @@+---+title: "Get by ID"+openapi: "GET /api/v2/secret-rotations/openai-admin-api-key/{rotationId}"+---diff --git a/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/get-by-name.mdx b/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/get-by-name.mdxnew file mode 100644index 0000000000..6aaf513ba6--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/get-by-name.mdx@@ -0,0 +1,4 @@+---+title: "Get by Name"+openapi: "GET /api/v2/secret-rotations/openai-admin-api-key/rotation-name/{rotationName}"+---diff --git a/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/get-generated-credentials-by-id.mdx b/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/get-generated-credentials-by-id.mdxnew file mode 100644index 0000000000..087d396c75--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/get-generated-credentials-by-id.mdx@@ -0,0 +1,4 @@+---+title: "Get Credentials by ID"+openapi: "GET /api/v2/secret-rotations/openai-admin-api-key/{rotationId}/generated-credentials"+---diff --git a/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/list.mdx b/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/list.mdxnew file mode 100644index 0000000000..1710db5822--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/list.mdx@@ -0,0 +1,4 @@+---+title: "List"+openapi: "GET /api/v2/secret-rotations/openai-admin-api-key"+---diff --git a/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/rotate-secrets.mdx b/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/rotate-secrets.mdxnew file mode 100644index 0000000000..9f6d9221d1--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/rotate-secrets.mdx@@ -0,0 +1,4 @@+---+title: "Rotate Secrets"+openapi: "POST /api/v2/secret-rotations/openai-admin-api-key/{rotationId}/rotate-secrets"+---diff --git a/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/update.mdx b/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/update.mdxnew file mode 100644index 0000000000..57831a588e--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/openai-admin-api-key/update.mdx@@ -0,0 +1,8 @@+---+title: "Update"+openapi: "PATCH /api/v2/secret-rotations/openai-admin-api-key/{rotationId}"+---++<Note>+ Check out the configuration docs for [OpenAI Admin API Key Rotations](/documentation/platform/secret-rotation/openai-admin-api-key) to learn how to obtain the required parameters.+</Note>diff --git a/docs/docs.json b/docs/docs.jsonindex 4b2717289d..2a5b805e3e 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -158,6 +158,7 @@"integrations/app-connections/oci","integrations/app-connections/octopus-deploy","integrations/app-connections/okta",+ "integrations/app-connections/openai","integrations/app-connections/openrouter","integrations/app-connections/oracledb","integrations/app-connections/ovh",@@ -498,6 +499,7 @@"documentation/platform/secret-rotation/mysql-credentials","documentation/platform/secret-rotation/hp-ilo-local-account","documentation/platform/secret-rotation/okta-client-secret",+ "documentation/platform/secret-rotation/openai-admin-api-key","documentation/platform/secret-rotation/openrouter-api-key","documentation/platform/secret-rotation/oracledb-credentials","documentation/platform/secret-rotation/postgres-credentials",@@ -1892,6 +1894,18 @@"api-reference/endpoints/app-connections/okta/delete"]},+ {+ "group": "OpenAI",+ "pages": [+ "api-reference/endpoints/app-connections/openai/list",+ "api-reference/endpoints/app-connections/openai/available",+ "api-reference/endpoints/app-connections/openai/get-by-id",+ "api-reference/endpoints/app-connections/openai/get-by-name",+ "api-reference/endpoints/app-connections/openai/create",+ "api-reference/endpoints/app-connections/openai/update",+ "api-reference/endpoints/app-connections/openai/delete"+ ]+ },{"group": "OpenRouter","pages": [@@ -2508,6 +2522,19 @@"api-reference/endpoints/secret-rotations/okta-client-secret/update"]},+ {+ "group": "OpenAI Admin API Key",+ "pages": [+ "api-reference/endpoints/secret-rotations/openai-admin-api-key/create",+ "api-reference/endpoints/secret-rotations/openai-admin-api-key/delete",+ "api-reference/endpoints/secret-rotations/openai-admin-api-key/get-by-id",+ "api-reference/endpoints/secret-rotations/openai-admin-api-key/get-by-name",+ "api-reference/endpoints/secret-rotations/openai-admin-api-key/get-generated-credentials-by-id",+ "api-reference/endpoints/secret-rotations/openai-admin-api-key/list",+ "api-reference/endpoints/secret-rotations/openai-admin-api-key/rotate-secrets",+ "api-reference/endpoints/secret-rotations/openai-admin-api-key/update"+ ]+ },{"group": "OracleDB Credentials","pages": [diff --git a/docs/documentation/platform/secret-rotation/openai-admin-api-key.mdx b/docs/documentation/platform/secret-rotation/openai-admin-api-key.mdxnew file mode 100644index 0000000000..7d1384534a--- /dev/null+++ b/docs/documentation/platform/secret-rotation/openai-admin-api-key.mdx@@ -0,0 +1,119 @@+---+title: "OpenAI Admin API Key"+description: "Learn how to automatically rotate OpenAI admin API keys."+---++<Note>+ **Rotation Type: Dual-Phase**++ This rotation maintains two active credential sets with overlapping validity, ensuring zero-downtime during rotation cycles.+</Note>++## Prerequisites++- Create an [OpenAI Connection](/integrations/app-connections/openai) using an **Admin API key**. That connection is used to create and delete admin API keys on your behalf during rotation.++## Create an OpenAI Admin API Key Rotation in Infisical++<Tabs>+ <Tab title="Infisical UI">+ 1. Navigate to your Secret Manager Project's Dashboard and select **Add Secret Rotation** from the actions dropdown.++ ++ 2. Select the **OpenAI Admin API Key** option.++ ++ 3. Configure the rotation behavior, then click **Next**.++ ++ - **OpenAI Connection** – The connection (with an Admin API key) that will create and delete admin API keys during rotation.+ - **Rotation Interval** – The interval, in days, after which a rotation is triggered.+ - **Rotate At** – The local time of day when rotation runs once the interval has elapsed.+ - **Auto-Rotation Enabled** – Whether to rotate automatically on the interval. Turn off to rotate only manually or pause rotation.++ 4. Set the OpenAI Admin API Key parameters, then click **Next**.++ ++ - **Key name** – The name for the generated OpenAI admin API key (required, up to 100 characters). Infisical appends a timestamp suffix to this name in the OpenAI dashboard (e.g. `my-app-key-1720268400000`) so that the active and previous keys stay distinguishable during the overlap window. Keys are deleted by their key ID, so the name is used only for identification.++ 5. Specify the secret name that the rotated API key will be mapped to. Then click **Next**.++ ++ - **API Key** – The name of the secret in Infisical where the rotated admin API key value will be stored.++ 6. Give your rotation a name and description (optional). Then click **Next**.++ ++ - **Name** – A slug-friendly name for this rotation configuration.+ - **Description** (optional) – Notes about this rotation.++ 7. Review your configuration, then click **Create Secret Rotation**.++ ++ 8. Your **OpenAI Admin API Key** rotation is created. The current admin API key is available as a secret at the mapped path. Rotations will create a new key, switch the active secret to it, then revoke the previous key for zero-downtime rotation.++ + </Tab>+ <Tab title="API">+ To create an OpenAI Admin API Key rotation, call the [Create OpenAI Admin API Key Rotation](/api-reference/endpoints/secret-rotations/openai-admin-api-key/create) API endpoint.++ ### Sample request++ ```bash Request+ curl --request POST \+ --url https://us.infisical.com/api/v2/secret-rotations/openai-admin-api-key \+ --header 'Content-Type: application/json' \+ --data '{+ "name": "my-openai-rotation",+ "projectId": "<project-id>",+ "description": "OpenAI admin API key rotation",+ "connectionId": "<openai-connection-id>",+ "environment": "dev",+ "secretPath": "/",+ "isAutoRotationEnabled": true,+ "rotationInterval": 30,+ "rotateAtUtc": {+ "hours": 0,+ "minutes": 0+ },+ "parameters": {+ "name": "my-app-key"+ },+ "secretsMapping": {+ "apiKey": "OPENAI_ADMIN_API_KEY"+ }+ }'+ ```++ ### Sample response++ ```bash Response+ {+ "secretRotation": {+ "id": "<rotation-id>",+ "name": "my-openai-rotation",+ "description": "OpenAI admin API key rotation",+ "secretsMapping": {+ "apiKey": "OPENAI_ADMIN_API_KEY"+ },+ "isAutoRotationEnabled": true,+ "activeIndex": 0,+ "connectionId": "<openai-connection-id>",+ "rotationInterval": 30,+ "rotateAtUtc": { "hours": 0, "minutes": 0 },+ "type": "openai-admin-api-key",+ "parameters": {+ "name": "my-app-key"+ }+ }+ }+ ```+ </Tab>+</Tabs>diff --git a/docs/integrations/app-connections/openai.mdx b/docs/integrations/app-connections/openai.mdxnew file mode 100644index 0000000000..3802e39dfc--- /dev/null+++ b/docs/integrations/app-connections/openai.mdx@@ -0,0 +1,99 @@+---+title: "OpenAI Connection"+description: "Learn how to configure an OpenAI connection for Infisical."+---++Infisical supports connecting to OpenAI using an **API Key** (an Admin API key). This connection is used to manage and rotate OpenAI admin API keys via [Secret Rotation](/documentation/platform/secret-rotation/openai-admin-api-key).++## Prerequisites++You need an OpenAI **Admin API key** created by an **Organization Owner**. Admin API keys are organization-scoped and can manage organization resources such as users, projects, and API keys. A regular project API key (for example, one starting with `sk-`) does not have these permissions and will fail validation.++## Create an OpenAI Admin API Key++<Steps>+ <Step title="Navigate to Admin Keys">+ In the [OpenAI dashboard](https://platform.openai.com/settings/organization/admin-keys), go to **Settings** → **Organization** → **Admin keys** and click **Create new admin key**.++ + </Step>+ <Step title="Name and create the key">+ Give the key a descriptive name (e.g. `infisical-rotation`) and create it. Copy the generated Admin API key. It will only be shown once.++ + </Step>+</Steps>++<Tip>+ Create a dedicated Admin API key for Infisical rather than reusing an existing one. This makes it easy to rotate or revoke access independently.+</Tip>++## Create OpenAI Connection in Infisical++<Tabs>+ <Tab title="Infisical UI">+ <Steps>+ <Step title="Navigate to App Connections">+ In your Infisical dashboard, go to **Organization Settings** → **App Connections**.++ + </Step>+ <Step title="Select OpenAI Connection">+ Click **Add Connection** and choose **OpenAI** from the list of available connections.++ + </Step>+ <Step title="Fill out Connection Form">+ Complete the form with:+ - A **name** for the connection (e.g. `openai-prod`)+ - An optional **description**+ - Your **Admin API Key** (from the steps above)++ + </Step>+ <Step title="Connection Created">+ After clicking **Create**, Infisical validates the key against the OpenAI API. Your **OpenAI Connection** is then ready to use for [OpenAI Admin API Key Secret Rotation](/documentation/platform/secret-rotation/openai-admin-api-key).++ + </Step>+ </Steps>+ </Tab>+ <Tab title="API">+ Create an OpenAI connection via the [Create OpenAI Connection](/api-reference/endpoints/app-connections/openai/create) API endpoint.++ ### Sample request++ ```bash Request+ curl --request POST \+ --url https://app.infisical.com/api/v1/app-connections/openai \+ --header 'Content-Type: application/json' \+ --data '{+ "name": "my-openai-connection",+ "method": "api-key",+ "credentials": {+ "apiKey": "<YOUR-ADMIN-API-KEY>"+ }+ }'+ ```++ ### Sample response++ ```bash Response+ {+ "appConnection": {+ "id": "e5d18aca-86f7-4026-a95e-efb8aeb0d8e6",+ "name": "my-openai-connection",+ "description": null,+ "version": 1,+ "orgId": "6f03caa1-a5de-43ce-b127-95a145d3464c",+ "createdAt": "2025-04-23T19:46:34.831Z",+ "updatedAt": "2025-04-23T19:46:34.831Z",+ "isPlatformManagedCredentials": false,+ "app": "openai",+ "method": "api-key",+ "credentials": {}+ }+ }+ ```+ </Tab>+</Tabs>