acquire or renew the input lease
POST
/v1/machines/{machine_id}/input-leaseAuthorization
AuthorizationBearer token · headerrequiredan organization api key. browser clients use the session cookie instead.
or
computer_sessionAPI key · cookierequiredfirst-party httponly browser session; never readable from javascript.
Path parameters
machine_idstringrequiredmatches ^mch_[0-9a-z]{20,32}$
Request body
requiredapplication/jsonsession_idstringrequiredsession identifier
matches ^ses_[0-9a-z]{20,32}$
ttl_secondsintegermin 5 · max 3600 · default: 60
forcebooleandefault: false
Responses
200OK
idstringrequiredinput lease identifier
matches ^lea_[0-9a-z]{20,32}$
machine_idstringrequiredmachine identifier
matches ^mch_[0-9a-z]{20,32}$
session_idstringrequiredsession identifier
matches ^ses_[0-9a-z]{20,32}$
fenceintegerrequiredincrements on every grant; the gateway rejects a lower fence
min 0 · max 9007199254740991
acquired_atstring<date-time>requiredexpires_atstring<date-time>requiredreleased_atstring<date-time> | anyrequiredShow propertiesHide properties
Any of:
string<date-time>
string<date-time>any
any400invalid request
errorobjectrequiredShow propertiesHide properties
codeErrorCoderequiredAllowed:
invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailablemessagestringrequiredhuman-readable, not machine-parseable
request_idstringrequireddetailsFieldError[]Show propertiesHide properties
Array of
FieldErrorfieldstringrequireddotted path into the request body
messagestringrequiredquotaobjectShow propertiesHide properties
limitstringrequiredthe entitlement that declined this request
currentintegerrequiredmin 0 · max 9007199254740991
maximuminteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyplan_idstringrequiredupgrade_urlstring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
any401unauthenticated
errorobjectrequiredShow propertiesHide properties
codeErrorCoderequiredAllowed:
invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailablemessagestringrequiredhuman-readable, not machine-parseable
request_idstringrequireddetailsFieldError[]Show propertiesHide properties
Array of
FieldErrorfieldstringrequireddotted path into the request body
messagestringrequiredquotaobjectShow propertiesHide properties
limitstringrequiredthe entitlement that declined this request
currentintegerrequiredmin 0 · max 9007199254740991
maximuminteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyplan_idstringrequiredupgrade_urlstring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
any402quota exceeded
errorobjectrequiredShow propertiesHide properties
codeErrorCoderequiredAllowed:
invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailablemessagestringrequiredhuman-readable, not machine-parseable
request_idstringrequireddetailsFieldError[]Show propertiesHide properties
Array of
FieldErrorfieldstringrequireddotted path into the request body
messagestringrequiredquotaobjectShow propertiesHide properties
limitstringrequiredthe entitlement that declined this request
currentintegerrequiredmin 0 · max 9007199254740991
maximuminteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyplan_idstringrequiredupgrade_urlstring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
any403permission denied
errorobjectrequiredShow propertiesHide properties
codeErrorCoderequiredAllowed:
invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailablemessagestringrequiredhuman-readable, not machine-parseable
request_idstringrequireddetailsFieldError[]Show propertiesHide properties
Array of
FieldErrorfieldstringrequireddotted path into the request body
messagestringrequiredquotaobjectShow propertiesHide properties
limitstringrequiredthe entitlement that declined this request
currentintegerrequiredmin 0 · max 9007199254740991
maximuminteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyplan_idstringrequiredupgrade_urlstring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
any404not found
errorobjectrequiredShow propertiesHide properties
codeErrorCoderequiredAllowed:
invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailablemessagestringrequiredhuman-readable, not machine-parseable
request_idstringrequireddetailsFieldError[]Show propertiesHide properties
Array of
FieldErrorfieldstringrequireddotted path into the request body
messagestringrequiredquotaobjectShow propertiesHide properties
limitstringrequiredthe entitlement that declined this request
currentintegerrequiredmin 0 · max 9007199254740991
maximuminteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyplan_idstringrequiredupgrade_urlstring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
any409conflict with current state
errorobjectrequiredShow propertiesHide properties
codeErrorCoderequiredAllowed:
invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailablemessagestringrequiredhuman-readable, not machine-parseable
request_idstringrequireddetailsFieldError[]Show propertiesHide properties
Array of
FieldErrorfieldstringrequireddotted path into the request body
messagestringrequiredquotaobjectShow propertiesHide properties
limitstringrequiredthe entitlement that declined this request
currentintegerrequiredmin 0 · max 9007199254740991
maximuminteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyplan_idstringrequiredupgrade_urlstring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
any412precondition failed
errorobjectrequiredShow propertiesHide properties
codeErrorCoderequiredAllowed:
invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailablemessagestringrequiredhuman-readable, not machine-parseable
request_idstringrequireddetailsFieldError[]Show propertiesHide properties
Array of
FieldErrorfieldstringrequireddotted path into the request body
messagestringrequiredquotaobjectShow propertiesHide properties
limitstringrequiredthe entitlement that declined this request
currentintegerrequiredmin 0 · max 9007199254740991
maximuminteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyplan_idstringrequiredupgrade_urlstring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
any429rate limited
errorobjectrequiredShow propertiesHide properties
codeErrorCoderequiredAllowed:
invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailablemessagestringrequiredhuman-readable, not machine-parseable
request_idstringrequireddetailsFieldError[]Show propertiesHide properties
Array of
FieldErrorfieldstringrequireddotted path into the request body
messagestringrequiredquotaobjectShow propertiesHide properties
limitstringrequiredthe entitlement that declined this request
currentintegerrequiredmin 0 · max 9007199254740991
maximuminteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyplan_idstringrequiredupgrade_urlstring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
any500internal error
errorobjectrequiredShow propertiesHide properties
codeErrorCoderequiredAllowed:
invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailablemessagestringrequiredhuman-readable, not machine-parseable
request_idstringrequireddetailsFieldError[]Show propertiesHide properties
Array of
FieldErrorfieldstringrequireddotted path into the request body
messagestringrequiredquotaobjectShow propertiesHide properties
limitstringrequiredthe entitlement that declined this request
currentintegerrequiredmin 0 · max 9007199254740991
maximuminteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyplan_idstringrequiredupgrade_urlstring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
any501unsupported operation
errorobjectrequiredShow propertiesHide properties
codeErrorCoderequiredAllowed:
invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailablemessagestringrequiredhuman-readable, not machine-parseable
request_idstringrequireddetailsFieldError[]Show propertiesHide properties
Array of
FieldErrorfieldstringrequireddotted path into the request body
messagestringrequiredquotaobjectShow propertiesHide properties
limitstringrequiredthe entitlement that declined this request
currentintegerrequiredmin 0 · max 9007199254740991
maximuminteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyplan_idstringrequiredupgrade_urlstring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
any503compute unavailable
errorobjectrequiredShow propertiesHide properties
codeErrorCoderequiredAllowed:
invalid_requestunauthenticatedpermission_deniednot_foundconflictprecondition_failedquota_exceededrate_limitedunsupported_operationinternal_errorcompute_unavailablemessagestringrequiredhuman-readable, not machine-parseable
request_idstringrequireddetailsFieldError[]Show propertiesHide properties
Array of
FieldErrorfieldstringrequireddotted path into the request body
messagestringrequiredquotaobjectShow propertiesHide properties
limitstringrequiredthe entitlement that declined this request
currentintegerrequiredmin 0 · max 9007199254740991
maximuminteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyplan_idstringrequiredupgrade_urlstring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
anyTry it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST "https://api.raster.sh/v1/v1/machines/mch_01h8xk2q4v9m3n7p5r0t/input-lease" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"session_id": "ses_01h8xk2q4v9m3n7p5r0t",
"ttl_seconds": 60,
"force": false
}'const response = await fetch("https://api.raster.sh/v1/v1/machines/mch_01h8xk2q4v9m3n7p5r0t/input-lease", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"session_id": "ses_01h8xk2q4v9m3n7p5r0t",
"ttl_seconds": 60,
"force": false
})
});import requests
response = requests.post(
"https://api.raster.sh/v1/v1/machines/mch_01h8xk2q4v9m3n7p5r0t/input-lease",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"session_id": "ses_01h8xk2q4v9m3n7p5r0t",
"ttl_seconds": 60,
"force": False
},
)Response
{
"id": "lea_01h8xk2q4v9m3n7p5r0t",
"machine_id": "mch_01h8xk2q4v9m3n7p5r0t",
"session_id": "ses_01h8xk2q4v9m3n7p5r0t",
"fence": 9007199254740991,
"acquired_at": "2026-08-19T12:00:00Z",
"expires_at": "2026-08-19T12:00:00Z",
"released_at": "2026-08-19T12:00:00Z"
}{
"error": {
"code": "invalid_request",
"message": "string",
"request_id": "string",
"details": [
{
"field": "string",
"message": "string"
}
],
"quota": {
"limit": "running_machines",
"current": 9007199254740991,
"maximum": 9007199254740991,
"plan_id": "string",
"upgrade_url": "string"
}
}
}{
"error": {
"code": "invalid_request",
"message": "string",
"request_id": "string",
"details": [
{
"field": "string",
"message": "string"
}
],
"quota": {
"limit": "running_machines",
"current": 9007199254740991,
"maximum": 9007199254740991,
"plan_id": "string",
"upgrade_url": "string"
}
}
}{
"error": {
"code": "invalid_request",
"message": "string",
"request_id": "string",
"details": [
{
"field": "string",
"message": "string"
}
],
"quota": {
"limit": "running_machines",
"current": 9007199254740991,
"maximum": 9007199254740991,
"plan_id": "string",
"upgrade_url": "string"
}
}
}{
"error": {
"code": "invalid_request",
"message": "string",
"request_id": "string",
"details": [
{
"field": "string",
"message": "string"
}
],
"quota": {
"limit": "running_machines",
"current": 9007199254740991,
"maximum": 9007199254740991,
"plan_id": "string",
"upgrade_url": "string"
}
}
}{
"error": {
"code": "invalid_request",
"message": "string",
"request_id": "string",
"details": [
{
"field": "string",
"message": "string"
}
],
"quota": {
"limit": "running_machines",
"current": 9007199254740991,
"maximum": 9007199254740991,
"plan_id": "string",
"upgrade_url": "string"
}
}
}{
"error": {
"code": "invalid_request",
"message": "string",
"request_id": "string",
"details": [
{
"field": "string",
"message": "string"
}
],
"quota": {
"limit": "running_machines",
"current": 9007199254740991,
"maximum": 9007199254740991,
"plan_id": "string",
"upgrade_url": "string"
}
}
}{
"error": {
"code": "invalid_request",
"message": "string",
"request_id": "string",
"details": [
{
"field": "string",
"message": "string"
}
],
"quota": {
"limit": "running_machines",
"current": 9007199254740991,
"maximum": 9007199254740991,
"plan_id": "string",
"upgrade_url": "string"
}
}
}{
"error": {
"code": "invalid_request",
"message": "string",
"request_id": "string",
"details": [
{
"field": "string",
"message": "string"
}
],
"quota": {
"limit": "running_machines",
"current": 9007199254740991,
"maximum": 9007199254740991,
"plan_id": "string",
"upgrade_url": "string"
}
}
}{
"error": {
"code": "invalid_request",
"message": "string",
"request_id": "string",
"details": [
{
"field": "string",
"message": "string"
}
],
"quota": {
"limit": "running_machines",
"current": 9007199254740991,
"maximum": 9007199254740991,
"plan_id": "string",
"upgrade_url": "string"
}
}
}{
"error": {
"code": "invalid_request",
"message": "string",
"request_id": "string",
"details": [
{
"field": "string",
"message": "string"
}
],
"quota": {
"limit": "running_machines",
"current": 9007199254740991,
"maximum": 9007199254740991,
"plan_id": "string",
"upgrade_url": "string"
}
}
}{
"error": {
"code": "invalid_request",
"message": "string",
"request_id": "string",
"details": [
{
"field": "string",
"message": "string"
}
],
"quota": {
"limit": "running_machines",
"current": 9007199254740991,
"maximum": 9007199254740991,
"plan_id": "string",
"upgrade_url": "string"
}
}
}