Hey - I am wanting to terminate the usage of an AP...
# ask-community
j
Hey - I am wanting to terminate the usage of an API token - but the page says these are depreciated and to use service accounts - this is fine however I cannot see a way of revoking an existing one?
1
k
maybe you can try using the deleteAPIToken mutation?
j
Copy code
query Query {
  api_token {
    id
  }
}
Says I have none...
but I used one to query
response is;
Copy code
{
  "data": {
    "api_token": []
  }
}
This is quite a big problem no? If I can't find the ID of the key I want to delete, and the key is still active then it will forever remain active?
k
it is for sure. Will ask the team but there is an onsite so responses may be slow
j
No Worries
a
Can you send a screenshot of the error when you try to delete the token from the UI?
j
Its just not there
2 secs
k
Can you try:
Copy code
query APITokens {
  api_token {
    id
    name
    created
    expires_at
    last_used
  }
}

and delete any of them with:

mutation DeleteAPIToken($id: UUID!) {
  delete_api_token(input: { token_id: $id }) {
    success
  }
}
j
Copy code
{
  "data": {
    "api_token": []
  }
}
Its empty
Screenshot
k
A bit confused. Looks like you dont have any tokens?
But you have an existing one?
a
if you don't see any tokens here https://cloud.prefect.io/team/tokens., then you don't have any. It looks like the token you worry about has already been deleted
j
But I am using it to query the api?
k
Maybe you are talking about keys scoped to a user?
Do you see it in Account Settings -> Account Keys
j
Yep thats it!! What's the difference?
a
API tokens have been deprecated for quite a long time and API keys are the current way of authenticating with Cloud 1.0