Adding JSON api to existing Phoenix application

Yes - Use the --no-context and --no-schema flags. Like this:

mix phx.gen.json Accounts User users --no-context --no-schema

This will look in lib/proj/accounts/user.ex and generate a JSON api route for the schema defined at that file. It will not try to recreate a context module nor a new schema

The order of arguments to the command is:

mix phx.gen.json Context Schema db_table

Context is the phoenix context, Schema is your Elixir schema, and db_table is the table in your database that Schema is linked to

In some cases, you may wish to bootstrap JSON views, controllers, and controller tests, but leave internal implementation of the context or schema to yourself. You can use the --no-context and --no-schema flags for file generation control.