Generating long-lived API token for CI/CD pipeline fails

Hitting 403 when trying to generate a long-lived token for our build pipeline. The standard auth flow works fine in Postman, but the script keeps getting rejected.

Using the /api/v2/oauth/token endpoint with client credentials grant.

POST /api/v2/oauth/token
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&client_id=<id>&client_secret=<secret>

Response is always "error": "invalid_grant". Have I missed a scope requirement or is this endpoint disabled for our org?