Skip to content

[ QUESTION ] 401: access denied, invalid bearer token #481

Closed

Description

@NCothran

I am attempting to export a list of all Uninstallation tokens with the command:

Get-FalconHost -All | Get-FalconUninstallToken -Include hostname | Export-Csv .\token_list.csv -NoTypeInformation

No matter what I do it gives this:

Write-Result : {"code":401,"message":"access denied, invalid bearer token"}
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSFalcon\private\Private.ps1:687 char:9
+         Write-Result $Object
+         ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidResult: (@{errors=System.Object[]}:PSObject) [Write-Result], Exception
    + FullyQualifiedErrorId : Write-Result

My API has all the required Read and Write permissions, can you tell me why this happens and how to fix it?

Activity

  1. self-assigned this
    on Aug 26, 2025
  2. bk-cs commented on Aug 26, 2025

    @bk-cs
    Contributor

    Did you Request-FalconToken? You may need to specify your cloud.

    It looks like you installed the module as an admin. I don't recommend that. You can follow these steps to re-install:

    • First, run the uninstall command as an administrator
    Uninstall-Module -Name PSFalcon -AllVersions
    • Then re-install as your regular user account
    Install-Module -Name PSFalcon -Scope CurrentUser

    Please let me know if you still receive the same error after verifying your token and re-installing without administrative permissions,

  3. changed the title [-][ QUESTION ] {"code":401,"message":"access denied, invalid bearer token"} no matter what I do[/-] [+][ QUESTION ] `401: access denied, invalid bearer token`[/+] on Aug 26, 2025
  4. locked and limited conversation to collaborators on Aug 29, 2025
  5. converted this issue into a discussion #482 on Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions