Choose your language:
    Delete a collaborator
    Query parameters
    destinationUserType  enum  Optional

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

    destinationUserId  string  Optional

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

    Returns
    Returns a user object.

    Examples

    Example code:
    const SiteClient = require('datocms-client').SiteClient;
    const client = new SiteClient('YOUR-API-TOKEN');
    const userId = '312';
    client.user.destroy(userId, {
    destination_user_type: 'user',
    destination_user_id: '7865'
    })
    .then((user) => {
    console.log(user);
    })
    .catch((error) => {
    console.error(error);
    });
    Returned output:
    > node example.js
    {
    "id": "312",
    "email": "mark.smith@example.com",
    "is2faActive": true,
    "fullName": "Mark Smith",
    "isActive": true,
    "meta": {
    "last_access": "2018-03-25T21:50:24.914Z"
    },
    "role": "34"
    }