Show examples in:
Invite a new user

Body Parameters

email  Required  string  Example: "mark.smith@example.com"

Email

role  Required  { type: "role", id: role.id }

Role

Returns

Returns a site_invitation resource object.

Examples

Example Basic example
import { buildClient } from '@datocms/cma-client-node';
async function run() {
const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });
const siteInvitation = await client.siteInvitations.create({
email: 'mark.smith@example.com',
role: {
type: 'role',
id: '34'
}
});
console.log(siteInvitation);
}
run();