Skip to main content
Use this endpoint to reset the inactivity timer on a running capsule. When a capsule is created with a non-zero timeout_sec, Wrenn automatically pauses it after that many seconds with no exec calls. Calling ping updates the last_active_at timestamp, restarting the countdown. Use it as a keepalive when your application is holding a capsule open but not actively executing commands.
If timeout_sec is 0 (auto-pause disabled), this endpoint still accepts the request and returns 204 — it simply has no effect on the TTL.

Endpoint

POST https://app.wrenn.dev/api/v1/capsules/{id}/ping

Authentication

Pass your API key in the X-API-Key header.
X-API-Key: wrn_your_key

Path parameters

id
string
required
The ID of the capsule to ping (e.g., cl-abc123). The capsule must be in running status.

Response

Returns 204 No Content on success. The response body is empty. The capsule’s last_active_at timestamp is updated server-side.

curl

curl --request POST \
  --url https://app.wrenn.dev/api/v1/capsules/cl-abc123/ping \
  --header 'X-API-Key: wrn_your_key'

Python SDK

from wrenn import Capsule

capsule = Capsule.connect("cl-abc123")
capsule.ping()
You can set up a periodic keepalive in a background thread or async task:
import threading
import time
from wrenn import Capsule

def keepalive(capsule, interval=60):
    while True:
        time.sleep(interval)
        try:
            capsule.ping()
        except Exception:
            break

capsule = Capsule(template="minimal", wait=True)
t = threading.Thread(target=keepalive, args=(capsule,), daemon=True)
t.start()

# Your main logic here — the capsule won't auto-pause while keepalive runs

Error responses

StatusDescription
401 UnauthorizedMissing or invalid X-API-Key.
404 Not FoundNo capsule with the given ID exists in your team.
409 ConflictThe capsule is not in running status. You can only ping a running capsule.