Skip to main content
A listing needs a title and a run contract. The run contract tells ZAM which HTTP endpoint to call when someone activates your listing.

Prerequisites

  • A ZAM account with an API key that has listing:create scope
  • A deployed service with a publicly reachable URL
Need a service to list? Start with the ZAM service template — clone, customize, deploy, and auto-import.
If your service exposes a /contract endpoint (the service template does this automatically), let ZAM build the listing for you. ZAM reads the title, description, pricing, and schemas directly from your 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://my-service.workers.dev"}'
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://my-service.workers.dev"}'
See AutoZam for the /contract format, schema requirements, and error handling.

Manual: create a listing by hand

For services that don’t expose a /contract endpoint, create a listing manually.
curl -X POST https://api.zeroclick.quest/v1/listings \
  -H "Content-Type: application/json" \
  -H "x-zam-api-key: zam_your_key_here" \
  -d '{
    "title": "Weather Forecast",
    "description": "Returns a 5-day forecast for any city.",
    "category": "data",
    "tags": ["weather", "forecast"],
    "listingState": "published",
    "price": {"amount": 100, "unit": "cents"},
    "runContract": {
      "method": "POST",
      "endpointPath": "https://your-api.com/forecast",
      "inputSchema": {
        "type": "object",
        "properties": {
          "city": {"type": "string"}
        },
        "required": ["city"]
      }
    }
  }'
Set listingState to "draft" to save without publishing. Publish later with a PATCH request.

Publish a draft

curl -X PATCH https://api.zeroclick.quest/v1/listings/LISTING_ID \
  -H "Content-Type: application/json" \
  -H "x-zam-api-key: zam_your_key_here" \
  -d '{"listingState": "published"}'

State transitions

Only certain transitions are valid:
FromAllowed transitions
draftpublished
publishedpaused, archived
pausedpublished, archived
archived(none — terminal)
Invalid transitions return HTTP 409.

Input validation

If your listing defines an inputSchema, ZAM validates every activation request against it before calling your endpoint. Buyers who send malformed data receive a 400 error; your endpoint never sees the bad request. Both inputSchema and outputSchema must be valid JSON Schema. ZAM validates them at listing creation time.