https://prefect.io logo
Title
j

Joshua Greenhalgh

07/12/2022, 2:07 PM
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

Kevin Kho

07/12/2022, 2:15 PM
maybe you can try using the deleteAPIToken mutation?
j

Joshua Greenhalgh

07/12/2022, 2:25 PM
query Query {
  api_token {
    id
  }
}
Says I have none...
but I used one to query
response is;
{
  "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

Kevin Kho

07/12/2022, 2:32 PM
it is for sure. Will ask the team but there is an onsite so responses may be slow
j

Joshua Greenhalgh

07/12/2022, 2:41 PM
No Worries
a

Anna Geller

07/12/2022, 3:41 PM
Can you send a screenshot of the error when you try to delete the token from the UI?
j

Joshua Greenhalgh

07/12/2022, 4:06 PM
Its just not there
2 secs
k

Kevin Kho

07/12/2022, 4:13 PM
Can you try:
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

Joshua Greenhalgh

07/12/2022, 4:18 PM
{
  "data": {
    "api_token": []
  }
}
Its empty
Screenshot
k

Kevin Kho

07/12/2022, 4:20 PM
A bit confused. Looks like you dont have any tokens?
But you have an existing one?
a

Anna Geller

07/12/2022, 4:24 PM
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

Joshua Greenhalgh

07/12/2022, 4:40 PM
But I am using it to query the api?
k

Kevin Kho

07/12/2022, 4:53 PM
Maybe you are talking about keys scoped to a user?
Do you see it in Account Settings -> Account Keys
j

Joshua Greenhalgh

07/13/2022, 9:04 AM
Yep thats it!! What's the difference?
a

Anna Geller

07/13/2022, 10:04 AM
API tokens have been deprecated for quite a long time and API keys are the current way of authenticating with Cloud 1.0