create_model
POST /v1/score/models creates a scoring model from its criteria, at once, or from labeled records, with a job to wait for.
Up to 100 new scoring models per organization per day. Created from labeled records, a scoring model is calibrated from the start; created from its criteria alone, it has no questions until you add your own or calibrate it. See Creating a scoring model. To add questions of your own, send add_questions (Changing questions).
Creates a scoring model, from either:
- Its
nameandcriteriaalone. Returns201with itsmodel_idat once. It has no questions yet: add your own to score records right away, each weighed by Finic's estimate, or calibrate it with labeled records, which has Finic write its questions and fit them to your data. - Labeled records in
data: past records whose outcomes you know. Returns202with itsmodel_idand ajob_id: wait for the job, about two minutes, then score records. It's calibrated to them from the start. For what to send, see Labeled records.
To try it here, open the playground and pick the 300 sample payments example: they're synthetic card payments in the same shape as the score example (also as sample-payments.csv). A scoring model built on sample data is only for trying Finic out.
Request body
multipart/form-data or application/json
| Field | Type | Description |
|---|---|---|
data | array of object or string | Optional. Labeled records: a JSON array of objects, or CSV text with a header row. Every row needs |
namerequired | string | Required. A few words for people to recognize the scoring model by, such as "Card-not-present payment fraud". |
criteria | string | What the decision is and what a bad outcome ( |
add_questions | array of string | Optional. Your own yes/no questions about a record, such as "Was the account opened less than a week before the payment?". Created from labeled records, the scoring model uses the ones that help, alongside Finic's, and the others are listed as not used on its page in the Finic app. Created from criteria alone, they're its only questions until its first calibration, each weighed by Finic's estimate. Up to 20 at a time, and 50 per scoring model. |
| Field | Type | Description |
|---|---|---|
file | string | Optional. The labeled records, as CSV with a header row or a JSON array, every row with |
namerequired | string | Required. A few words for people to recognize the scoring model by, such as "Card-not-present payment fraud". |
criteria | string | What the decision is and what a bad outcome ( |
add_questions | string | Optional. Your own questions, one per field (repeat it), or as a JSON array of strings. See |
Responses
Created from its criteria alone, the scoring model is ready, with no questions but any in add_questions.
| Field | Type | Description |
|---|---|---|
model_id | string | The scoring model's id, |
request_id | string |
|
Created from labeled records, the scoring model is being created.
| Field | Type | Description |
|---|---|---|
model_id | string | The scoring model's id, |
job_id | string | The job creating it, |
request_id | string |
|
| Status | Type and when |
|---|---|
400 |
|
401 |
|
413 |
|
429 |
|
503 |
|
Every error has the same shape; see Errors.
Examples
curl -X POST 'https://api.finic.ai/v1/score/models' \ -H "Authorization: Bearer $FINIC_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "name": "Card-not-present payment fraud", "criteria": "Card-not-present payments at an online store. Bad: the payment was charged back as fraud within 90 days."}'{ "model_id": "scm_01M4XRC000RT2GZSKYPD8J86G9", "request_id": "req_01M4Y7FASG9DB7MMWCS672J0JD"}