Creates a new AI assistant with the specified configuration. The request body is passed directly to the Mongoose model constructor. Only the name field is required by the schema (other fields have defaults). If institution is an empty string it is removed from the body. Auto-reset logic is applied before saving. If institution_shared is true but no institution is provided, institution_shared is reset to false. If account_shared is true but institution_shared is not true, account_shared is reset to false. Duplicate assistants (same name + user + institution) are caught as a 400 error by the unique index constraint, not as a 409.
JWT token passed in x-access-token header
Name of the assistant (required, must be unique per user+institution)
"New Assistant 1"
Status of the assistant
active, unpublished, inactive, deleted "active"
Description of the assistant
"New Assistant Description"
Behavioral instructions for the assistant
"New Assistant Instructions"
Optional argument 1
Optional argument 2
Optional argument 3
Optional argument 4
Optional argument 5
URL for the assistant's profile picture
"https://example.com/image.jpeg"
Whether the assistant is restricted to admin users
true
Number of conversation history items to remember
3
Whether the assistant can be edited by other users
true
User ObjectId who owns this assistant
"6430d02554cd4e00403e8b05"
Institution ObjectId. If empty string, field is removed.
"6631915765bb0a94cfd6ca99"
Whether shared with the institution. Auto-reset to false if no institution provided.
true
Whether shared across the account. Auto-reset to false if institution_shared is not true.
false
Whether RAG is enabled for this assistant
Whether to bypass the system context prompt
Optional model override for this assistant (max 200 chars)