Help Needed: Error 400 (Bad Request) When Creating Workflows via API

Hi n8n community,

I’m encountering an issue while trying to create a workflow using the n8n API. I’m getting the following error response:
TTP Error: 400 Client Error: Bad Request for url: https://scanorgg1921.app.n8n.cloud/api/v1/workflows
Error 400: Please verify the provided workflow data.

What I’ve Tried:

  1. I’m sending a JSON payload to the /api/v1/workflows endpoint that looks like this:

Name: “Enviar correo con Gmail”
Nodes: Includes a “Manual Trigger” and “Gmail Send Email” node with proper configurations, including parameters like email subject, body, and recipient.
Connections: Defines connections between “Manual Trigger” and “Gmail Send Email.”
Settings: Left mostly empty as this is a simple workflow.

  1. I’m authenticating with the X-N8N-API-KEY header, and I’ve confirmed that the API key is valid since it works for other requests like fetching existing workflows.
  2. I’ve verified that the API endpoint URL is correct: https://scanorgg192.app.n8n.cloud/api/v1/workflows.
  3. I ensured the API key is clean, with no extra spaces or line breaks, and included in the headers.

Questions:

  1. Are there any additional fields or settings that are required in the JSON to successfully create workflows?
  2. Does the JSON I’m sending have any issues in terms of structure or missing mandatory fields?
  3. What are the common scenarios where a 400 error might occur when creating workflows?

Any insights, ideas, or suggestions on how to debug and resolve this issue would be greatly appreciated!

Thanks in advance for your help

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Hey @ERICK_ARRIOLA_AGUILL

Can you share the actual json you are sending? I suspect you are missing some of the required fields which can be found in the api docs.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.