Migrate a v1 config to a v2 schema with an explicit mapping, and list what was dropped or defaulted

$0.005 USDC per call · Developer and security · POST /api/v1/config-migration · Id config-migration

Applies a declared mapping (from pointer, to pointer, optional transform such as string-to-number or a value map) to a v1 JSON config, carries over unmapped keys the v2 schema declares, fills schema defaults, validates the result against the v2 JSON Schema 2020-12 and returns the migrated config plus three exact lists: dropped (v1 values that landed nowhere, with their JSON pointers), defaulted (values invented from schema defaults) and invalid (v2 schema errors with paths). For agents upgrading a user's config file or tool settings between versions without silently losing data. Conflicting mappings, overlapping sources and lossy transforms ("007", numbers beyond 2^53, arrays with more than one element) are failures, not guesses. It does not infer mappings; unmapped and undeclared keys are reported as dropped.

What you get

Data loss during config upgrades is silent. 100 mappings and a 15,000-node config per $0.005 call.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/config-migration. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.

curl -i -X POST https://agents.writerslogic.com/api/v1/config-migration \
  -H 'content-type: application/json' \
  -d '{"v1":{"server":{"host":"db1","port":"5432","legacy_ssl":true},"debug":"yes","name":"x"},"v2Schema":{"type":"object","required":["database"],"additionalProperties":false,"properties":{"name":{"type":"string"},"database":{"type":"object","required":["host","port"],"properties":{"host":{"type":"string"},"port":{"type":"integer"},"timeoutMs":{"type":"integer","default":3000}}}}},"mapping":[{"from":"/server/host","to":"/database/host"},{"from":"/server/port","to":"/database/port","transform":"string-to-number"}]}'

Input

FieldTypeRequiredDescription
v1anyyesThe old config (any JSON value).
v2SchemaanyyesThe new config's schema. Full JSON Schema 2020-12 (local $ref only).
mappingarray<object>; max 100 itemsyes
carryDeclaredbooleannoCopy unmapped v1 values to the same pointer when v2 declares that property (default true).
applyDefaultsbooleannoFill missing v2 properties from schema defaults (default true).

Example request body

{
  "v1": {
    "server": {
      "host": "db1",
      "port": "5432",
      "legacy_ssl": true
    },
    "debug": "yes",
    "name": "x"
  },
  "v2Schema": {
    "type": "object",
    "required": [
      "database"
    ],
    "additionalProperties": false,
    "properties": {
      "name": {
        "type": "string"
      },
      "database": {
        "type": "object",
        "required": [
          "host",
          "port"
        ],
        "properties": {
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "timeoutMs": {
            "type": "integer",
            "default": 3000
          }
        }
      }
    }
  },
  "mapping": [
    {
      "from": "/server/host",
      "to": "/database/host"
    },
    {
      "from": "/server/port",
      "to": "/database/port",
      "transform": "string-to-number"
    }
  ]
}

Result

The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass.
migratedanynoThe v2 config.
appliedarray<object>no
carriedarray<string>nov1 pointers copied unchanged because v2 declares the same pointer.
droppedarray<object>no
acknowledgedDropsarray<string>no
defaultedarray<object>no
unusedMappingsarray<string>noMapping sources that do not exist in v1.
invalidarray<object>no
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways true: pure code, no model.

Pay and connect

Available through: x402 (USDC on Base), MCP. MCP clients reach it through the data-contract-kit package.

Machine-readable