. . . . .. .. .: . . .. . . .:.. .. .. .. . .. .+... . .. .::..: .. ... ..............:.+. . .. . .:..::::---=. ..:---:. . .=--=-:.-::..=:-:. . .. ..... . . .-. . .:==-----+=-:. :--:.=.-..... . .-===::---:-:::::. ..::-:--:. . .:.=.::--.. . ..... ..:-=== ===.-:: .::::..:: .:.... ..:==-=+=+=-=-=::.+.:.... .:-:::.. ...+... .:.:::-=++::.. .=.. . .. ..-...:..::+====.++=-:+::.... .::::---=::.. ..:::-=+==-+X+===-:.:-+=--::=:: ..::.:. .:..:+::=:::--=+XX+---:...::.... .. ..:.+....:--.::-:---=+X++++==-:::::......::==++--:..:==--=-=--==+X==++=---+-=+==--::. .:::: :-::::--+=--=+XXXXX++=---:=-:.:....=.... .. ..::::-=-::=++==+XX.XX+X+----==.--::.:-=+X+X+===-=X+===----== XXXX++++==++++++==-:....:::.==-=--==XXX=XXXX-X:++==-++=:::--:::::....= ...:.-::-====-.-=++:+XXXXXX+==-==++=----- =XXXXXXXXXXXXX++=---:==+X.XX.+XXXXXX+X+XX++++-:.::--=X++:X =XXXXX++.XX++X++X+++--::--:-::::.:. .-..::.-=====-=-=++:+XXXXXX+==-==++=----- =XXXXXXXXXXXXX++=---:==+X.XX.+XXXXXX+X+XX++++-:.::--=X++:X =XXXXX++.XX++X++X+++--::--:-::::.:.

Errors

Read about the different types of errors returned by the API.
View
epuraı

Errors

The Repurai API uses standard HTTP status codes and returns the same JSON format for every error.

Error format

{
  "error": "NOT_FOUND",
  "message": "No feed with that ID exists in your workspace",
  "status": 404
}
FieldTypeDescription
errorstringA short code identifying the type of error.
messagestringA plain-English description of what went wrong.
statusintegerThe HTTP status code (same as the response status).

Error codes

CodeHTTP StatusMeaning
UNAUTHORIZED401The Authorization header is missing, incorrect, or the API key is invalid.
FORBIDDEN403The API key is valid but doesn't have access to this resource.
NOT_FOUND404The requested resource doesn't exist or isn't in your workspace.
VALIDATION_ERROR422Something in the request body or URL parameters is invalid. Check message for details.
SERVER_ERROR500Something went wrong on our end.

Locked feeds

When your plan changes to one with fewer sources (for example Business to Pro), the feeds past the new limit stay in your workspace but are locked. They are listed with isLocked: true in GET /feeds and GET /categories/:id, and nothing is deleted: upgrading opens them again.

Anything that reads or works on a locked feed answers 403 FORBIDDEN, with a message that says why and which plan opens it:

  • Reading the feed or its posts (GET /feeds/:id, GET /feeds/:id/posts, GET /posts/:postId)
  • AI summaries and transcripts of its posts (/ai/summarize/:postId, /ai/transcript/:postId)
  • Saving one of its posts to read later (removing a saved post always works)
  • Refreshing it (POST /feeds/:id/refresh); POST /feeds/refresh skips locked feeds

Lists such as GET /posts, GET /posts/today and GET /posts/search never include posts from locked feeds.

{
  "error": "FORBIDDEN",
  "message": "Your Pro plan includes 200 sources, so this one is locked. Upgrade to Business to open it again.",
  "status": 403
}

Handling errors

Always check the HTTP status code before reading the response body:

const res = await fetch('https://repurai.com/api/v1/feeds', {
  headers: { Authorization: `Bearer ${process.env.REPURAI_API_KEY}` },
})

if (!res.ok) {
  const err = await res.json()
  console.error(`[${err.error}] ${err.message}`)
  if (res.status === 401) { /* check your API key */ }
  if (res.status === 404) { /* resource doesn't exist */ }
  return
}

const data = await res.json()
import requests, os

res = requests.get(
  'https://repurai.com/api/v1/feeds',
  headers={'Authorization': f"Bearer {os.environ['REPURAI_API_KEY']}"},
)

if not res.ok:
  err = res.json()
  print(f"[{err['error']}] {err['message']}")
else:
  data = res.json()