Skip to content

POST /api/v1/hosts/pairings/poll

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.

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

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

Required body.

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

Pairing state.

application/json

FieldTypePresenceDescription
status“pending” / “expired” / “approved” / “consumed”Required
enrollment_tokenstringOptionalOnly with status approved
expires_atRfc3339UtcOptional
go_livebooleanOptional
machineobjectOptional
{
"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
}
}
}
}
}

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

FieldTypePresenceDescription
errorobjectRequired
{
"$ref": "#/components/schemas/ErrorEnvelope"
}

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.

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

Schema definitions · Download OpenAPI · Authentication · Errors and recovery

Official AmpleRun documentation · Contract v3 · Generated from the API contract · Revision 52fe29de · Open AmpleRun · View Markdown · For agents