Error on POST /source_control/config

I am trying to configure source control using the API. When I call POST /source_control/config I get a 400 response with the error

Invalid input type for body parameter: config.config

Here is my request body:

{
    "config": {
        "type": "App",
        "app_id": "{myAppId}",
        "installation_id": "{myInstallationId}",
        "private_key": "{myKey}"
    },
    "provider": "GitHub",
    "org": "{MyOrg}",
    "repo": "{My.Repository}",
    "default_branch": "main",
    "repo_version": "2.0.0"
}

These parameters will work if I use them in the UI.

Any idea what is wrong with the request body? Is there any way to see more information about what part of config validation failed?

1 Like

Hi @James_Faix, it looks like it may be trying to access config.config and is not evaluating to the correct type. Try nesting the config key under another config key:

The body should have a top level key config:

Inside of it there should be another key config, along with provider, org, repo, etc.

Thanks @Paulo , that was it.

You are welcome! :slightly_smiling_face: