Ledga
POST/strings

Create a ledger string

Create a string for the tenant.

Request bodyrequired

FieldTypeDescription
coderequired string
max length: 50
Unique within the tenant. Letters, numbers, dashes and underscores.
namerequired string
max length: 255
description string
max length: 1000 · nullable
is_active boolean
default: true

Responses

201String created successfully
{
  "success": true,
  "data": {
    "id": "01997c1e-4d2a-7c3e-9a1b-2f0e8c6d4b5a",
    "code": "treasury-fx",
    "name": "Treasury FX group",
    "description": "Cross-currency treasury ledgers",
    "is_active": true,
    "ledgers": [
      {
        "id": "01997c1e-4d2a-7c3e-9a1b-2f0e8c6d4b5a",
        "code": "gbp-main",
        "name": "GBP Main",
        "currency": "GBP"
      }
    ],
    "created_at": "2026-01-15T10:30:00Z",
    "updated_at": "2026-01-15T10:30:00Z"
  }
}
401Unauthenticated
{
  "success": false,
  "message": "Validation failed",
  "code": "VALIDATION_ERROR"
}
403Forbidden
{
  "success": false,
  "message": "Validation failed",
  "code": "VALIDATION_ERROR"
}
422Validation error
{
  "success": false,
  "message": "Validation failed",
  "code": "VALIDATION_ERROR"
}

Examples

curl -X POST https://ledga.io/api/v1/strings \
  -H "Authorization: Bearer sk_xxxxxxxx_your_secret" \
  -H "Content-Type: application/json" \
  -d '{
  "code": "treasury-fx",
  "name": "Treasury FX group",
  "is_active": true
}'

← All endpoints