get_job_status
GET /v1/jobs/{job_id} says whether creating or calibrating a score has finished, and why it failed if it did.
Creating and calibrating a score run as jobs.
Whether creating or calibrating a score has finished. It doesn't report progress: check every 30 seconds or so until complete is true. Not counted toward the request rate.
Path parameters
| Field | Type | Description |
|---|---|---|
job_idrequired | string | The |
Responses
complete is true once the job has finished, whether it succeeded or failed. Complete without an error means the score is ready, or its calibration is in use. A failed creation leaves the score unusable (create a new one); a failed calibration leaves the score as it was.
| Field | Type | Description |
|---|---|---|
job_id | string | The job's id |
complete | boolean | Whether the job has finished. |
error | object | Only when the job failed. |
Only when the job failed.
| Field | Type | Description |
|---|---|---|
type | string |
|
message | string | What to do. |
| Status | Type and when |
|---|---|
401 |
|
404 |
|
Every error has the same shape; see Errors.
Examples
curl -X GET 'https://api.finic.ai/v1/jobs/string' \ -H "Authorization: Bearer $FINIC_API_KEY"{ "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)