POST /oauth/token returns 401 when trying to generate long-lived token for CI/CD

Trying to set up a long-lived token for our Jenkins pipeline using the client credentials flow. Getting a 401 Unauthorized immediately.

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

grant_type=client_credentials&client_id=abc-123&client_secret=xyz-789

Docs say this works for machine-to-machine auth, but the token expires in 3600s. Can’t find an endpoint to extend the TTL or generate a static token via API. Is this even possible without manual intervention?