Choose the model a role uses in this world
const url = 'http://localhost:11044/api/v1/config/router/roles/example';const options = { method: 'PUT', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"model":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url http://localhost:11044/api/v1/config/router/roles/example \ --header 'Content-Type: application/json' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \ --data '{ "model": "example" }'A blank model returns a built-in role to the deployment’s choice. A custom role always needs one.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A role id, as GET /config/router lists it
Request Bodyrequired
Section titled “Request Bodyrequired”model: one of the chat models GET /config/router lists, trimmed, which the role then uses in this world. Blank or omitted removes the world’s override so a built-in role falls back to the deployment’s choice; a custom role refuses that with 400, as does an unknown model
Body of PUT /config/router/roles/{id}: the model a role uses in this world
object
The model the role uses in this world; blank for the deployment’s choice
Example generated
{ "model": "example"}Responses
Section titled “Responses”Changed; takes effect on the next request
The change was applied and the world’s config saved; it takes effect on the next request
object
Always true. A client that only branches on the status code can ignore it; one that reads the body does not have to special-case the shape
Unknown role or model
The change was refused and nothing was saved. The status code says which kind of refusal: 400 for something unknown or invalid, 409 while a context still uses the role
object
Why it was refused, written to be shown. Carries the router’s own sentence, which names the context, role or model at fault
Always false

