# POST /api/v1/hosts/pairings/poll

Poll a pairing (installer; needs poll_secret)

Operation: `pollHostPairing`.

Poll a pairing (installer; needs poll_secret)

pending, expired, approved (once, with a fresh single-use 10-minute enrollment token for POST /api/v1/agents/enroll; the pairing is consumed in the same transaction after the approver's hosting rules are re-checked), then consumed (no token; the enrolled machine's Go-live state). A wrong pairing_id or poll_secret is 404.

## Endpoint

`POST https://amplerun-api.spiry.org/api/v1/hosts/pairings/poll`

## Authentication

No default Bearer requirement is declared for this operation. Read its description for wallet signatures, host enrollment or other specialized proofs.

## Request body

Required body. 

### `application/json`

| Field | Type | Presence | Description |
| --- | --- | --- | --- |
| `pairing_id` | UUID | Required |  |
| `poll_secret` | string | Required |  |

```json
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "pairing_id",
    "poll_secret"
  ],
  "properties": {
    "pairing_id": {
      "$ref": "#/components/schemas/UUID"
    },
    "poll_secret": {
      "type": "string",
      "maxLength": 200
    }
  }
}
```

## Responses

### `200`

Pairing state.

`application/json`
| Field | Type | Presence | Description |
| --- | --- | --- | --- |
| `status` | "pending" / "expired" / "approved" / "consumed" | Required |  |
| `enrollment_token` | string | Optional | Only with status approved |
| `expires_at` | Rfc3339Utc | Optional |  |
| `go_live` | boolean | Optional |  |
| `machine` | object | Optional |  |

```json
{
  "type": "object",
  "required": [
    "status"
  ],
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "expired",
        "approved",
        "consumed"
      ]
    },
    "enrollment_token": {
      "type": "string",
      "description": "Only with status approved",
      "exactly once.": null
    },
    "expires_at": {
      "$ref": "#/components/schemas/Rfc3339Utc"
    },
    "go_live": {
      "type": "boolean"
    },
    "machine": {
      "type": "object",
      "nullable": true,
      "required": [
        "machine_id",
        "live",
        "error"
      ],
      "properties": {
        "machine_id": {
          "$ref": "#/components/schemas/UUID"
        },
        "live": {
          "type": "string",
          "enum": [
            "waiting",
            "live",
            "failed",
            "off"
          ]
        },
        "error": {
          "type": "string",
          "nullable": true
        }
      }
    }
  }
}
```

### `default`

Error envelope. 401 unauthenticated, 403/404 forbidden, 409 conflict, 422 invalid input, 429 rate limited (code UNAVAILABLE, retryable:true, no Retry-After header), 503 unavailable money/provider state with retryable:true.

`application/json`
| Field | Type | Presence | Description |
| --- | --- | --- | --- |
| `error` | object | Required |  |

```json
{
  "$ref": "#/components/schemas/ErrorEnvelope"
}
```

## Static request outline

Replace path/query placeholders and provide the required JSON body, headers and credential from the sections above. This is a request outline, not a command that chooses an amount or starts a rental for you.

```sh
curl --request POST 'https://amplerun-api.spiry.org/api/v1/hosts/pairings/poll'
```

[Schema definitions](https://docs.amplerun.com/reference/schemas.md) · [Download OpenAPI](/openapi.json) · [Authentication](https://docs.amplerun.com/agents/authentication.md) · [Errors and recovery](https://docs.amplerun.com/reference/errors.md)

---
Generated from the AmpleRun API contract.
Canonical: https://docs.amplerun.com/reference/api/poll-host-pairing/
