Idempotency
Safely retry requests without creating duplicate resources.
Network failures, client timeouts, and double-clicks can cause the same request to fire more than once. Obligo supports idempotency on create requests, and on the update and delete requests that support it, so retries return the same outcome as the first successful attempt.
idempotencyId query parameter
Include idempotencyId as a query parameter on create requests, and on the update and delete requests that support it.
Request
curl -X POST "https://api.sandbox.myobligo.com/leases?idempotencyId=7c9e6679-7425-40de-944b-e07fc1f90ae7" \
-u "$CLIENT_ID:$CLIENT_SECRET" \
-H "Obligo-Version: 1.2" \
-H "Content-Type: application/json" \
-d '{
"propertyId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"unit": "4B",
"rent": 250000,
"startsAt": "2026-05-01",
"endsAt": "2027-04-30",
"household": [
{
"renterId": "550e8400-e29b-41d4-a716-446655440000",
"role": "LeaseHolder",
"primary": true
}
]
}'Use a unique value per logical operation — typically a UUID v4 generated by your client. The key is scoped to the endpoint and your app. Obligo doesn't compare request bodies or path IDs: reusing a key on the same endpoint returns the first response, even for a different body or resource.
Semantics
| Behavior | Description |
|---|---|
| First request | Processed normally. A 2xx response is stored under the key. |
| Retry (same key) | Returns the stored HTTP status and body. |
| Failed first request | A non-2xx first response isn't stored, so a retry runs again. |
| Retry while the first request is running | Returns 409 or 400. |
| Retention | Keys are kept for 24 hours after the first successful response. |
| Key format | Any string is accepted as a key. UUID v4 is recommended. |
Idempotency deduplicates retries that reuse a key. The first request is authorized and validated as usual. A retry that matches a stored response gets that response back, and on some endpoints, such as creating a lease, it isn't authorized or validated again.
Best practices
- Generate
idempotencyIdbefore sending the request and persist it until you receive a definitive response. - Prefer UUID v4 values to avoid collisions across clients and environments.
- Do not recycle keys across unrelated operations.
Endpoints that accept idempotencyId are listed in the API Reference for each operation.
Summary
| Aspect | Detail |
|---|---|
| Delivery | Query parameter idempotencyId on create requests, and on the update and delete requests that support it. |
| Format | Any string; UUID v4 recommended. |
| Retention | 24 hours after the first successful response. |
| Scope | Endpoint and app. |