Show examples in:
Duplicate a field

Returns

Returns a field resource object.

Examples

Example Basic example
import { buildClient } from '@datocms/cma-client-node';
async function run() {
const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });
const fieldIdOrApiKey = 'blog_post::title';
const field = await client.fields.duplicate(fieldIdOrApiKey);
console.log(field);
}
run();