DraftFilterDeveloper API

Developer reference

Quickstart

Use the dashboard to create an API key, then call the public API with either Authorization: Bearer or X-Api-Key. Store the key in an environment variable for local testing:

bash
export DF_API_KEY="df_live_key_..."

Create a score request body:

json
{
  "idempotencyKey": "score-demo-001",
  "items": [
    {
      "id": "post-1",
      "text": "The new product update introduces faster exports and clearer team permissions."
    }
  ]
}

Submit it:

bash
curl -sS https://api.draftfilter.com/v1/score-jobs \
  -H "Authorization: Bearer $DF_API_KEY" \
  -H "Content-Type: application/json" \
  --data @score-request.json

The API accepts work asynchronously and returns a job id:

json
{
  "jobId": "job_000123",
  "state": "queued"
}

Poll the job:

bash
curl -sS https://api.draftfilter.com/v1/score-jobs/job_000123 \
  -H "Authorization: Bearer $DF_API_KEY"

When the score job succeeds, each result contains the original item id and is_ai. 0 means 0% AI-like, and 100 means 100% AI-like.

json
{
  "jobId": "job_000123",
  "state": "succeeded",
  "results": [
    {
      "id": "post-1",
      "is_ai": 18
    }
  ]
}

For rewrite jobs, use /v1/rewrite-jobs with the same authentication pattern. Rewrite responses include the original and rewritten is_ai values plus the selected rewrittenText.

For a runnable local example that creates, polls, lists, paginates, cancels, and handles API errors, use examples/api-client-python.