--- description: "POST /v1/custom-model/{id}/phrases \u2014 add phrases to a custom model. Idempotent: existing phrases are reported as skipped." --- # Add Phrases Add phrases to a custom model. Adding is idempotent: phrases already present are left unchanged and reported as skipped. ``` POST https://api.reson8.dev/v1/custom-model/{id}/phrases ``` ## Request ### Headers | Header | Value | |----------------|-----------------------------------------------| | Authorization | `ApiKey ` or `Bearer ` | | Content-Type | `application/json` | ### Path Parameters | Parameter | Type | Description | |-----------|--------|--------------------------| | `id` | string | ID of the custom model | ### Body | Field | Type | Required | Description | |-----------|----------|----------|--------------------------------------| | `phrases` | string[] | Yes | Phrases to add (must not be empty) | ### Example === "curl" ```bash curl -X POST "https://api.reson8.dev/v1/custom-model/a1b2c3d4-e5f6-7890-abcd-ef1234567890/phrases" \ -H "Authorization: ApiKey " \ -H "Content-Type: application/json" \ -d '{ "phrases": ["pericarditis", "atrial fibrillation"] }' ``` === "Python" ```python import requests response = requests.post( "https://api.reson8.dev/v1/custom-model/a1b2c3d4-e5f6-7890-abcd-ef1234567890/phrases", headers={ "Authorization": "ApiKey ", "Content-Type": "application/json", }, json={"phrases": ["pericarditis", "atrial fibrillation"]}, ) result = response.json() ``` ## Response `200 OK` | Field | Type | Description | |-----------|--------|--------------------------------------------------------------| | `added` | number | Number of phrases newly added | | `skipped` | number | Number of submitted phrases not added (already present or duplicate) | ### Example In the request above `atrial fibrillation` was already in the model: ```json { "added": 1, "skipped": 1 } ``` ## Errors | Status | Code | Description | |--------|-------------------|--------------------------------------------------| | 400 | `INVALID_REQUEST` | Empty list, blank phrase, or per-model limit hit | | 401 | `UNAUTHORIZED` | Invalid or expired credentials | | 404 | `NOT_FOUND` | Custom model not found | | 500 | `INTERNAL_ERROR` | Unexpected server error |