Verify a hashed value through the API
Check whether a value matches a Hashed field with the verify endpoint. The response says only whether it matches. It never returns the stored value.
Before you start
- The model has a text field whose Secret option is Hashed: verify only, never readable. See Set a sealed or hashed field.
- The entry exists, and your request can read it. An anonymous request gets 403. See Read and write content with the REST API for how to send an authenticated request.
Verify a value
- Send a
POSTrequest to/wp-json/morphic/v1/items/<model>/<entry-id>/verify. Replace<model>with the model's name and<entry-id>with the entry's ID. - Send a JSON body with the hashed field's name in
fieldand the value to check invalue. For example:{"field": "pin", "value": "4821"}. - Read the response.
Result: The response is {"match": true} when the value matches the stored hash, and {"match": false} when it does not.
If the request fails
- If the field is not a Hashed field, the response is HTTP 422 with the message
<field> is not a hashed secret, for examplepin is not a hashed secret, and the reasonnot_hash. Check the field name and the field's Secret option. - If the value is longer than 4096 characters, the response says
value is too long. - If you send more than 10 verify requests in 5 minutes for the same entry and caller, the response says
too many attempts; try again in a few minutes. Each request restarts the 5-minute window. Requests that are blocked do not extend it.
For the full list of messages, see Sealed and hashed fields reference.