Show examples in:
    Invite a new user

    Parameters

    email  string  Required

    Email

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

    Role

    Returns

    Returns a site_invitation resource object.

    Examples

    Example code:
    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();
    Returned output:
    {
    id: '312',
    email: 'mark.smith@example.com',
    role: {
    type: 'role',
    id: '34'
    }
    }