N8n HTTP Request OAuth2 (INSEE API) – 404 deprecated token endpoint

Hi,
I’m trying to get an OAuth2 token from INSEE API in n8n (HTTP Request node).
Config:

  • POST https://api.insee.fr/token
  • Header: Authorization Basic (base64 client_id:client_secret)
  • Body: grant_type=client_credentials
    I always get:
    404 - “url deprecated, visit https://portail-api.insee.fr/
    I already subscribed to the API (status accepted).
    :backhand_index_pointing_right: What is the correct token URL now?
    Using n8n HTTP Request node (not OAuth2 credential node)
    Thanks!

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

welcome to the n8n community @Hugo.grazou

The token URL should still be https://api.insee.fr/token, so I would not switch to portail-api.insee.fr for the token request. The portal is the developer/subscription site, while INSEE examples and tooling still use the token endpoint on api.insee.fr.

I’d fix the request format first. In n8n, send a POST to https://api.insee.fr/token with Authorization: Basic <base64(client_id:client_secret)> and the body as application/x-www-form-urlencoded with grant_type=client_credentials. If you send JSON instead of form data, the request can fail even though the URL itself is correct.

Hello Tamy, thank you very much for your aswer ! All good

Happy to help :slightly_smiling_face:
If this solution solved the issue for you, please consider leaving a like or marking the reply as the solution ( it helps others find the answer more easily and also supports community contributors.)