Firewall rule edit by CURL - API

I want to edit firewall rule from CURL, but I get authentification error:

curl -X POST "" \
     -H "X-Auth-Email: [email protected]" \
     -H "X-Auth-Key: xxx" \
     -H "Content-Type: application/json" \
     --data '{"mode":"challenge","configuration":{"target":"ip","value":""},"notes":"test"}'

{"success":false,"errors":[{"code":10000,"message":"Authentication error"}]}

What is incorrect in this code?

PS. I’ve using Global API key.

Or second method:

curl -X PUT \
     -H "X-Auth-Email: xxx" \
     -H "X-Auth-Key: xxx" \
     -H "Content-Type: application/json" \
     -d '[
    "id": "xxx",
    "paused": false,
    "description": "challenge site",
    "action": "challenge",
    "priority": null,
    "filter": {
      "id": "xxx",
      "expression": "not http.request.uri.path matches \"^/api/.*$\"",
      "paused": false,
      "description": "not /api"
]' ""

There is same error.

Are you still encountering this issue?

I can’t resolve this issue.

Looking at your first ‘curl’. Are you sure you shouldn’t be using PATCH?

I don’t think that would cause an authentication error.

Do any other API calls work for you?

I have not try another API calls. I need only this one. I’ve using Global API Key, so I can’t understand why it doesn’t works.

I’ve resolve problem, it’s my mistake, I’ve enter domain ID and now I’ve replace it with Zone ID.


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.