Why does creating a Schematics workspace fail with the API?

Troubleshoot a Bad request error when you create a IBM Cloud Schematics workspace with the API, UI, or CLI because the request payload is incomplete.

The Schematics create workspace fails when you attempt to create using the API by using following CURL command.

curl --request POST --url https://cloud.ibm.com/schematics/workspaces -H "Authorization: Bearer scfQ" -d '{"name":"test_api","type": ["terraform_v1.4"],"location": "eu-de","description": "via api","resource_group": "5e1f06f5b2b24a319f6cd5be86f531dd","tags": [],"template_repo": {"url": "https://xxxxxxxxx/Rise-with-SAP/iac-hec-sap"},"template_data": [{"folder": ".","type": "terraform_v1.4","variablestore": []}]}'

When Schematics runs the CURL command, an error state Schematics cannot find the complete information in the payload. And the workspace create is marked with Bad request message.

{
"requestid": "3b57ed5d-8610-4a86-9864-8d8197b80336",
"timestamp": "2021-09-22T14:49:04.565693526Z",
"messageid": "M1008",
"message": "Bad request. Check that the information you entered in the payload is complete and formatted correctly in JSON.",
"statuscode": 400
}

Verify your CURL or the payload contains that the location and the url are pointing to the same region where you want to create or update the workspace.

For Example

  • For creating workspace in US region: Use location as us-east or us-south and url as https://us-south.schematics.cloud.ibm.com/ or https://us-east.schematics.cloud.ibm.com/. By default https://cloud.ibm.com/schematics/workspaces points to https://cloud.ibm.com/schematics/overview endpoint.
  • For workspace in the EU region: Use location as eu-de or eu-gb and url as https://eu-de.schematics.cloud.ibm.com and https://eu-gb.schematics.cloud.ibm.com endpoint.