---
title: "POST /api/v1/dynamic-secrets/leases"
method: POST
path: "/api/v1/dynamic-secrets/leases"
tags: ["Dynamic Secrets"]
---

# POST /api/v1/dynamic-secrets/leases

`POST /api/v1/dynamic-secrets/leases`

## Request body

- object
  - `dynamicSecretName` string, required — The name of the dynamic secret.
  - `projectSlug` string, required — The slug of the project of the dynamic secret in.
  - `ttl` string — The lease lifetime TTL. If not provided the default TTL of dynamic secret will be used.
  - `path` string — The path of the dynamic secret in.
  - `environmentSlug` string, required — The slug of the environment of the dynamic secret in.
  - `config` unknown

## Response `200`

Default Response

- object
  - `lease` object, required
    - `id` string, uuid, required
    - `version` number, required
    - `externalEntityId` string, required
    - `expireAt` string, date-time, required
    - `status` string, nullable
    - `statusDetails` string, nullable
    - `dynamicSecretId` string, uuid, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
    - `config` unknown
  - `dynamicSecret` object, required
    - `id` string, uuid, required
    - `name` string, required
    - `version` number, required
    - `type` string, required
    - `defaultTTL` string, required
    - `maxTTL` string, nullable
    - `folderId` string, uuid, required
    - `status` string, nullable
    - `statusDetails` string, nullable
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
    - `projectGatewayId` string, uuid, nullable
    - `gatewayId` string, uuid, nullable
    - `usernameTemplate` string, nullable
    - `gatewayV2Id` string, uuid, nullable
    - `gatewayPoolId` string, uuid, nullable
    - `metadata` object[]
      - `key` string, required
      - `value` string
  - `data` unknown

## 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)
