Skip to main content
Using Infisical’s API to read/write secrets with E2EE disabled allows you to create, update, and retrieve secrets in plaintext. Effectively, this means each such secret operation only requires 1 HTTP call.
Retrieve all secrets for an Infisical project and environment.
curl --location --request GET 'https://app.infisical.com/api/v3/secrets/raw?environment=environment&workspaceId=workspaceId' \
    --header 'Authorization: Bearer serviceToken'

When using a service token with access to a single environment and path, you don’t need to provide request parameters because the server will automatically scope the request to the defined environment/secrets path of the service token used. For all other cases, request parameters are required.

workspaceId
string
required
The ID of the workspace
environment
string
required
The environment slug
secretPath
string
default:"/"
Path to secrets in workspace
Create a secret in Infisical.
curl --location --request POST 'https://app.infisical.com/api/v3/secrets/raw/secretName' \
    --header 'Authorization: Bearer serviceToken' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "workspaceId": "workspaceId",
        "environment": "environment",
        "type": "shared",
        "secretValue": "secretValue",
        "secretPath": "/"
    }'
secretName
string
required
Name of secret to create
workspaceId
string
required
The ID of the workspace
environment
string
required
The environment slug
secretValue
string
required
Value of secret
secretComment
string
Comment of secret
secretPath
string
default:"/"
Path to secret in workspace
type
string
default:"shared"
The type of the secret. Valid options are “shared” or “personal”
Retrieve a secret from Infisical.
curl --location --request GET 'https://app.infisical.com/api/v3/secrets/raw/secretName?workspaceId=workspaceId&environment=environment' \
    --header 'Authorization: Bearer serviceToken'
secretName
string
required
Name of secret to retrieve
workspaceId
string
required
The ID of the workspace
environment
string
required
The environment slug
secretPath
string
default:"/"
Path to secrets in workspace
type
string
default:"personal"
The type of the secret. Valid options are “shared” or “personal”
Update an existing secret in Infisical.
curl --location --request PATCH 'https://app.infisical.com/api/v3/secrets/raw/secretName' \
    --header 'Authorization: Bearer serviceToken' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "workspaceId": "workspaceId",
        "environment": "environment",
        "type": "shared",
        "secretValue": "secretValue",
        "secretPath": "/"
    }'
secretName
string
required
Name of secret to update
workspaceId
string
required
The ID of the workspace
environment
string
required
The environment slug
secretValue
string
required
Value of secret
secretPath
string
default:"/"
Path to secret in workspace.
type
string
default:"shared"
The type of the secret. Valid options are “shared” or “personal”
Delete a secret in Infisical.
curl --location --request DELETE 'https://app.infisical.com/api/v3/secrets/raw/secretName' \
--header 'Authorization: Bearer serviceToken' \
--header 'Content-Type: application/json' \
--data-raw '{
    "workspaceId": "workspaceId",
    "environment": "environment",
    "type": "shared",
    "secretPath": "/"
}'
secretName
string
required
Name of secret to update
workspaceId
string
required
The ID of the workspace
environment
string
required
The environment slug
secretPath
string
default:"/"
Path to secret in workspace.
type
string
default:"personal"
The type of the secret. Valid options are “shared” or “personal”