Thread
#prefect-community
    Joshua Greenhalgh

    Joshua Greenhalgh

    2 months ago
    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?
    Kevin Kho

    Kevin Kho

    2 months ago
    maybe you can try using the deleteAPIToken mutation?
    Joshua Greenhalgh

    Joshua Greenhalgh

    2 months ago
    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?
    Kevin Kho

    Kevin Kho

    2 months ago
    it is for sure. Will ask the team but there is an onsite so responses may be slow
    Joshua Greenhalgh

    Joshua Greenhalgh

    2 months ago
    No Worries
    Anna Geller

    Anna Geller

    2 months ago
    Can you send a screenshot of the error when you try to delete the token from the UI?
    Joshua Greenhalgh

    Joshua Greenhalgh

    2 months ago
    Its just not there
    2 secs
    Kevin Kho

    Kevin Kho

    2 months ago
    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
      }
    }
    Joshua Greenhalgh

    Joshua Greenhalgh

    2 months ago
    {
      "data": {
        "api_token": []
      }
    }
    Its empty
    Screenshot
    Kevin Kho

    Kevin Kho

    2 months ago
    A bit confused. Looks like you dont have any tokens?
    But you have an existing one?
    Anna Geller

    Anna Geller

    2 months ago
    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
    Joshua Greenhalgh

    Joshua Greenhalgh

    2 months ago
    But I am using it to query the api?
    Kevin Kho

    Kevin Kho

    2 months ago
    Maybe you are talking about keys scoped to a user?
    Do you see it in Account Settings -> Account Keys
    Joshua Greenhalgh

    Joshua Greenhalgh

    2 months ago
    Yep thats it!! What's the difference?
    Anna Geller

    Anna Geller

    2 months ago
    API tokens have been deprecated for quite a long time and API keys are the current way of authenticating with Cloud 1.0