Cannot create service with API

Hello! I’m trying to create a service via HTTP API:

{
    "type":"web_service",
    "name":"strategy-e2e-flow-manager",
    "ownerId":"<ownerId>",
    "repo":"https://github.com/<org>/<name>",
    "autoDeploy":"yes",
    "serviceDetails":{
        "pullRequestPreviewsEnabled":"no",
        "disk":{"sizeGB":1},
        "envSpecificDetails":{"buildCommand":"npm i","startCommand":"npm run start:dev"},
        "numInstances":1,
        "plan":"starter_plus",
        "region":"frankfurt",
        "env":"node"
    },
}

But it keeps replying with 500: Internal Server Error.

I also tried to create the same service in the dashboard and it worked. But I need to use API for my project.

Help me, please.

Hi there,

Thanks for reaching out.

I think the issue may be the disk attributes. The API docs show name & mountPath are required for disk, but they aren’t present in your JSON above.

Hope that helps

Alan