Skip to content

Why do verified Replicate callbacks fail after my server parses the JSON?

Use the original received body for signature verification. Parsing JSON and then serializing it can change spacing or representation even if the same data is visible. Verify the signature, original headers and timestamp before processing the event.

SHIP A RELIABLE INTEGRATIONAISwapLab team · Editorial methodPublished 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval

Capture the body once

Configure the callback handler to retain original bytes for the supported verifier. Parse a copy only after verification when your runtime allows.

Test safely with fixtures

Use a known matching body plus harmless modifications between test passes. Reject invalid messages without advancing the job or firing a delivery.

Example

A parser can reformat the payload's whitespace while retaining exactly the same prediction identifier.

Pass condition

Valid fixture callbacks still verify through middleware, and changed fixture bodies cannot alter local job state.

Sources

One task. A recoverable workflow.

Check the contract, approve the quote and retain the job.

Open API documentation