Create Sync API not working?

Hey there!

I saw recently that the API for “Create Sync” was recently added. I’ve been waiting for this functionality as we rapidly create and delete environments weekly and being able to automate turning on the sync would eliminate the last manual step we have in the process. However, when I try use the documentation page to test out this feature with valid data, I get a return object like below. I’ve also tried in Postman with no luck. Any help is appreciated!

{
  "messages": [
    "Data must be an object"
  ],
  "validationIssues": [
    {
      "code": "invalid_type",
      "expected": "object",
      "received": "undefined",
      "path": [
        "body",
        "data"
      ],
      "message": "Data must be an object"
    }
  ],
  "success": false
}

Hi @djandreau!

Welcome to the Doppler Community!

Would you mind sharing the actual request you’re sending (feel free to redact any actual IDs or sensitive information)? Without that it’ll be hard to help diagnose what’s going wrong here for you!

Regards,
-Joel

Sure! Here’s a screencap of the fields I inputted as well as what the example is showing for a request

Screenshot 2023-04-10 at 9.34.29 AM

curl --request POST \
     --url 'https://api.doppler.com/v3/configs/config/syncs?project=sm-portal&config=local' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer [REDACTED]' \
     --header 'content-type: application/json' \
     --data '
{
  "integration": "[REDACTED]"
}
'

Hey @watsonian! Any ideas on the above? Thanks!

Hi @djandreau!

Sorry, I totally missed your earlier reply. I think I see what the issue is. You’re not including the required data entry in the payload. Your payload is:

{
  "integration": "[integration-slug]"
}

when it should be:

{
  "integration": "[integration-slug]",
  "data": {
    "path": "[asm-or-parameter-path]",
    "region": "[aws-region]"
  }
}

Could you give that a shot and let me know how it goes?

Regards,
-Joel

Sure! I’ll try that through Postman! Just a heads up that the docs on the website don’t allow you to edit the data block at all or include that those pieces are needed.