API referenceScore

get_job_status

GET /v1/jobs/{job_id} says whether creating or calibrating a scoring model has finished, and why it failed if it did.

Creating and calibrating a scoring model run as jobs.

GET
/v1/jobs/{job_id}

Whether creating or calibrating a scoring model has finished. It doesn't report progress: check every 10 seconds or so until complete is true. Not counted toward the request rate.

It also answers for a KYB enrichment job, with its kind, its status and, when it succeeded, its result. Finished KYB jobs are kept for 30 days.

Path parameters

FieldTypeDescription
job_idrequiredstring

The job_id from creating or calibrating a scoring model.

Responses

complete is true once the job has finished, whether it succeeded or failed. Complete without an error means the scoring model is ready, or its calibration is in use. A failed creation leaves the scoring model unusable (create a new one); a failed calibration leaves it as it was.

FieldTypeDescription
job_idstring

The job's id

completeboolean

Whether the job has finished.

errorobject

Only when the job failed.

Only when the job failed.

FieldTypeDescription
typestring
  • no_questions: the calibration left no questions to score with. Add questions and calibrate again.
  • internal_error: something failed on Finic's side. Create or calibrate the scoring model again.
  • unavailable: creating or calibrating scoring models isn't available right now. Try again later.
  • conflict: the scoring model changed during the calibration. Calibrate again.
messagestring

What to do.

Examples

Example Request
curl -X GET 'https://api.finic.ai/v1/jobs/string' \  -H "Authorization: Bearer $FINIC_API_KEY"
Example Response
{  "job_id": "job_01M4XZXNCRZBPXV30MSF7RN5H3",  "complete": true}

Waiting for a job

import os
import time

import requests


def wait_for_job(job_id: str) -> None:
    while True:
        r = requests.get(f"https://api.finic.ai/v1/jobs/{job_id}",
                         headers={"Authorization": f"Bearer {os.environ['FINIC_API_KEY']}"}, timeout=30)
        r.raise_for_status()
        job = r.json()
        if job["complete"]:
            if "error" in job:
                raise RuntimeError(f"{job['error']['type']}: {job['error']['message']}")
            return
        time.sleep(30)

On this page