Skip to the page

Preview importing a .env file into a secret group

POST/v1/organisations/{id}/environments/{envId}/secrets/import

Operation secrets.import · since 2026-11-05 · stable

Needs a session withwritescopeAnswers200 OK

A previewed change; apply it with changes.apply.

Path parameters

idstring (uuid)required
The organisation id.
envIdstring (uuid)required
The environment id.

Body (JSON)

Fields not listed here are refused.

namestringrequired
The secret group, new or existing.
dotenvstringrequired
The .env file's text. The whole body is at most 64 KB.
variablesarray of namesoptional
Names to keep as plain variables rather than secrets.

Errors

Every error is { "error", "message", "detail"? } (Errors and references). Besides the codes any route can answer.

POST/v1/organisations/{id}/environments/{envId}/secrets/import
curl -X POST "https://api.rykloud.com/v1/organisations/$ORG_ID/environments/$ENV_ID/secrets/import" \
  -H "Authorization: Bearer $RYKLOUD_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>",
  "dotenv": "<dotenv>"
}'
With the rykloud CLI
rykloud secrets import FILE [flags]

Command reference: rykloud secrets import