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
- Always authenticate via machine identity Universal Auth first — use the Universal Auth login endpoint to obtain a Bearer token before making other API calls
- Use /api/v4/secrets for secret operations — v1/v2/v3 secret endpoints are deprecated
- Use /api/v1/projects, not /api/v1/workspace — workspace endpoints are deprecated
/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 }
- Region selection — US region: us.infisical.com, EU region: eu.infisical.com
- Service tokens are deprecated — use machine identities instead
- 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)
- Batch over loop — use
POST/PATCH/DELETE /api/v4/secrets/batch rather than per-secret calls; batch delete takes secrets: [{ secretKey }]
Reference Files
- Authentication — Universal Auth login, auth endpoints, token patterns, deprecated service tokens
- Secrets Endpoints — CRUD operations on secrets using /api/v4/secrets
- Projects and Identities — project management, environments, members, identities, groups, folders
- Pagination and Rate Limits — offset/limit pagination, cloud rate limits, content-type requirements
Quick Start
1. Authenticate with Universal Auth
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:
{
"accessToken": "eyJ...",
"expiresIn": 3600,
"accessTokenMaxTTL": 86400,
"tokenType": "Bearer"
}
2. Use the Token for Subsequent Requests
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.
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:
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
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
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
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
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
1---2name: infisical-api3description: 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).4---5
6# Infisical API Skill
7
8This skill provides guidance for working with the Infisical REST API. Use it when you need to:
9- Authenticate via machine identity Universal Auth
10- List, get, create, update, or delete secrets
11- Manage projects, environments, and members
12- Work with machine identities and identity auth methods
13- Handle pagination and understand rate limits
14- Choose the correct API version and region
15
16## Not this skill
17
18| If the user wants... | Use |
19|----------------------|-----|
20| The CLI, an SDK, or a platform integration | `infisical-setup` |
21| Terraform/HCL | `infisical-terraform` |
22| **Human** login via SAML/OIDC/LDAP | `infisical-sso` |
23| Roles, permissions, and approval policies | `infisical-access-control` |
24| The KMS encrypt/decrypt/sign endpoints | `infisical-kms` |
25| Certificate endpoints | `infisical-pki` |
26| Secret sync / rotation / App Connection endpoints | the matching product skill |
27
28This skill covers the core secrets, projects, and identities API. Product-specific endpoints are
29documented in their own skills, where the surrounding concepts live.
30
31## Guiding Principles
32
331. **Always authenticate via machine identity Universal Auth first** — use the Universal Auth login endpoint to obtain a Bearer token before making other API calls
342. **Use /api/v4/secrets for secret operations** — v1/v2/v3 secret endpoints are deprecated
353. **Use /api/v1/projects, not /api/v1/workspace** — workspace endpoints are deprecated
364. **`/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 }`
375. **Region selection** — US region: us.infisical.com, EU region: eu.infisical.com
386. **Service tokens are deprecated** — use machine identities instead
397. **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)
408. **Batch over loop** — use `POST/PATCH/DELETE /api/v4/secrets/batch` rather than per-secret calls; batch delete takes `secrets: [{ secretKey }]`
41
42## Reference Files
43
44- [Authentication](./references/authentication.md) — Universal Auth login, auth endpoints, token patterns, deprecated service tokens
45- [Secrets Endpoints](./references/secrets-endpoints.md) — CRUD operations on secrets using /api/v4/secrets
46- [Projects and Identities](./references/projects-and-identities.md) — project management, environments, members, identities, groups, folders
47- [Pagination and Rate Limits](./references/pagination-and-rate-limits.md) — offset/limit pagination, cloud rate limits, content-type requirements
48
49## Quick Start
50
51### 1. Authenticate with Universal Auth
52
53```bash
54curl -X POST https://us.infisical.com/api/v1/auth/universal-auth/login \
55 -H "Content-Type: application/json" \
56 -d '{
57 "clientId": "YOUR_CLIENT_ID",
58 "clientSecret": "YOUR_CLIENT_SECRET"
59 }'
60```
61
62Response:
63```json
64{
65 "accessToken": "eyJ...",
66 "expiresIn": 3600,
67 "accessTokenMaxTTL": 86400,
68 "tokenType": "Bearer"
69}
70```
71
72### 2. Use the Token for Subsequent Requests
73
74```bash
75curl -X GET 'https://us.infisical.com/api/v4/secrets?projectId=PROJECT_ID&environment=dev' \
76 -H "Authorization: Bearer eyJ..."
77```
78
79## Common Workflows
80
81### List All Secrets in a Project
82
83Returns every secret at the path — there is no pagination on this endpoint.
84
85```bash
86curl -X GET 'https://us.infisical.com/api/v4/secrets?projectId=PROJECT_ID&environment=dev' \
87 -H "Authorization: Bearer TOKEN"
88```
89
90Add `recursive=true` to include subfolders:
91
92```bash
93curl -X GET 'https://us.infisical.com/api/v4/secrets?projectId=PROJECT_ID&environment=dev&secretPath=/&recursive=true' \
94 -H "Authorization: Bearer TOKEN"
95```
96
97Response is `{ "secrets": [...], "imports": [...] }` — no `total`, `offset`, or `limit` keys.
98
99### Create a New Secret
100
101```bash
102curl -X POST 'https://us.infisical.com/api/v4/secrets/MY_SECRET' \
103 -H "Authorization: Bearer TOKEN" \
104 -H "Content-Type: application/json" \
105 -d '{
106 "projectId": "PROJECT_ID",
107 "environment": "dev",
108 "secretPath": "/",
109 "secretValue": "super-secret-value",
110 "type": "shared"
111 }'
112```
113
114### Get a Specific Secret
115
116```bash
117curl -X GET 'https://us.infisical.com/api/v4/secrets/MY_SECRET?projectId=PROJECT_ID&environment=dev&secretPath=/' \
118 -H "Authorization: Bearer TOKEN"
119```
120
121### Update a Secret
122
123```bash
124curl -X PATCH 'https://us.infisical.com/api/v4/secrets/MY_SECRET' \
125 -H "Authorization: Bearer TOKEN" \
126 -H "Content-Type: application/json" \
127 -d '{
128 "projectId": "PROJECT_ID",
129 "environment": "dev",
130 "secretPath": "/",
131 "secretValue": "new-value"
132 }'
133```
134
135### Delete a Secret
136
137```bash
138curl -X DELETE 'https://us.infisical.com/api/v4/secrets/MY_SECRET?projectId=PROJECT_ID&environment=dev&secretPath=/' \
139 -H "Authorization: Bearer TOKEN"
140```
141
142## Important Notes
143
144- Include `Content-Type: application/json` on any request that carries a JSON body
145- Tokens expire after `expiresIn` seconds; implement refresh logic for long-running operations
146- For self-hosted deployments, replace `us.infisical.com` with your custom domain
147- Secret operations support all 13 machine identity auth methods (Universal, Token, Kubernetes, GCP, AliCloud, AWS, Azure, TLS Cert, OCI, OIDC, JWT, LDAP, SPIFFE)
148- `viewSecretValue` defaults to `true`; set it to `false` when you only need key names
149- The `recursive` parameter on list secrets includes secrets in all subdirectories
150- Beyond CRUD, `/api/v4/secrets` also exposes `/move`, `/duplicate`, `/batch` (POST, PATCH, DELETE), `/id/:secretId`, and secret-reference tree endpoints