Extend the sink expiry for a long-running remote run
Pushes sink_expires_at out to now() + ttl_seconds, clamped to REMOTE_RUN_SINK_MAX_TTL_SECONDS, and bumps last_heartbeat_at (the column the stall watchdog reads). Extendable sinks are the open ones (not closed, not already expired) on a run in the caller's org and space that the caller may READ: runs:read is the runs they launched, runs:read-all the whole space. Anything else returns 404 rather than confirming the run exists.
PATCH
/api/runs/{runId}/sink/extendbetter-auth.session_token<token>
Cookie session from Better Auth. Requires X-Org-Id header for org-scoped routes.
In: cookie
Path Parameters
runId*string
Header Parameters
X-Org-Id?string
Organization ID. Required for cookie auth. Not needed for API key auth (org resolved from key).
Format
uuidRequest Body
application/json
curl -X PATCH "https://your-instance/api/runs/string/sink/extend" \ -H "Content-Type: application/json" \ -d '{ "ttl_seconds": 1 }'{
"id": "string",
"expiresAt": "2019-08-24T14:15:22Z"
}{
"type": "https://docs.appstrate.dev/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"detail": "name: Invalid input: expected string, received undefined (+2 more)",
"code": "validation_failed",
"request_id": "req_abc123",
"errors": [
{
"field": "name",
"code": "required",
"message": "Invalid input: expected string, received undefined"
},
{
"field": "email",
"code": "invalid_format",
"message": "Invalid email address"
},
{
"field": "age",
"code": "invalid_type",
"message": "Invalid input: expected number, received string"
}
]
}{
"type": "https://docs.appstrate.dev/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "Invalid or missing session",
"code": "unauthorized",
"request_id": "req_abc123"
}{
"type": "https://docs.appstrate.dev/errors/forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Insufficient permissions",
"code": "forbidden",
"request_id": "req_abc123"
}{
"type": "https://docs.appstrate.dev/errors/not-found",
"title": "Not Found",
"status": 404,
"detail": "Resource not found",
"code": "not_found",
"request_id": "req_abc123"
}{
"type": "https://docs.appstrate.dev/errors/rate-limited",
"title": "Rate Limited",
"status": 429,
"detail": "Too many requests. Please try again shortly.",
"code": "rate_limited",
"request_id": "req_abc123",
"retry_after": 30
}