⚠️ Porta is in beta — APIs and features may change before v1.0
Skip to content

Configuration API

Manage system configuration key-value pairs stored in the system_config database table.

Base path: /api/admin/config

List All Configuration

http
GET /api/admin/config

Returns all configuration entries. Sensitive values (keys containing secret, password, key) are masked in the response.

Response: 200 OK

json
{
  "data": [
    {
      "key": "access_token_ttl",
      "value": "3600",
      "description": "Access token TTL in seconds",
      "updatedAt": "2024-01-15T10:30:00.000Z"
    },
    {
      "key": "refresh_token_ttl",
      "value": "86400",
      "description": "Refresh token TTL in seconds",
      "updatedAt": "2024-01-15T10:30:00.000Z"
    }
  ]
}

Get Configuration Value

http
GET /api/admin/config/:key

Response: 200 OK

json
{
  "key": "access_token_ttl",
  "value": "3600",
  "description": "Access token TTL in seconds",
  "updatedAt": "2024-01-15T10:30:00.000Z"
}

Set Configuration Value

http
PUT /api/admin/config/:key
FieldTypeRequiredDescription
valuestringConfiguration value
descriptionstringOptional description
json
{
  "value": "7200",
  "description": "Access token TTL in seconds"
}

Response: 200 OK

TIP

Configuration changes are cached in memory with a 60-second TTL. After updating a value, it may take up to 60 seconds for the change to take effect across all running instances.

Common Configuration Keys

KeyDefaultDescription
access_token_ttl3600Access token TTL (seconds)
refresh_token_ttl86400Refresh token TTL (seconds)
id_token_ttl3600ID token TTL (seconds)
authorization_code_ttl600Authorization code TTL (seconds)
session_ttl86400Session TTL (seconds)
interaction_ttl3600Interaction TTL (seconds)

Released under the MIT License.