A handoff for your workflow
A small API.
A lot of possibility.
Create a document, get a code, and let Petaes take care of the recipient’s next step.
Send requests to the same website origin. Base URL:
http://127.0.0.1:4173/end1. Create an API key
Sign in to your workspace, open API keys, and create a key. Save the secret when it appears. Send it in an X-API-Key header or as a Bearer token.
2. Create a sharing code
Send JSON to POST /end/delivery. The example shares a link; the recipient sees the destination before continuing.
curl http://127.0.0.1:4173/end/delivery \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY' \
-d '{
"name": "Project handoff",
"redirectUrl": "https://example.com/document",
"recipientEmail": "reader@example.com",
"expiresInDays": 7
}'For a file, replace redirectUrl with fileData containing a base64 data URL, and add fileName. Example: data:text/plain;base64,SGVsbG8=. The decoded file limit is 8 MB. Each account can store 64 MB and 500 documents.
3. Pass it along
The 201 response includes code, shareUrl, downloadUrl, and expiresAt. Copy the code or link into your own message. Petaes does not send email.
The useful endpoints
| Method | Endpoint | Purpose |
|---|---|---|
| POST | /end/user/signup | Create account and session |
| POST | /end/user/login | Start a session with email/password |
| POST | /end/user/logout | End the current session |
| GET | /end/auth/session | Get the signed-in user, or null |
| POST | /end/delivery | Create file or HTTPS-link delivery |
| GET | /end/delivery/:code | Look up an active code |
| GET | /end/delivery/:code/file | Download a shared file |
| GET | /end/deliveries/mine | List your deliveries |
| DELETE | /end/delivery/:code | Revoke a delivery you own |
| GET / POST | /end/keys | List / create your API keys (session) |
| DELETE | /end/keys/:id | Revoke your API key (session) |
A few details
- Authentication is required to create and manage deliveries. A recipient needs only the six-character code.
- Expiry can be 1, 7, or 30 days; the default is 7.
- Custom codes contain exactly six letters or numbers. They are case insensitive. Generated codes contain six digits, including leading zeros.
- Duplicate codes return 409. Expired or revoked deliveries return 410. Invalid input returns 422. Rate limits return 429.
- API keys belong on your server, never inside public browser JavaScript.