Skip to content

Invalid authorization header #513

Description

@lgwapnitsky

I've just configured this with a brand new bearer key and token, but am receiving the following error:

ERROR: NetBox returned: Forbidden: Invalid authorization header: Must be in the form "Bearer <key>.<token>" or "Token <token>"
I've recreated the key multiple times with the proper rights, but no luck.

; Requires an NetBox API token with full permissions on all objects except 'auth',
; 'secrets' and 'users'
api_token = Bearer nbt_LONGSTRING.LONGERSTRING

; Requires a hostname or IP which points to your NetBox instance
host_fqdn = umnetbox

FYI curl with the same code works:

curl -X GET -H "Authorization: Bearer nbt_LONGSTRING.LONGERSTRING" -H "Content-Type:
application/json" -H "Accept: application/json; indent=4" http://umnetbox/api/status/
{
    "django-version": "6.0.6",
    "hostname": "227d5d53f045",
    "installed_apps": {
        "django_filters": "25.2",
        "django_prometheus": "2.4.0",
        "django_rq": "4.1.0",
        "django_tables2": "2.8.0",
        "drf_spectacular": "0.29.0",
        "drf_spectacular_sidecar": "2026.6.1",
        "mptt": "0.18.0",
        "rest_framework": "3.17.1",
        "social_django": "5.9.0",
        "taggit": "6.1.0",
        "timezone_field": "7.2.2"
    },
    "netbox-version": "4.6.4",
    "netbox-full-version": "4.6.4-Docker-5.0.1",
    "plugins": {},
    "python-version": "3.14.4",
    "rq-workers-running": 1
}

NetBox Community v4.6.4-Docker-5.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions