Skip to main content
Contributor I
June 19, 2024
Solved

No Parameters to Update Error Code 400

  • June 19, 2024
  • 5 replies
  • 258 views

Hey, I am using a function in AWS Lambda to update a custom property for profiles in Klaviyo. I keep getting an Error Code 400, saying there are no parameters to update. I can’t find any info on what I might be doing wrong. The custom property is a list, and the payload I send is a list. I am able to provide more information if needed, but this is the exact error message on the log.

 

I have a custom property list called Fruits which is sent over to the code in order for it to fill out the pesticides list. I already created a Custom property list called Pesticides. I was wondering maybe my payload is in the incorrect format, but I doubt it. The code is able to retrieve all the information perfectly, it is just when it is sending info back, Klaviyo says there are no parameters to update.

 

 

 

[INFO] 2024-06-19T07:17:08.938Z 65f67682-ced5-4678-947c-1a30a1ff9f20 Payload to be sent: {"properties": {"Pesticides": ["Acephate", "Tetraconazole", "Endrin", "Pyrimethanil", "Penthiopyrad", "Thiabendazole", "Cyantraniliprole", "Pentachloroaniline (PCA)", "Acetamiprid", "Methamidophos"]}}
  2024-06-19T07:17:09.117Z[INFO] 2024-06-19T07:17:09.117Z 65f67682-ced5-4678-947c-1a30a1ff9f20 Response from Klaviyo:

{ "status": 400, "message": "* __all__\n * No parameters to update." }

 

 

    This topic has been closed for replies.
    Best answer by KeviSunshine

    Hi @hkhan317,

    I think your request body is not including all of the required fields. I am doing it through postman/JSON and it’s working with this request body. I am using the PATCH endpoint.

     

    // Endpoint: PATCH https://a.klaviyo.com/api/profiles/{profileId}

    {
    "data": {
    "type": "profile",
    "id": "{profileId}",
    "attributes": {
    "properties": {
    "list": [1, 2, 3] // your list here...
    }
    }
    }
    }

     

    Cheers,

    Kevin.

    5 replies

    KeviSunshine
    Expert Problem Solver III
    Expert Problem Solver III
    June 19, 2024

    Hi @hkhan317,

     

    Which endpoint are you using to update the profile properties? Can you share your full request body (please redact any personal information)?

     

    Let us know.

     

    Best,

    Kevin.

    hkhan317Author
    Contributor I
    June 19, 2024

    I’m testing two endpoints using the curl command. For my original error, this was the endpoint 

    curl -X PUT "https://a.klaviyo.com/api/v1/person/01J0QR5B2WG3Z25Y060J7VDDV7?api_key=pk_64e8cca14a9509af40d2e8458d9c1f6a0f" \
    -H "Content-Type: application/json" \
    -d '{"properties": {"Pesticides": ["Acephate", "Tetraconazole", "Endrin", "Pyrimethanil", "Penthiopyrad", "Thiabendazole", "Cyantraniliprole", "Pentachloroaniline (PCA)", "Acetamiprid", "Methamidophos"]}}'

    I read the API doc’s and tried another

     

    curl --request PATCH \
    --url https://a.klaviyo.com/api/profiles/{profile_id}/ \
    --header 'Authorization: Klaviyo-API-Key your-api-key' \
    --header 'accept: application/json' \
    --header 'content-type: application/json' \
    --header 'revision: 2024-06-15' \
    --data '{"properties":{"Pesticides":["Acephate"]}}'

    With this method I get this error. 

    {"errors":[{"id":"b7c5d32b-8a1e-4ea4-aae0-c9c9db9dc4c5","status":400,"code":"invalid","title":"Invalid input.","detail":"The payload provided in the request is invalid.","source":{"pointer":"/data"},"links":{},"meta":{}}]}%

     

    the custom property Pesticides exist and is a list, I am able to edit the values through Klaviyo. The json when I actually go to the URL shows Pesticides[] in the properties, is it because my data payload is only for one property instead of the whole profille.

    KeviSunshine
    Expert Problem Solver III
    Expert Problem Solver III
    June 20, 2024

    Hi @hkhan317,

    I think your request body is not including all of the required fields. I am doing it through postman/JSON and it’s working with this request body. I am using the PATCH endpoint.

     

    // Endpoint: PATCH https://a.klaviyo.com/api/profiles/{profileId}

    {
    "data": {
    "type": "profile",
    "id": "{profileId}",
    "attributes": {
    "properties": {
    "list": [1, 2, 3] // your list here...
    }
    }
    }
    }

     

    Cheers,

    Kevin.

    Partner
    June 21, 2024

    Hello @hkhan317  I have already posted the solution to this on a different thread you created earlier.
     

     

    https://theforms.pro
    brittany.klaviyo.dev
    Klaviyo Alum
    June 21, 2024

    Confirming @KeviSunshine’s response is correct - the payload is missing required fields and @Maxbuzz’s response linked is also valid. Let us know if you need any further assistance!