Create a classifier
const url = 'https://example.com/v1/t/adapters/ids/classifier';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"model_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","description":"example","intent":{"intents":[{"id":"example","description":"example","phrase":{"phrases":["example"]}}]}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/t/adapters/ids/classifier \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "model_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "description": "example", "intent": { "intents": [ { "id": "example", "description": "example", "phrase": { "phrases": [ "example" ] } } ] } }'Records a new classifier at its first version (0) owned by the account, and queues its training. Later content changes are saved with PUT /v1/classifier/{id}/account/{account_sid}, which records the next version rather than altering this one.
Permission
This operation needs the permission tenant:scenario_template:manage.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Names the target tenant.
By principal:
- A tenant-scoped principal may omit it.
- A principal with no tenant of its own names one here.
Refused when:
- A tenant-scoped principal sends a value naming any other tenant.
- A principal with no tenant of its own omits it.
Request Bodyrequired
Section titled “Request Bodyrequired”Training-relevant content of a classifier.
object
object
object
object
Examplegenerated
{ "model_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "description": "example", "intent": { "intents": [ { "id": "example", "description": "example", "phrase": { "phrases": [ "example" ] } } ] }}Responses
Section titled “Responses”Created
One immutable version of a classifier, addressed by the account, the classifier id and the version number.
object
Version number. 0 is an ordinary version like any other — the first one a classifier gets, and the one existing scenario bricks name.
object
object
object
Identity of this version’s training-relevant content. Two versions of one classifier can never carry the same value; it is what lets identical content resolve to an existing version instead of training again.
Why the last training run of this version ended as it did. Present on a single-version read; absent from list entries.
object
Why the last training run failed. Absent unless it failed.
When the training run was queued. Absent if none was ever queued.
When the training run last changed state. Absent if none was ever queued.
Example
{ "state": "new"}Bad request
object
Examplegenerated
{ "name": "example", "message": "example", "code": 1, "status": 1}Unauthorized
Forbidden
Internal server error
object
Examplegenerated
{ "name": "example", "message": "example", "code": 1, "status": 1}Bad gateway (upstream adapter error)