Hi @jeff.f.chen,
Is it possible you’re using the old, now-deprecated datocms-client
instead of @datocms/cma-client-node
? This is a known problem with that client. From a similar thread: `INVALID_FORMAT` / 'id is not a permitted key' error on `item.publish()` with `datocms-client` (edited title) - #2 by roger
The workaround is to add serializeRequest: false
as the third parameter, like this:
async function publishRecord() {
const res = await client.item.publish('UR_-UEwVSMeHP3e_LbqadA',
// body
{
content_in_locales: [''],
non_localized_content: true,
},
// empty query string
{},
// the workaround goes here
{ serializeRequest: false }
)
}
(Or, if time allows, upgrading to the new client as soon as possible: https://www.npmjs.com/package/@datocms/cma-client-node)