Skip to content

Configs

Configs store application configuration as key-value pairs. Your services can access config values as environment variables.

Config Endpoints

MethodEndpointDescription
GET/api/configs/List all your configs
POST/api/configs/Create a new config
GET/api/configs/{id}/Get config details
PATCH/api/configs/{id}/Update a config
DELETE/api/configs/{id}/Delete a config

Config Item Endpoints

MethodEndpointDescription
GET/api/configs/{config_id}/items/List config items
POST/api/configs/{config_id}/items/Add a config item
GET/api/configs/{config_id}/items/{id}/Get a config item
PATCH/api/configs/{config_id}/items/{id}/Update a config item
DELETE/api/configs/{config_id}/items/{id}/Delete a config item

Config Object

json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "production-config",
  "is_default": false,
  "status": "ready",
  "deploy_successful": true,
  "created_at": "2024-10-15T10:00:00Z"
}

Fields

FieldTypeDescription
idUUIDUnique identifier (read-only)
namestringConfig name
is_defaultbooleanWhether this is the default config (read-only)
statusstringCurrent status (read-only)
deploy_successfulbooleanWhether synced successfully (read-only)

Config Item Object

json
{
  "id": "abc123...",
  "config": "config-uuid",
  "key": "DATABASE_URL",
  "value": "postgresql://localhost/mydb",
  "created_at": "2024-10-15T10:00:00Z",
  "updated_at": "2024-10-15T12:00:00Z"
}

Fields

FieldTypeDescription
idUUIDUnique identifier (read-only)
configUUIDParent config ID (read-only)
keystringConfiguration key name
valuestringConfiguration value

List Configs

http
GET /api/configs/

Example:

bash
curl -H "Authorization: Bearer gob_your_key" \
  https://api.example.com/api/configs/

Response:

json
{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "abc123...",
      "name": "Default",
      "is_default": true,
      "status": "ready"
    },
    {
      "id": "def456...",
      "name": "production-config",
      "is_default": false,
      "status": "ready"
    }
  ]
}

Create Config

http
POST /api/configs/

Request Body:

json
{
  "name": "production-config"
}

Example:

bash
curl -X POST https://api.example.com/api/configs/ \
  -H "Authorization: Bearer gob_your_key" \
  -H "Content-Type: application/json" \
  -d '{"name": "production-config"}'

Delete Config

http
DELETE /api/configs/{id}/

Restrictions

  • Default configs cannot be deleted - Every account has a default config that cannot be removed
  • Configs in use cannot be deleted - Remove the config from all services first

List Config Items

http
GET /api/configs/{config_id}/items/

Example:

bash
curl -H "Authorization: Bearer gob_your_key" \
  https://api.example.com/api/configs/abc123.../items/

Response:

json
{
  "count": 3,
  "results": [
    {
      "id": "item1...",
      "key": "DATABASE_URL",
      "value": "postgresql://localhost/mydb"
    },
    {
      "id": "item2...",
      "key": "API_ENDPOINT",
      "value": "https://api.example.com"
    }
  ]
}

Add Config Item

http
POST /api/configs/{config_id}/items/

Request Body:

json
{
  "key": "DATABASE_URL",
  "value": "postgresql://localhost/mydb"
}

Example:

bash
curl -X POST https://api.example.com/api/configs/abc123.../items/ \
  -H "Authorization: Bearer gob_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "API_ENDPOINT",
    "value": "https://api.production.com"
  }'

Update Config Item

http
PATCH /api/configs/{config_id}/items/{id}/

Example:

bash
curl -X PATCH https://api.example.com/api/configs/abc123.../items/item1.../ \
  -H "Authorization: Bearer gob_your_key" \
  -H "Content-Type: application/json" \
  -d '{"value": "postgresql://newhost/mydb"}'

Delete Config Item

http
DELETE /api/configs/{config_id}/items/{id}/

Example:

bash
curl -X DELETE https://api.example.com/api/configs/abc123.../items/item1.../ \
  -H "Authorization: Bearer gob_your_key"

Automatic Sync

When you add, update, or delete config items, changes are automatically synced to your running services. Services will pick up the new configuration after they restart or redeploy.

Configs vs Secrets

FeatureConfigsSecrets
Use forNon-sensitive settingsSensitive data
EncryptionNot encryptedEncrypted at rest
VisibilityValues visible in UIValues hidden by default
Access loggingNoYes

Use Configs For

  • API endpoints and URLs
  • Feature flags
  • Environment names
  • Non-sensitive settings

Use Secrets For

  • API keys and tokens
  • Database passwords
  • Private keys
  • Any sensitive data

Example Workflow

1. Create a Config

bash
CONFIG=$(curl -s -X POST https://api.example.com/api/configs/ \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "my-app-config"}')

CONFIG_ID=$(echo $CONFIG | jq -r '.id')

2. Add Config Items

bash
# Add multiple config items
curl -X POST https://api.example.com/api/configs/$CONFIG_ID/items/ \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"key": "API_URL", "value": "https://api.example.com"}'

curl -X POST https://api.example.com/api/configs/$CONFIG_ID/items/ \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"key": "LOG_LEVEL", "value": "info"}'

3. Use in Service

bash
curl -X POST https://api.example.com/api/services/ \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-app",
    "image": "myapp:v1.0.0",
    "port": 8080,
    "config": "'$CONFIG_ID'",
    "secret": "your-secret-id"
  }'

Next Steps

Goblins Platform Documentation