Skip to main content
If your service exposes a /contract endpoint in the ZAM format, ZAM can create a listing from it automatically. No manual field entry required.
The ZAM service template generates the /contract endpoint for you. See Build a Service.

How it works

  1. You give ZAM a base URL (e.g., https://your-api.com).
  2. ZAM fetches https://your-api.com/contract.
  3. ZAM validates the response against the service contract schema.
  4. ZAM creates a listing with the returned title, description, price, and run contract.

The /contract endpoint

Your service must expose a GET /contract endpoint that returns JSON in this shape:
{
  "listing": {
    "title": "Weather Forecast",
    "description": "Returns a 5-day forecast for any city.",
    "category": "data",
    "tags": ["weather", "forecast"],
    "price": {"amount": 100, "unit": "cents"},
    "runContract": {
      "method": "POST",
      "endpointPath": "https://your-api.com/forecast",
      "inputSchema": {
        "type": "object",
        "properties": {
          "city": {"type": "string"}
        },
        "required": ["city"]
      }
    }
  }
}
To see the exact JSON Schema your /contract endpoint must match, fetch:
curl https://api.zeroclick.quest/v1/zam-schema

Import a service

Preview first (validates without saving):
curl -X POST https://api.zeroclick.quest/v1/listings/from-service/preview \
  -H "Content-Type: application/json" \
  -H "x-zam-api-key: zam_your_key_here" \
  -d '{"serviceUrl": "https://your-api.com"}'
Create the listing:
curl -X POST https://api.zeroclick.quest/v1/listings/from-service \
  -H "Content-Type: application/json" \
  -H "x-zam-api-key: zam_your_key_here" \
  -d '{"serviceUrl": "https://your-api.com"}'

Error handling

Error typeCause
networkZAM cannot reach the URL
non_ok_statusThe /contract endpoint returned a non-2xx status
invalid_jsonThe response is not valid JSON
invalid_contractThe JSON does not match the service contract schema