Show examples in:
    Delete a collaborator

    Query parameters

    destination_user_type  Optional  enum  Example: "user"

    New owner for resources previously owned by the deleted user. This argument specifies the new owner type.

    destination_user_id  Optional  string  Example: "7865"

    New owner for resources previously owned by the deleted user. This argument specifies the new owner ID.

    Returns

    Returns a user resource object.

    Examples

    Example code:
    import { buildClient } from '@datocms/cma-client-node';
    async function run() {
    const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });
    const userId = '312';
    const user = await client.users.destroy(userId, {
    destination_user_type: 'user',
    destination_user_id: '7865'
    });
    console.log(user);
    }
    run();
    Returned output:
    {
    id: '312',
    email: 'mark.smith@example.com',
    is_2fa_active: true,
    full_name: 'Mark Smith',
    is_active: true,
    meta: {
    last_access: '2018-03-25T21:50:24.914Z'
    },
    role: {
    type: 'role',
    id: '34'
    }
    }