Check a draft for robotic patterns
POST /v1/score checks a draft for the robotic patterns Letra flags, such as "not X, but Y", lists of three, slogan endings and placeholders, and for a voice's own avoid words and hashtag rule.
It answers each flag with where it sits in the text. No model runs and nothing is stored, so it is free and fast enough to run on every draft.
Request
curl https://letralayer.com/api/v1/score \ -H "Authorization: Bearer $LETRA_API_KEY" \ -H "Content-Type: application/json" \ -d '{"text":"No fluff, just bread.","voice_ref":"user-42","channel":"linkedin"}'| Field | What it holds |
|---|---|
text | Required. The draft, up to 20,000 characters. |
voice_ref or voice_id | Optional. A voice: its avoid words, allowed patterns and hashtag rule apply. Left out, only the robotic patterns are checked. |
channel | Optional. A channel slug of the voice, for that channel's words and hashtag rule. |
avoid | Optional. Words to flag, instead of the voice's. |
hashtag_cap | Optional. The most hashtags allowed. -1 skips the check. |
allow | Optional. Patterns to let through, from the list below. |
What you send wins over what the voice holds. The patterns a voice or a call may allow:
| allow_patterns |
|---|
| triad |
| negative_parallel |
| negative_tag |
| slogan_tail |
| dash |
Answer
{ "text": "No fluff, just bread.", "clean": false, "spans": [ { "rule": "...", "start": 0, "end": 8, "text": "No fluff" } ], "channel": "linkedin", "mode": "rules", "score": null}cleanis true when nothing was flagged.spanspoint at each flag: the rule that caught it and its offsets intext, the draft as Letra read it.scoreis null: the 0 to 100 Letra Score needs a voice to measure against, and isn't answered yet.