Claim the next assigned job
POST /api/v1/jobs/claim
Optional sshInventory preferences select host-keys-v1 (five connections) or host-keys-v2 (ten connections, scanner 0.26.90) with a source and bounded fingerprint map. They require stable claimId and instanceId and cannot change on recovery. Remote inventory also requires explicit pool and run approval; local preferences alone cannot expand a baseline run. Remote pool claims require poolId, claimId and current instanceId, and forbid jobId. They require explicit current local pool advertisement and server approval; ordinary claims never claim remote work. Remote leases have a fixed short expiry and do not extend on renewal. Use a stable claimId and process instanceId when retrying after a lost response. Optional jobId selects only that assigned job; it never falls back to another job. A claim receipt cannot be reused with another job selection. The optional instanceId must match the most recent heartbeat; it binds successful scan evidence to that process. One active job per agent. Successful claims replay for up to 24 hours without resurrecting terminal leases.
Allowed roles: agent.
Authentication
The following OpenAPI alternatives describe accepted authentication. Browser mutations also require the canonical Origin header.
[
{
"organizationCredential": []
},
{
"browserSession": []
}
]
Parameters
[]
Request body
{
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"claimId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"instanceId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"jobId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"poolId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"sshInventory": {
"type": "object",
"properties": {
"profile": {
"type": "string",
"enum": [
"host-keys-v1",
"host-keys-v2"
]
},
"source": {
"type": "string",
"minLength": 1,
"maxLength": 100,
"not": {
"const": "hosted-ssh"
}
},
"pins": {
"default": {},
"type": "object",
"propertyNames": {
"type": "string",
"minLength": 1,
"maxLength": 300,
"pattern": "^(?:\\[[0-9a-fA-F:]+\\]|[a-zA-Z0-9][a-zA-Z0-9.-]*)(?::[0-9]{1,5})?$"
},
"additionalProperties": {
"type": "string",
"pattern": "^SHA256:[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]$"
},
"maxProperties": 256
}
},
"required": [
"profile",
"source"
],
"additionalProperties": false
}
},
"additionalProperties": false,
"allOf": [
{
"if": {
"required": [
"poolId"
]
},
"then": {
"required": [
"claimId",
"instanceId"
],
"not": {
"required": [
"jobId"
]
}
}
},
{
"if": {
"required": [
"sshInventory"
]
},
"then": {
"required": [
"claimId",
"instanceId"
]
}
}
]
}
}
}
}
Responses
{
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"job": {
"anyOf": [
{
"$ref": "#/components/schemas/LeasedJob"
},
{
"type": "null"
}
]
}
},
"required": [
"job"
]
}
}
}
},
"400": {
"description": "Validation error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Missing/expired/revoked credential",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Insufficient role",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "State or idempotency conflict",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "Body too large",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "Unsupported media type",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "Request budget exhausted; respect Retry-After",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"headers": {
"Retry-After": {
"schema": {
"type": "integer",
"minimum": 1
},
"description": "Seconds until sufficient budget is expected; concurrent traffic may consume replenished capacity."
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "Not configured",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
References such as #/components/schemas/Asset resolve in shared schemas. Download the OpenAPI contract for client generation. This page is generated; it describes the implemented development API, not planned endpoints.