# Patch accessprofile

**URL:** <https://developer.sailpoint.com/discuss/t/patch-accessprofile/145754>\
**Category:** SHF Discussion and Questions\
**Tags:** apis, identity-security-cloud\
**Created:** [June 18, 2025, 1:23pm UTC](https://developer.sailpoint.com/discuss/t/patch-accessprofile/145754 "2025-06-18T13:23:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nidhipriya](https://avatars.discourse-cdn.com/v4/letter/n/958977/32.png) [@nidhipriya](https://developer.sailpoint.com/discuss/u/nidhipriya)\
**Post date:** [June 18, 2025, 1:23pm UTC](https://developer.sailpoint.com/discuss/t/patch-accessprofile/145754/1 "2025-06-18T13:23:53Z")

</div>

Hi All,

Facing error in updating accessprofile with entitlements and governance group using PATCH API  
[v2024/access-profiles/{id](https://sailpoint.api.identitynow.com/v3/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"
         }
     ]
   }
})

```

---

<div class="post-metadata">

**Author:** ![vbdm](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/vbdm/32/26869_2.png) [@vbdm](https://developer.sailpoint.com/discuss/u/vbdm)\
**Post date:** [June 18, 2025, 2:11pm UTC](https://developer.sailpoint.com/discuss/t/patch-accessprofile/145754/2 "2025-06-18T14:11:23Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![nidhipriya](https://avatars.discourse-cdn.com/v4/letter/n/958977/32.png) [@nidhipriya](https://developer.sailpoint.com/discuss/u/nidhipriya)\
**Post date:** [June 18, 2025, 3:12pm UTC](https://developer.sailpoint.com/discuss/t/patch-accessprofile/145754/3 "2025-06-18T15:12:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vbdm](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/vbdm/32/26869_2.png) [@vbdm](https://developer.sailpoint.com/discuss/u/vbdm)\
**Post date:** [June 18, 2025, 6:53pm UTC](https://developer.sailpoint.com/discuss/t/patch-accessprofile/145754/4 "2025-06-18T18:53:12Z")

</div>

Can you please share your postman call and the response?

---

<div class="post-metadata">

**Author:** ![udayputta](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/udayputta/32/14195_2.png) [@udayputta](https://developer.sailpoint.com/discuss/u/udayputta)\
**Post date:** [June 18, 2025, 7:10pm UTC](https://developer.sailpoint.com/discuss/t/patch-accessprofile/145754/5 "2025-06-18T19:10:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jrossicare](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@jrossicare](https://developer.sailpoint.com/discuss/u/jrossicare)\
**Post date:** [June 19, 2025, 4:54am UTC](https://developer.sailpoint.com/discuss/t/patch-accessprofile/145754/6 "2025-06-19T04:54:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nidhipriya](https://avatars.discourse-cdn.com/v4/letter/n/958977/32.png) [@nidhipriya](https://developer.sailpoint.com/discuss/u/nidhipriya)\
**Post date:** [June 24, 2025, 1:31pm UTC](https://developer.sailpoint.com/discuss/t/patch-accessprofile/145754/7 "2025-06-24T13:31:05Z")

</div>

![image](https://global.discourse-cdn.com/sailpoint/original/3X/3/e/3e27d6995b1a700bb9f84bd30ca9fcb157211c55.png)  
Error: Access profile update failed. Status code: 400 {“messages”:[{“localeOrigin”:“REQUEST”,“text”:“The request could not be parsed.”,“locale”:“en-US”},{“localeOrigin”:“DEFAULT”,“text”:“The request could not be parsed.”,“locale”:“en-US”}],“detailCode”:“400.0 Bad request syntax”,“trackingId”:“a184503d69814c6d99e5a0a9f4ee5903”}  
tried with different header still getting error msg as above  
 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/3/4/34f304af510df0ae0ad080cdf306ba540c31fe54.png)

---

<div class="post-metadata">

**Author:** ![YanCoelho](https://avatars.discourse-cdn.com/v4/letter/y/f6c823/32.png) [@YanCoelho](https://developer.sailpoint.com/discuss/u/YanCoelho)\
**Post date:** [June 24, 2025, 2:33pm UTC](https://developer.sailpoint.com/discuss/t/patch-accessprofile/145754/8 "2025-06-24T14:33:50Z")

</div>

Hello,

Your payload should be like this:

```auto
payload = json.dumps([
  {
    "op": "add",
    "path": "/entitlements/0",
    "value": {
      "id": get_entitlement_id(entitlement_name, env_var),
      "type": "ENTITLEMENT"
    }
  }
])

```

There is no need to pass any additional information, as the Access Profile ID will be referenced in the URL.

If you want to edit more than one data your payload should be like this:

```auto
payload = json.dumps([
  {
    "op": "add",
    "path": "/entitlements/0",
    "value": {
      "id": get_entitlement_id(entitlement_name, env_var),
      "type": "ENTITLEMENT"
    }
  },
  {
    "op": "replace",
    "path": "/accessRequestConfig",
    "value": {
      "commentsRequired": True,
      "denialCommentsRequired": True,
      "approvalSchemes": [
        {
          "approverType": "GOVERNANCE_GROUP",
          "approverId": f"{group_id}"
        }
      ]
    }
  }
])

```

Other options:

```auto
payload = json.dumps([
  {
    "op": "replace",
    "path": "/name",
    "value": "Debug Add Entitlement"
  },
  {
    "op": "replace",
    "path": "/description",
    "value": "Debug Add Entitlement"
  },
  {
    "op": "replace",
    "path": "/owner",
    "value": {
      "type": "IDENTITY",
      "id": "12321321",
      "name": "Yan Coelho"
    }
  },
  {
    "op": "replace",
    "path": "/enabled",
    "value": False
  },
  {
    "op": "replace",
    "path": "/requestable",
    "value": True
  },
  {
    "op": "replace",
    "path": "/accessRequestConfig",
    "value": {
      "commentsRequired": True,
      "denialCommentsRequired": True,
      "approvalSchemes": [
        {
          "approverType": "GOVERNANCE_GROUP",
          "approverId": f"{group_id}"
        }
      ]
    }
  },
  {
    "op": "replace",
    "path": "/revocationRequestConfig",
    "value": {
      "approvalSchemes": []
    }
  },
  {
    "op": "replace",
    "path": "/entitlements",
    "value": []
  },
  {
    "op": "replace",
    "path": "/provisioningCriteria",
    "value": None
  }
])

```

Thanks

---

<div class="post-metadata">

**Author:** ![nidhipriya](https://avatars.discourse-cdn.com/v4/letter/n/958977/32.png) [@nidhipriya](https://developer.sailpoint.com/discuss/u/nidhipriya)\
**Post date:** [June 24, 2025, 5:14pm UTC](https://developer.sailpoint.com/discuss/t/patch-accessprofile/145754/9 "2025-06-24T17:14:26Z")

</div>

[quote=“Yan Coelho, post:8, topic:145754, username:YanCoelho”]

```auto
[
        {
          "approverType": "GOVERNANCE_GROUP",
          "approverId": f"{group_id}"
        }
      ]

```

@YanCoelho - thank you so much, it worked  
🙂

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [August 23, 2025, 5:15pm UTC](https://developer.sailpoint.com/discuss/t/patch-accessprofile/145754/10 "2025-08-23T17:15:01Z")

</div>

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