Skip to main content
GET
/
api
/
v4
/
secrets
cURL
curl --request GET \
  --url https://us.infisical.com/api/v4/secrets \
  --header 'Authorization: Bearer <token>'
{
  "secrets": [
    {
      "id": "<string>",
      "_id": "<string>",
      "workspace": "<string>",
      "environment": "<string>",
      "version": 123,
      "type": "<string>",
      "secretKey": "<string>",
      "secretValue": "<string>",
      "secretComment": "<string>",
      "secretReminderNote": "<string>",
      "secretReminderRepeatDays": 123,
      "skipMultilineEncoding": false,
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "actor": {
        "actorId": "<string>",
        "actorType": "<string>",
        "name": "<string>",
        "membershipId": "<string>"
      },
      "isRotatedSecret": true,
      "rotationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "secretPath": "<string>",
      "secretValueHidden": true,
      "secretMetadata": [
        {
          "key": "<string>",
          "value": ""
        }
      ],
      "tags": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "slug": "<string>",
          "color": "<string>",
          "name": "<string>"
        }
      ]
    }
  ],
  "imports": [
    {
      "secretPath": "<string>",
      "environment": "<string>",
      "folderId": "<string>",
      "secrets": [
        {
          "id": "<string>",
          "_id": "<string>",
          "workspace": "<string>",
          "environment": "<string>",
          "version": 123,
          "type": "<string>",
          "secretKey": "<string>",
          "secretValue": "<string>",
          "secretComment": "<string>",
          "secretReminderNote": "<string>",
          "secretReminderRepeatDays": 123,
          "skipMultilineEncoding": false,
          "actor": {
            "actorId": "<string>",
            "actorType": "<string>",
            "name": "<string>",
            "membershipId": "<string>"
          },
          "isRotatedSecret": true,
          "rotationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "secretValueHidden": true,
          "secretMetadata": [
            {
              "key": "<string>",
              "value": ""
            }
          ]
        }
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

An access token in Infisical

Query Parameters

metadataFilter
string

The secret metadata key-value pairs to filter secrets by. When querying for multiple metadata pairs, the query is treated as an AND operation. Secret metadata format is key=value1,value=value2|key=value3,value=value4.

projectId
string

The ID of the project to list secrets from.

environment
string

The slug of the environment to list secrets from.

secretPath
string
default:/

The secret path to list secrets from.

viewSecretValue
enum<string>
default:true

Whether or not to retrieve the secret value.

Available options:
true,
false
expandSecretReferences
enum<string>
default:false

Whether or not to expand secret references.

Available options:
true,
false
recursive
enum<string>
default:false

Whether or not to fetch all secrets from the specified base path, and all of its subdirectories. Note, the max depth is 20 deep.

Available options:
true,
false
include_imports
enum<string>
default:false

Weather to include imported secrets or not.

Available options:
true,
false
tagSlugs
string

The comma separated tag slugs to filter secrets.

Response

Default Response

secrets
object[]
required
imports
object[]