1. Home
  2. Docs
  3. GraphQL API
  4. Accounts

Accounts

Delete an employee

  • it will remove a given employee from your organization
  • this employee will not be able to connect to Instaply anymore

Example

curl -XPOST 'https://me.instaply.com/graphql' \
-H 'Authentication-Token:${PERSONAL_ACCESS_TOKEN}' \
-H 'Content-Type: application/json' -d'
{
    "query": "mutation DeleteEmployeeByEmail($email: String!) {
        deleteEmployee(email: $email) {id}
    }", 
    "variables": {
        "email":"emmployee.todelete@organization.com"
    }
}
'

Errors

  • you try to delete a missing employee
      {
          "errors":[{
              "path":["deleteEmployee"],
              "message":"The requested resource could not be found.",
              "code":40400
          }]
      }
    
  • you cannot delete your own account
      {
          "errors":[{
              "path":["deleteEmployee"],
              "message":"You cannot delete your own account.",
              "code":40300
          }]
      }
    
  • you need an administrator account
      {
          "errors":[{
              "path":["deleteEmployee"],
              "message":"You need to be an organization administrator.",
              "code":40300
          }]
      }