> For the complete documentation index, see [llms.txt](https://openapi.logto.io/llms.txt)

# Add application secret

> POST /api/applications/{id}/secrets
> 
> Add a new secret for the application.



## Servers
- Logto endpoint address.: https://[tenant_id].logto.app (Logto endpoint address.)


## Authentication methods
- O auth2


## Parameters

### Path parameters

- **id** (string)
  The unique identifier of the application.



### Body: application/json (object)

- **name** (string)
  The secret name. Must be unique within the application.

- **expiresAt** (number | null)
  The epoch time in milliseconds when the secret will expire. If not provided, the secret will never expire.



## Responses
### 201
The secret was added successfully.

#### Body: application/json (object)
- **tenantId** (string)

- **applicationId** (string)

- **name** (string)

- **value** (string)

- **createdAt** (number)

- **expiresAt** (number | null)


### 400
Bad Request

### 401
Unauthorized

### 403
Forbidden

### 422
The secret name is already in use.

### 500
Internal Server Error


[Powered by Bump.sh](https://bump.sh)
