# Models

Source: https://zotonic.com/cotonic/models

URI: https://zotonic.com/id/2733

Language: en



<a name="models"></a>
Because workers run as independent components it is not possible to directly call api's. Some api's are also not available to web workers. Models are special modules, or workers, which publish their data, or are ready to receive calls via mqtt topics.

The convention is that models provide their services via the following topic tree.

<dl>
                <dt><tt>model/+modelName/get/+</tt></dt>
                <dd>Call topics. When the model receives a publish, it returns the answer
                to the reply topic.</dd>

                <dt><tt>model/+modelName/post/+</tt></dt>
                <dd>Topics used to post updates to the model.</dd>

                <dt><tt>model/+modelName/delete/+</tt></dt>
                <dd>Topics used to delete items managed by the model.</dd>

                <dt><tt>model/+modelName/event/+</tt></dt>
                <dd>Topics which the model publishes events on.</dd>
            </dl>
<!-- model window -->
- [model/window](/id/doc_cotonic_model_window)
- [model/document](/id/doc_cotonic_model_document)
- [model/location](/id/doc_cotonic_model_location)
- [model/ui](/id/doc_cotonic_model_ui)
- [model/lifecycle](/id/doc_cotonic_model_lifecycle)
- [model/autofocus](/id/doc_cotonic_model_autofocus)
- [model/serviceWorker](/id/doc_cotonic_model_serviceworker)
- [model/localStorage](/id/doc_cotonic_model_localstorage)
- [model/sessionStorage](/id/doc_cotonic_model_sessionstorage)
- [model/sessionId](/id/doc_cotonic_model_sessionid)
- [model/dedup](/id/doc_cotonic_model_dedup)

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/2733?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/2733?language=en>)
