@marceldw
You can create credentials via the n8n REST API using POST /api/v1/credentials, but these will always end up in your personal space.
There’s currently no API support for specifying a project context, using project-related URLs or headers has no effect.
To get credentials into a project, you must either move them manually in the UI.
Use the API to create the credential (it ends up in your personal space). Then, in the web UI, manually move or copy it into the desired project.
See also this thread: Creating Credentials using API