Docs
Share and connect

Use the API and webhooks

Create an API key, call the API from your code and get a webhook when a forecast finishes.

Steps

  1. Open Settings, choose API and AI clients, then Create new key.
  2. Name the key, tick what it may do, choose when it expires and choose Create key.
  3. Copy the key straight away. Prolepsia shows it only once.
  4. Choose API reference, then Authorize, and paste your key to try calls from the browser.
  5. Create a question with a POST to /api/v1/external/questions.
  6. Start a forecast with a POST to /api/v1/external/questions/{question_id}/forecasts. It returns a task ID straight away.
  7. Read the forecast with a GET to /api/v1/external/forecasts/{task_id} until its status is completed, failed or cancelled.
  8. To skip polling, open the Webhooks tab in Settings and choose Add webhook. Prolepsia calls your server when a forecast finishes.

Good to know

  • Send the key in the Authorization header as Bearer, or in the X-Api-Key header.
  • Check each webhook call with its signing secret, which Prolepsia shows once when you add the webhook.

Analytics cookies

Prolepsia uses analytics cookies to learn how people use the app. They link your visits together and can record how you move through pages, with all text and typed values hidden. Until you accept, Prolepsia only counts visits anonymously, without cookies. Read the privacy policy