Greetings,
I'm working on automating user cleanup and am attempting to delete inactive VPN users via the Cato API. According to the API conventions, I assumed the following mutation would work to remove users from our account: Sorry for the poor formatting.
mutation deleteEntities($accountID: ID!, $entityIDs: [ID!]!)
{ deleteEntities(accountID: $accountID, entityIDs: $entityIDs) {
success
failed {
userID
reason }
} }
I'm calling it in Python with:
delete_variables = { "accountID": account_id, "entityIDs": [uid] }
delete_response = requests.post(API_URL, headers=HEADERS,
json={ "query": delete_mutation, "variables": delete_variables })
However, I receive the following error in the response:
{ "errors": [ { "message": "Cannot query field 'deleteEntities' on type 'Mutation'.", "extensions": { "code": "GRAPHQL_VALIDATION_FAILED" } } ], "data": null }
What I am trying to figure out is:
- Is deleteEntities a valid mutation for deleting VPN users?
- If not, what is the correct GraphQL mutation for deleting users?
Thank you guys!