Patch accessprofile

Hi All,

Facing error in updating accessprofile with entitlements and governance group using PATCH API
v2024/access-profiles/{id
I am using python script for this.

Can someone help with their insights?

Error: Access profile update failed. Status code: 415 {“timestamp”:“2025-06-18T13:22:13.596+00:00”,“status”:415,“error”:“Unsupported Media Type”,“path”:“/access-profiles/eab146821c1146948f4aa691502cf502”}

    payload = json.dumps({
    "op": "add",
    "path": "/entitlements/0",
    "value": {
        "id": get_entitlement_id(entitlement_name, env_var),
        "type": "ENTITLEMENT",
        "name": "testgroup"
    },
     "owner": {
     "type": "IDENTITY",
     "id": "XXXXX"
    },
     "source": {
      "id": "XXX"
        "type": "SOURCE"
     },
    "requestable": True,
    "accessRequestConfig": {
       "commentsRequired": True,
      "denialCommentsRequired": True,
       "approvalSchemes": [
         {
             "approverType": "MANAGER"
        },
          {
             "approverType": "GOVERNANCE_GROUP",
               "approverId": "XXXX"
         }
     ]
   }
})

Hi @nidhipriya ,

Sorry, I did not face this error previously, so I dont have anythign from the top of my head. However, if I were you, I would try the following:

  • Did this work from postman? If yes, could you please share the request?
  • Did the script work on a different api version?

Hi @vbdm - same error from postman as well
is my payload and path for the entitlement is correct?

Can you please share your postman call and the response?

hi @nidhipriya, based on the input and the error messages these are my observations

  1. Error says Unsupported Media Type: Can you validate if you are passing the correct header values when you are making the request both from postman and from your script.
  2. Since the access profile is already created with the particular source you do not need to again pass source, owner inside value json.
    Can you correct this and try again in postman to see it is working

sounds like you are passing the wrong headers with your request.