This might add some processing delay, but you can try using the RecordGetter
. See this: Smart field reference link
The process can be similar to:
- call
await network.createCategory(categoryTocreate);
- call
const record = await recordGetter.get(res.id)
(orres
depending on how the id is returned by your API) - finish by
response.send(recordGetter.serialize(record))
This is just guess-coding, but the idea is: create via you API, and then get it via Forest API and return it.