N8n api playground 404 error

I am running n8n local instance via npm run dev. The UI is accessible via:http://localhost:8080/

However API playground URI: http://localhost:8080/api/v1/docs/ is returning: Oops, couldn’t find that 404 Error.

It happened a few times yesterday but auto resolved. Today back to not found.

Any pre-requisites I might have missed?

Sorry the port is 5678 since that is default for N8N_PORT. Works now :smiley:

1 Like

I am running n8n local instance via npm run dev. The UI is accessible via:http://localhost:8443/

However API playground URI: http://localhost:8443/api/v1/docs/ is returning: Oops, couldn’t find that 404 Error.

Is this fixed, or still an issue ??

Also, Hitting http://localhost:5678/api/v1/docs, says the site is not reachable.

am I missing something, I want to use REST APIs in my project.

Hi @Swapnil_Marathe, tbh I am not quite sure what the expected behaviour for the Swagger UI would be if running n8n via npm run dev.

Is the actual API working for you? If so, you could simply check the reference at API reference - n8n Documentation to get an idea of the available endpoints.

Or alternatively fire up a temporary n8n instance via docker run --rm -p 5678:5678 n8nio/n8n:0.186.0 to quickly take a look at Swagger locally under http://localhost:5678/api/v1/docs/.

API is exposed via port set by env N8N_PORT. Default is 5678. Better set it in case your setup is changing default without your knowledge…?

Hello @MutedJam,
Actual APIs, when i try to fire in postman I’m not getting a response,
I tried “https://docs.n8n.io/api/v1/executions” with my API-KEY.
Here is the postman Image.

Please help me, if im missing something @MutedJam @Gowthaman_Prabhu

So it sounds like npm run dev does not fire up the /api part then. Just to make sure, do you have the latest code from GitHub - n8n-io/n8n: Free and open fair-code licensed node based Workflow Automation Tool. Easily automate tasks across different services.?

I have just tested this and it appears to be working correctly, The one thing I have noticed is you are using a differnet port, If you change that back to 5678 does it change anything?

Do you have anything else running like some kind of local proxy for testing?

@MutedJam Cloning latest code, worked!!

One question, Im already running n8n on specific domain ( xyz.com ), i have did some custom label and other changes as per my needs.

How can I get this latest code there now, do i need to clone again on server and do neccessary changes of mine again ?

Yes if you made your own changes you would need to apply them again unless you can merge your changes in.

1 Like

Thanks @Jon , Can we change 5678 and use our custom port like 8443 or something else for REST APIs ?

I don’t see why not, I use 443 for my self hosted install. Not tried with npm run dev on a different port though.