{
  "$schema": "https://docs.runlater.io/agent/alpha.v1.schema.json",
  "version": "1.0.0",
  "format_owner": "RunLater",
  "protocol_status": "custom_contract_metadata_not_authorization",
  "base_url": "https://api.runlater.io",
  "access": "operator_approved_only",
  "readiness_note": "Feature availability is a published configuration snapshot. Health is not proof of a usable identity, grant or destination. Check current authority and handle expiry/revocation. No public signup or payment flow.",
  "health_url": "https://api.runlater.io/health",
  "receiver": "owned_side_effect_free_synthetic_only",
  "authentication": {
    "algorithm": "Ed25519",
    "origin": "https://api.runlater.io",
    "request_prefix": "RunLater signed request v1\n",
    "request_tuple": [
      "version",
      "origin",
      "project_id",
      "public_key",
      "method",
      "path",
      "query",
      "body_sha256",
      "idempotency_key",
      "issued_at_ms",
      "expires_at_ms",
      "nonce"
    ],
    "encoding": "UTF-8 prefix plus compact JSON array; no trailing newline; version is integer1; digest is lowercase SHA256 of exact body bytes; empty query only",
    "maximum_signature_ms": 60000,
    "headers": [
      "RunLater-Project-Id",
      "RunLater-Public-Key",
      "RunLater-Nonce",
      "RunLater-Issued-At",
      "RunLater-Expires-At",
      "RunLater-Request-Signature"
    ],
    "bearer_supported": false,
    "private_key_transport": "never_sent; authorized_client_signs_locally"
  },
  "routes": [
    {
      "name": "health",
      "method": "GET",
      "path": "/health",
      "required_permission": null,
      "authentication": "none",
      "body_definition": null,
      "idempotency_key_required": false
    },
    {
      "name": "registration_challenge",
      "method": "POST",
      "path": "/v1/identity/challenges",
      "required_permission": null,
      "authentication": "operator_allowlisted_project_and_key",
      "body_definition": "Issue",
      "idempotency_key_required": false
    },
    {
      "name": "complete_registration",
      "method": "POST",
      "path": "/v1/identity/enroll",
      "required_permission": null,
      "authentication": "single_use_possession_proof",
      "body_definition": "Enroll",
      "idempotency_key_required": false
    },
    {
      "name": "identity",
      "method": "GET",
      "path": "/v1/identity/me",
      "required_permission": "read",
      "authentication": "signed",
      "body_definition": null,
      "idempotency_key_required": false
    },
    {
      "name": "schedule_task",
      "method": "POST",
      "path": "/v1/tasks",
      "required_permission": "enqueue",
      "authentication": "signed",
      "body_definition": "Create",
      "idempotency_key_required": true
    },
    {
      "name": "task_status",
      "method": "GET",
      "path": "/v1/tasks/{id}",
      "required_permission": "read",
      "authentication": "signed",
      "body_definition": null,
      "idempotency_key_required": false
    },
    {
      "name": "cancel_task",
      "method": "POST",
      "path": "/v1/tasks/{id}/cancel",
      "required_permission": "cancel",
      "authentication": "signed",
      "body_definition": "Empty",
      "idempotency_key_required": false
    },
    {
      "name": "redrive_task",
      "method": "POST",
      "path": "/v1/tasks/{id}/redrive",
      "required_permission": "redrive",
      "authentication": "signed",
      "body_definition": "Empty",
      "idempotency_key_required": true
    }
  ],
  "definitions": {
    "Issue": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "project_id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{1,64}$"
        },
        "public_key": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        }
      },
      "required": [
        "project_id",
        "public_key"
      ]
    },
    "Enroll": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "project_id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{1,64}$"
        },
        "challenge_id": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "signature": {
          "type": "string",
          "pattern": "^[a-f0-9]{128}$"
        }
      },
      "required": [
        "project_id",
        "challenge_id",
        "signature"
      ]
    },
    "Create": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "destination": {
          "const": "registered:receiver_a"
        },
        "body": {
          "type": "string",
          "maxLength": 1024,
          "x-max-utf8-bytes": 1024,
          "description": "JSON-encoded object with synthetic:true; at most1024 UTF-8 bytes. Owned receiver supports only synthetic effects."
        },
        "operation_key": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{1,128}$"
        },
        "run_at_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991,
          "description": "0 means eligible now; at most365days into the future, validated using trusted server time."
        }
      },
      "required": [
        "destination",
        "body",
        "operation_key",
        "run_at_ms"
      ]
    },
    "Empty": {
      "type": "object",
      "additionalProperties": false,
      "properties": {},
      "required": []
    },
    "TaskId": {
      "type": "string",
      "pattern": "^task_[a-f0-9]{16}$"
    }
  },
  "limits": {
    "request_body_bytes": 2048,
    "callback_body_bytes": 1024,
    "logical_attempts_per_task": 5,
    "retry_age_ms": 86400000,
    "project_lifetime_admissions": 16,
    "project_lifetime_publications": 128
  },
  "authority": {
    "automatic_execution": false,
    "payment_authority": false,
    "self_service_registration": false
  }
}
