list_agents() — discover all AI agents configured on the server.
get_agent() — retrieve a single agent’s configuration.
create_agent() — create an AI agent with full v2.0 schema support: model, reasoning controls, tool policy, vision, and structured output.
update_agent() — partially update an agent’s configuration.
delete_agent() — remove an agent (bot account is unaffected).
invoke_agent() — send a prompt to an AI agent and receive a synchronous LLM completion. Supports system prompts, multi-turn context, extended timeouts for reasoning models, and forward-compatible ... for experimental fields.
get_agents_plugin_id() — resolve the plugin ID (configurable via options(MattermostR.agents_plugin_id)).
Improvements
mattermost_api_request() gains an optional timeout parameter for long-running requests (e.g. LLM completions that routinely take 30–120+ seconds).
Message priority: priority is now passed under metadata$priority (the correct API location). Valid values are "Normal" (default), "Important", and "Urgent". The old undocumented "High" / "Low" values have been removed.
send_mattermost_file() now delegates to mattermost_api_request() with multipart = TRUE, gaining retry/backoff, error handling, and verbose support.
Rate limiting: proactive throttling at 10 req/s via req_throttle(). Reactive 429 handling reads X-Ratelimit-Reset for precise wait timing. Override with options(MattermostR.rate_limit = Inf).
Structured error conditions: HTTP errors now raise a mattermost_error S3 condition. Set options(MattermostR.on_error = "message") for legacy NULL-return behaviour.
get_default_auth() and authenticate_mattermost() now resolve credentials from environment variables (MATTERMOST_TOKEN, MATTERMOST_URL) before R options, in both functions.
paginate_api() internal helper auto-paginates any GET endpoint that supports page/per_page. Used by get_all_teams(), get_team_channels(), and post-retrieval.