Create model objectives
POST /api/v1/predictive-models/objectives: request fields and declared response contract.
POST/api/v1/predictive-models/objectives
| Permission | dataPipelines.manage |
|---|---|
| Workspace scope | required |
| Scope target | workspace |
Request body
| Field | Type | Required | Nullable | Default |
|---|---|---|---|---|
| objectiveKey | string | required | non-null | — |
| name | string | required | non-null | — |
| taskType | "binary_classification" | "multiclass_classification" | "regression" | required | non-null | — |
| contract | object | required | non-null | — |
| contract.contractVersion | integer | optional | non-null | 1 |
| contract.predictionHorizon | object | required | non-null | — |
| contract.predictionHorizon.unit | "days" | "weeks" | "months" | required | non-null | — |
| contract.predictionHorizon.amount | integer | required | non-null | — |
| contract.semanticInputs | array | required | non-null | — |
| contract.output | object | required | non-null | — |
| contract.output.targetName | string | required | non-null | — |
| contract.output.valueType | "boolean" | "number" | "category" | required | non-null | — |
| contract.output.categories | array | optional | non-null | — |
| contract.successMeasures | array | required | non-null | — |
Response
201
| Field | Type | Required | Nullable | Default |
|---|---|---|---|---|
| data | object | required | non-null | — |
| data.id | string | required | non-null | — |
| data.companyId | string | required | non-null | — |
| data.workspaceId | string | required | non-null | — |
| data.objectiveKey | string | required | non-null | — |
| data.revision | integer | required | non-null | — |
| data.state | "draft" | "active" | "archived" | required | non-null | — |
| data.name | string | required | non-null | — |
| data.taskType | "binary_classification" | "multiclass_classification" | "regression" | required | non-null | — |
| data.contract | object | required | non-null | — |
| data.contract.contractVersion | integer | required | non-null | 1 |
| data.contract.predictionHorizon | object | required | non-null | — |
| data.contract.predictionHorizon.unit | "days" | "weeks" | "months" | required | non-null | — |
| data.contract.predictionHorizon.amount | integer | required | non-null | — |
| data.contract.semanticInputs | array | required | non-null | — |
| data.contract.output | object | required | non-null | — |
| data.contract.output.targetName | string | required | non-null | — |
| data.contract.output.valueType | "boolean" | "number" | "category" | required | non-null | — |
| data.contract.output.categories | array | optional | non-null | — |
| data.contract.successMeasures | array | required | non-null | — |
| data.createdAt | string | required | non-null | — |
| data.updatedAt | string | required | non-null | — |
Declared failures
| ACCESS_DENIED | 403 — not retryable |
|---|---|
| CORE_ERROR | 500 — not retryable |
| GOVERNANCE_DENIED | 403 — not retryable |
| QUOTA_DENIED | 429 — retryable |
| VALIDATION_ERROR | 400 — not retryable |
| VALIDATION_INPUT_ERROR | 400 — not retryable |
Readback
Read the result back with:
- predictiveModels.objective.read
Request example
Schematic only. Replace placeholders with real values and include all required nested fields.
POST /api/v1/predictive-models/objectives HTTP/1.1
Authorization: Bearer <token>
x-merulan-workspace-id: <workspace-id>
Content-Type: application/json
{
"objectiveKey": "<objectiveKey>",
"name": "<name>",
"taskType": "binary_classification",
"contract": {}
}