Skip to main content

App Configuration API

Audience: Frontend engineers and administrators managing application configuration.
  • Base URL: https://jethings-backend.fly.dev
  • Content-Type: application/json

Conventions

  • All responses are JSON.
  • Errors follow standard HTTP status codes with { message: string } body.
  • Unless noted, successful responses are 200 OK.
  • Admin endpoints require admin or super_admin role.
  • Public endpoints require no authentication.

Get App Configuration (Public)

GET /app-config/public Requires Authentication: None (Public endpoint)

Success Response

No Active Config Response

Example Request


Create App Configuration (Admin Only)

POST /app-config Requires Authentication: Bearer token in Authorization header
Requires Role: Admin or Super Admin

Request Body

Request Body Fields

Success Response

Possible Errors

  • 409 Conflict: { "message": "An active app config already exists. Please update the existing one or deactivate it first." }
  • 400 Bad Request: { "message": "Failed to create app config" }

Example Request


Get All App Configurations (Admin Only)

GET /app-config Requires Authentication: Bearer token in Authorization header
Requires Role: Admin or Super Admin

Success Response

Example Request


Get App Configuration by ID (Admin Only)

GET /app-config/:id Requires Authentication: Bearer token in Authorization header
Requires Role: Admin or Super Admin

Path Parameters

  • id (string): Configuration ID (UUID format)

Success Response

Possible Errors

  • 404 Not Found: { "message": "App config with ID ck_123... not found" }

Example Request


Update App Configuration (Admin Only)

PUT /app-config/:id Requires Authentication: Bearer token in Authorization header
Requires Role: Admin or Super Admin

Path Parameters

  • id (string): Configuration ID (UUID format)

Request Body

Request Body Fields

Success Response

Possible Errors

  • 404 Not Found: { "message": "App config with ID ck_123... not found" }
  • 400 Bad Request: { "message": "Failed to update app config" }

Example Request


Delete App Configuration (Admin Only)

DELETE /app-config/:id Requires Authentication: Bearer token in Authorization header
Requires Role: Admin or Super Admin

Path Parameters

  • id (string): Configuration ID (UUID format)

Success Response

Possible Errors

  • 404 Not Found: { "message": "App config with ID ck_123... not found" }
Warning: This action permanently deletes the configuration. This cannot be undone.

Example Request


Create or Update Active Configuration (Admin Only)

PUT /app-config/active Requires Authentication: Bearer token in Authorization header
Requires Role: Admin or Super Admin
This endpoint provides a convenient way to manage the active configuration. If an active configuration exists, it will be updated. If no active configuration exists, a new one will be created.

Request Body

Success Response

Example Request


Error Responses

Common Error Codes

  • 400 Bad Request: Invalid request data or validation errors
  • 401 Unauthorized: Missing or invalid authentication token
  • 403 Forbidden: Insufficient permissions (not admin for admin-only endpoints)
  • 404 Not Found: Resource not found
  • 409 Conflict: Resource conflict (active config already exists)
  • 500 Internal Server Error: Server error

Error Response Format


Interactive API Testing

Test Public Endpoint

Test with Authentication


Database Schema