# Init mode of the JSON API

**URL:** <https://forum.canton.network/t/init-mode-of-the-json-api/2355>\
**Category:** App Development\
**Tags:** json-api\
**Created:** [March 30, 2021, 2:32pm UTC](https://forum.canton.network/t/init-mode-of-the-json-api/2355 "2021-03-30T14:32:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darko](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/darko/32/42_2.png) [@Darko](https://forum.canton.network/u/Darko)\
**Post date:** [March 30, 2021, 2:32pm UTC](https://forum.canton.network/t/init-mode-of-the-json-api/2355/1 "2021-03-30T14:32:36Z")

</div>

Is my understanding right that there is no “init mode” for the JSON API.

What I mean by init mode is a way to start the JSON API in such a way that it will create the right schema on the DB and shuts down after.

I’m aware of the `createSchema=true` parameter as explained [here](https://docs.daml.com/json-api/index.html#with-query-store), but my interpretation of the docs is that the service continues running after the initialization.

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [March 30, 2021, 2:44pm UTC](https://forum.canton.network/t/init-mode-of-the-json-api/2355/2 "2021-03-30T14:44:14Z")

</div>

The JSON API (and the same applies to the Trigger Service) will exit immediately if you use `createSchema=true`. So this should already do what you are asking for:

```haskell
moritz@adjunction ~ [1]> daml json-api --query-store-jdbc-config "driver=org.postgresql.Driver,url=jdbc:postgresql://localhost:5432/db,user=u,password=p,createSchema=true" --ledger-host localhost --ledger-port 6865 --http-port 7500
16:08:14.492 [main] INFO com.daml.http.Main$ - Config(ledgerHost=localhost, ledgerPort=6865, address=127.0.0.1, httpPort=7500, portFile=None, packageReloadInterval=5 seconds, packageMaxInboundMessageSize=None, maxInboundMessageSize=4194304, tlsConfig=TlsConfiguration(false,None,None,None,REQUIRE,false,List()), jdbcConfig=Some(JdbcConfig(driver=org.postgresql.Driver, url=jdbc:postgresql://localhost:5432/db, user=u, createSchema=true)), staticContentConfig=None, allowNonHttps=false, accessTokenFile=None, wsConfig=None)
16:08:14.831 [http-json-ledger-api-akka.actor.default-dispatcher-5] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
16:08:14.960 [main] INFO com.daml.http.Main$ - Creating DB schema...
16:08:15.188 [main] INFO com.daml.http.Main$ - DB schema created. Terminating process...
moritz@adjunction ~> 

```
