Ping Endpoint
The ping endpoint accepts heartbeat signals from your jobs.
Base URL
Section titled “Base URL”https://ping.pakyas.com/{public_id}The public_id is the unique identifier for your check, shown in the dashboard.
Endpoints
Section titled “Endpoints”Success Ping
Section titled “Success Ping”Signal that a job completed successfully.
curl -fsS https://ping.pakyas.com/{public_id}| Method | GET or POST |
|---|---|
| Response | 200 OK |
Start Ping
Section titled “Start Ping”Signal that a job has started.
curl -fsS https://ping.pakyas.com/{public_id}/start| Method | GET or POST |
|---|---|
| Response | 200 OK |
Fail Ping
Section titled “Fail Ping”Signal that a job has failed.
curl -fsS https://ping.pakyas.com/{public_id}/fail| Method | GET or POST |
|---|---|
| Response | 200 OK |
Exit Code Ping
Section titled “Exit Code Ping”Signal completion with a specific exit code. Non-zero is treated as failure.
curl -fsS https://ping.pakyas.com/{public_id}/1| Method | GET or POST |
|---|---|
| Response | 200 OK |
| Path Parameter | Exit code (0-255) |
Duration Tracking
Section titled “Duration Tracking”For accurate duration measurement, send the measured time with your completion ping:
Header (recommended):
curl -H "X-Pakyas-Duration: 1523" https://ping.pakyas.com/{id}Query parameter:
curl "https://ping.pakyas.com/{id}?duration=1523"The server uses this value if provided, otherwise calculates duration from start/end timestamps.
Notes:
- Duration is only accepted on completion pings (success/fail), not start pings
- Must be a non-negative integer in milliseconds
- Maximum: 7 days (604,800,000 ms)
- Client-supplied duration is trusted; Pakyas does not verify it
Request Body
Section titled “Request Body”For POST requests, you can include a body with error details:
curl -X POST https://ping.pakyas.com/{public_id}/fail \ -H "Content-Type: text/plain" \ -d "Error: Connection refused to database"The body is stored and included in alerts. A JSON body’s log field is stored the same way:
curl -X POST https://ping.pakyas.com/{public_id}/fail \ -H "Content-Type: application/json" \ -d '{"log": "Error: Connection refused to database"}'Body size limits
Section titled “Body size limits”How much of the body Pakyas keeps depends on your organization’s plan:
| Plan | Body kept |
|---|---|
| Free | 5 KB |
| Developer | 25 KB |
| Pro | 100 KB |
| Business | 250 KB |
A longer body is still accepted and the ping is recorded, but only the first 5/25/100/250 KB of the body is kept (cut on a character boundary).
The ping endpoint accepts bodies up to 250 KB (256,000 bytes). A larger plain text body is rejected with 413 Payload Too Large, and the ping is not recorded. A JSON log larger than that is cut to 250 KB instead of rejected.
Response Codes
Section titled “Response Codes”| Code | Meaning |
|---|---|
| 204 | Ping accepted (no response body) |
| 400 | The public ID isn’t a valid UUID, or the body is invalid |
| 413 | Plain text body over 250 KB; the ping was not recorded |
| 429 | Rate limited; see the X-RateLimit-* headers |
| 502, 503 | The ping couldn’t be queued; it was not recorded, so retry |
Examples
Section titled “Examples”From Cron
Section titled “From Cron”# Simple success ping0 * * * * /path/to/job.sh && curl -fsS https://ping.pakyas.com/{id}
# With start/success/fail0 * * * * curl -fsS https://ping.pakyas.com/{id}/start && /path/to/job.sh && curl -fsS https://ping.pakyas.com/{id} || curl -fsS https://ping.pakyas.com/{id}/failFrom Script
Section titled “From Script”#!/bin/bashcurl -fsS https://ping.pakyas.com/{id}/start
if ./my-job.sh 2>&1 | tee /tmp/output.log; then curl -fsS https://ping.pakyas.com/{id}else curl -fsS https://ping.pakyas.com/{id}/fail -d @/tmp/output.logfiFrom Python
Section titled “From Python”import requests
def ping_success(check_id): requests.get(f"https://ping.pakyas.com/{check_id}")
def ping_fail(check_id, error_message): requests.post( f"https://ping.pakyas.com/{check_id}/fail", data=error_message )Reliability
Section titled “Reliability”- Pings are idempotent - sending the same ping multiple times is safe
- Timeout: 10 seconds recommended
- Retry: 1-2 retries on failure is recommended for critical jobs