---
title: "POST /api/v3/secrets/raw/{secretName}"
method: POST
path: "/api/v3/secrets/raw/{secretName}"
tags: ["Secrets"]
---

# POST /api/v3/secrets/raw/{secretName}

`POST /api/v3/secrets/raw/{secretName}`

Create secret

## Path parameters

- `secretName` string, required

## Request body

- object
  - `workspaceId` string — The ID of the project to create the secret in.
  - `projectSlug` string — The slug of the project to create the secret in.
  - `environment` string, required — The slug of the environment to create the secret in.
  - `secretPath` string — The path to create the secret in.
  - `secretValue` string, required — The value of the secret to create.
  - `secretComment` string — Attach a comment to the secret.
  - `secretMetadata` object[]
    - `key` string, required
    - `value` string
    - `isEncrypted` boolean
  - `tagIds` string[] — The ID of the tags to be attached to the created secret.
  - `skipMultilineEncoding` boolean, nullable — Skip multiline encoding for the secret value.
  - `type` 'shared' | 'personal' — The type of the secret to create.
  - `secretReminderRepeatDays` number, nullable — Interval for secret rotation notifications, measured in days.
  - `secretReminderNote` string, nullable — Note to be attached in notification email.

## Response `200`

Default Response

- union
  - object
    - `secret` object, required
      - `id` string, required
      - `_id` string, required
      - `workspace` string, required
      - `environment` string, required
      - `version` number, required
      - `type` string, required
      - `secretKey` string, required
      - `secretValue` string, required
      - `secretComment` string, required
      - `secretReminderNote` string, nullable
      - `secretReminderRepeatDays` number, nullable
      - `skipMultilineEncoding` boolean, nullable
      - `createdAt` string, date-time, required
      - `updatedAt` string, date-time, required
      - `actor` object, nullable
        - `actorId` string, nullable
        - `actorType` string, nullable
        - `name` string, nullable
        - `membershipId` string, nullable
        - `groupId` string, nullable
      - `isRotatedSecret` boolean
      - `rotationId` string, uuid, nullable
  - object — When secret protection policy is enabled
    - `approval` object, required
      - `id` string, uuid, required
      - `policyId` string, uuid, required
      - `hasMerged` boolean
      - `status` string
      - `conflicts` unknown
      - `slug` string, required
      - `folderId` string, uuid, required
      - `createdAt` string, date-time, required
      - `updatedAt` string, date-time, required
      - `isReplicated` boolean, nullable
      - `committerUserId` string, uuid, nullable
      - `statusChangedByUserId` string, uuid, nullable
      - `bypassReason` string, nullable
      - `commitMessage` string, nullable

## Other responses

- `400` — Default Response
- `401` — Default Response
- `403` — Default Response
- `404` — Default Response
- `422` — Default Response
- `500` — Default Response

---

[API](https://skmtc.net/infisical/apis/infisical-api.md) · [All operations](https://skmtc.net/infisical/apis/infisical-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/infisical/infisical-api/versions/885aef3e6c11/schema)
