# x402 Hosting: Rollback Project to Previous Deployment

> x402 Hosting: Rollback Project to Previous Deployment is a paid API for AI agents from api.x402-hosting.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Rolls back a hosted Next.js project to a specified previous deployment by deploymentId, restoring the live site to that version.

## Facts

- Endpoint: POST https://api.x402-hosting.com/v1/projects/:id/rollback
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-hosting-rollback-project-to-previous-deployment-ab7fec26
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_mE8DB7PHzGDng6wRIwRRS

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402-hosting-rollback-project-to-previous-deployment-ab7fec26 -d '<json body>'
```

Example prompt: My project site is broken after the latest deploy — roll it back to the previous deployment with ID a3f1c2d4-5678-4abc-89ef-0123456789ab for project b9e2d3f5-1234-4def-90ab-cdef01234567.

## When to prefer this

Use this endpoint when a deployed Next.js project on x402 Hosting has a broken or problematic current release and you need to immediately restore a previous known-good deployment. Prefer this over redeploying from source when you have a specific stable deploymentId to target and need the fastest recovery path. This is the right choice for automated incident-response agents or CI/CD pipelines that detect regressions and need to self-heal.

## Known failure modes

- Invalid project UUID returns 404 not found
- Invalid or non-existent deploymentId returns 404 or 400 bad request
- Non-owner wallet attempting payment is rejected
- Payment failure via x402 returns 402 Payment Required
- Duplicate idempotency key with different parameters may return 409 Conflict
- Deployment already active may return a no-op or error

## How this service works

Roll a project's live site back to a previous deployment. Call this when the current release is broken; pass the target deploymentId as a query parameter. Only the owner wallet can pay.

## Output

Returns a JSON object with the projectId, a new operationId tracking the rollback, an operationUrl to poll for status, and an optional state field indicating the rollback operation's current state.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input",
  "output"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "queryParams"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "required": [
      "Idempotency-Key"
     ],
     "properties": {
      "Idempotency-Key": {
       "type": "string",
       "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
      }
     },
     "additionalProperties": true
    },
    "pathParams": {
     "type": "object",
     "required": [
      "id"
     ],
     "properties": {
      "id": {
       "type": "string",
       "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
      }
     },
     "additionalProperties": false
    },
    "queryParams": {
     "type": "object",
     "required": [
      "deploymentId"
     ],
     "properties": {
      "deploymentId": {
       "type": "string",
       "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type",
    "example"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "json"
    },
    "example": {
     "type": "object",
     "required": [
      "projectId",
      "operationId"
     ],
     "properties": {
      "state": {
       "type": "string"
      },
      "projectId": {
       "type": "string",
       "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
      },
      "operationId": {
       "type": "string",
       "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
      },
      "operationUrl": {
       "type": "string"
      }
     },
     "additionalProperties": true
    }
   },
   "additionalProperties": false
  }
 },
 "additionalProperties": false
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-hosting-rollback-project-to-previous-deployment-ab7fec26/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.x402-hosting.com](https://www.zero.xyz/host/api.x402-hosting.com/llms.txt)
