Skip to main content
skill CX Codex

infisical-api — Claude Code skill: Infisical REST API guide

A skill that teaches your agent to call the Infisical REST API: secrets, projects, environments, machine identities. Useful when secrets get edited from code, not the dashboard.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Infisical/ai-skills --skill infisical-api -a claude-code
Open on GitHub

What infisical-api does

This skill tells the agent how to talk to the Infisical REST API. It ships reference files for authentication, secret endpoints, projects and identities, pagination and rate limits. The agent gets ready curl examples: Universal Auth login, listing secrets, creating, reading, updating and deleting them.

One rule runs through the whole thing: authenticate with a machine identity first, then make other calls. Tokens expire after expiresIn seconds, so long-running work needs refresh logic. Secret operations go through /api/v4/secrets only — v1/v2/v3 are deprecated, and so is /api/v1/workspace. Region is picked by domain: us.infisical.com or eu.infisical.com, or your own host for self-hosted.

Worth knowing before you wire this into a script: /api/v4/secrets is not paginated. It ignores offset and limit and returns every secret at the requested path, so narrow the result with secretPath, recursive, tagSlugs or metadataFilter. Rate limits apply to self-hosted too, not just cloud — instance defaults are 60 reads/min, 200 writes/min, 60 secrets-ops/min and 60 auth/min per IP, and self-hosted admins can change them. On a 429 the skill says to read retry-after as seconds remaining, not a timestamp. For bulk edits, batch calls beat a per-secret loop.

What it helps with

  • get a Bearer token through Universal Auth without guessing the request shape
  • create, update or delete a secret from a script instead of the dashboard
  • pull every secret in a project, subfolders included
  • figure out why the secrets list ignores offset and limit
  • handle a 429 and read retry-after correctly

Example prompts for the agent

  • log in to Infisical with Universal Auth and show me the token
  • create secret MY_SECRET in the dev environment of project PROJECT_ID
  • list all secrets in the project recursively, subfolders included

How to install infisical-api

1Skills CLI (Vercel)

npx skills add Infisical/ai-skills --skill infisical-api -a claude-code

2Manually: put the files in place

~/.claude/skills/infisical-api/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/infisical-api/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about infisical-api

How do I install infisical-api in Claude?

Run npx skills add Infisical/ai-skills --skill infisical-api -a claude-code. The skill lands in ~/.claude/skills/infisical-api/SKILL.md.

What does infisical-api do?

It gives the agent instructions for the Infisical REST API: machine identity auth, secret CRUD, projects, environments, identities, pagination and rate limits.

Can I use it for the Infisical CLI or SDKs?

No, it covers the REST API only. The CLI, SDKs and platform integrations live in infisical-setup, KMS crypto endpoints in infisical-kms, certificates in infisical-pki.

Source text

SKILL.md · MIT
---
name: infisical-api
description: Interact with the Infisical REST API to manage secrets, projects, environments, machine identities, and more. Supports secret CRUD operations, machine identity authentication, pagination, and rate limiting on cloud deployments. Not for the CLI/SDKs (infisical-setup), KMS crypto endpoints (infisical-kms), certificate endpoints (infisical-pki), or human SSO login (infisical-sso).
triggers:
  - infisical API
  - REST endpoint
  - API authentication
  - bearer token
  - list secrets API
  - create secret API
  - get secret
  - update secret
  - delete secret
  - machine identity
  - universal auth
  - project endpoints
  - secret operations
---

# Infisical API Skill

This skill provides guidance for working with the Infisical REST API. Use it when you need to:
- Authenticate via machine identity Universal Auth
- List, get, create, update, or delete secrets
- Manage projects, environments, and members
- Work with machine identities and identity auth methods
- Handle pagination and understand rate limits
- Choose the correct API version and region

## Not this skill

| If the user wants... | Use |
|----------------------|-----|
| The CLI, an SDK, or a platform integration | `infisical-setup` |
| Terraform/HCL | `infisical-terraform` |
| **Human** login via SAML/OIDC/LDAP | `infisical-sso` |
| Roles, permissions, and approval policies | `infisical-access-control` |
| The KMS encrypt/decrypt/sign endpoints | `infisical-kms` |
| Certificate endpoints | `infisical-pki` |
| Secret sync / rotation / App Connection endpoints | the matching product skill |

This skill covers the core secrets, projects, and identities API. Product-specific endpoints are
documented in their own skills, where the surrounding concepts live.

## Guiding Principles

1. **Always authenticate via machine identity Universal Auth first** — use the Universal Auth login endpoint to obtain a Bearer token before making other API calls
2. **Use /api/v4/secrets for secret operations** — v1/v2/v3 secret endpoints are deprecated
3. **Use /api/v1/projects, not /api/v1/workspace** — workspace endpoints are deprecated
4. **`/api/v4/secrets` is not paginated** — it returns every secret at the requested path in one response and ignores `offset`/`limit`. Scope results with `secretPath`, `recursive`, `tagSlugs`, or `metadataFilter` instead. Pagination exists on other collection endpoints (identities, memberships, certificates), which return `{ <resource>: [...], totalCount: n }`
5. **Region selection** — US region: us.infisical.com, EU region: eu.infisical.com
6. **Service tokens are deprecated** — use machine identities instead
7. **Rate limits apply to self-hosted too** — they are not cloud-only. Instance defaults are 60 reads/min, 200 writes/min, 60 secrets-ops/min, 60 auth/min per IP; self-hosted admins can change them, and cloud limits vary by plan. On a 429, honor the `retry-after` header (seconds remaining, not a timestamp)
8. **Batch over loop** — use `POST/PATCH/DELETE /api/v4/secrets/batch` rather than per-secret calls; batch delete takes `secrets: [{ secretKey }]`

## Reference Files

- [Authentication](./references/authentication.md) — Universal Auth login, auth endpoints, token patterns, deprecated service tokens
- [Secrets Endpoints](./references/secrets-endpoints.md) — CRUD operations on secrets using /api/v4/secrets
- [Projects and Identities](./references/projects-and-identities.md) — project management, environments, members, identities, groups, folders
- [Pagination and Rate Limits](./references/pagination-and-rate-limits.md) — offset/limit pagination, cloud rate limits, content-type requirements

## Quick Start

### 1. Authenticate with Universal Auth

```bash
curl -X POST https://us.infisical.com/api/v1/auth/universal-auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "clientId": "YOUR_CLIENT_ID",
    "clientSecret": "YOUR_CLIENT_SECRET"
  }'
```

Response:
```json
{
  "accessToken": "eyJ...",
  "expiresIn": 3600,
  "accessTokenMaxTTL": 86400,
  "tokenType": "Bearer"
}
```

### 2. Use the Token for Subsequent Requests

```bash
curl -X GET 'https://us.infisical.com/api/v4/secrets?projectId=PROJECT_ID&environment=dev' \
  -H "Authorization: Bearer eyJ..."
```

## Common Workflows

### List All Secrets in a Project

Returns every secret at the path — there is no pagination on this endpoint.

```bash
curl -X GET 'https://us.infisical.com/api/v4/secrets?projectId=PROJECT_ID&environment=dev' \
  -H "Authorization: Bearer TOKEN"
```

Add `recursive=true` to include subfolders:

```bash
curl -X GET 'https://us.infisical.com/api/v4/secrets?projectId=PROJECT_ID&environment=dev&secretPath=/&recursive=true' \
  -H "Authorization: Bearer TOKEN"
```

Response is `{ "secrets": [...], "imports": [...] }` — no `total`, `offset`, or `limit` keys.

### Create a New Secret

```bash
curl -X POST 'https://us.infisical.com/api/v4/secrets/MY_SECRET' \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": "PROJECT_ID",
    "environment": "dev",
    "secretPath": "/",
    "secretValue": "super-secret-value",
    "type": "shared"
  }'
```

### Get a Specific Secret

```bash
curl -X GET 'https://us.infisical.com/api/v4/secrets/MY_SECRET?projectId=PROJECT_ID&environment=dev&secretPath=/' \
  -H "Authorization: Bearer TOKEN"
```

### Update a Secret

```bash
curl -X PATCH 'https://us.infisical.com/api/v4/secrets/MY_SECRET' \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": "PROJECT_ID",
    "environment": "dev",
    "secretPath": "/",
    "secretValue": "new-value"
  }'
```

### Delete a Secret

```bash
curl -X DELETE 'https://us.infisical.com/api/v4/secrets/MY_SECRET?projectId=PROJECT_ID&environment=dev&secretPath=/' \
  -H "Authorization: Bearer TOKEN"
```

## Important Notes

- Include `Content-Type: application/json` on any request that carries a JSON body
- Tokens expire after `expiresIn` seconds; implement refresh logic for long-running operations
- For self-hosted deployments, replace `us.infisical.com` with your custom domain
- Secret operations support all 13 machine identity auth methods (Universal, Token, Kubernetes, GCP, AliCloud, AWS, Azure, TLS Cert, OCI, OIDC, JWT, LDAP, SPIFFE)
- `viewSecretValue` defaults to `true`; set it to `false` when you only need key names
- The `recursive` parameter on list secrets includes secrets in all subdirectories
- Beyond CRUD, `/api/v4/secrets` also exposes `/move`, `/duplicate`, `/batch` (POST, PATCH, DELETE), `/id/:secretId`, and secret-reference tree endpoints

© Infisical · MIT · Infisical/ai-skills

Similar skills

Everything for Security →

From the same set3

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor