# Create Entitlement API

**URL:** <https://developer.sailpoint.com/discuss/t/create-entitlement-api/2199>\
**Category:** SHF Discussion and Questions\
**Created:** [November 29, 2021, 1:42pm UTC](https://developer.sailpoint.com/discuss/t/create-entitlement-api/2199 "2021-11-29T13:42:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rk2021](https://avatars.discourse-cdn.com/v4/letter/r/65b543/32.png) [@rk2021](https://developer.sailpoint.com/discuss/u/rk2021)\
**Post date:** [November 29, 2021, 1:42pm UTC](https://developer.sailpoint.com/discuss/t/create-entitlement-api/2199/1 "2021-11-29T13:42:01Z")

</div>

What is the API to create an entitlement in a Source?

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [November 30, 2021, 2:32pm UTC](https://developer.sailpoint.com/discuss/t/create-entitlement-api/2199/2 "2021-11-30T14:32:54Z")

</div>

There currently is no API to create entitlements. If you are working with a delimited file source, then you can create entitlements by uploading a CSV with all of your entitlements. This is done in the “Import Entitlements” page in the “Import Data” tab of the delimited file source.

---

<div class="post-metadata">

**Author:** ![rk2021](https://avatars.discourse-cdn.com/v4/letter/r/65b543/32.png) [@rk2021](https://developer.sailpoint.com/discuss/u/rk2021)\
**Post date:** [November 30, 2021, 3:04pm UTC](https://developer.sailpoint.com/discuss/t/create-entitlement-api/2199/3 "2021-11-30T15:04:55Z")

</div>

@colin_mckibben thank you for your response.

I tried to capture the request using the chrome developer tool while importing the entitlement, but can see only the below. Is there any possible way to get the request from developer tool?

[https://partnerinstance.api.identitynow.com/cc/api/source/loadEntitlements/12345](https://partnerinstance.api.identitynow.com/cc/api/source/loadEntitlements/12345)

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [November 30, 2021, 4:10pm UTC](https://developer.sailpoint.com/discuss/t/create-entitlement-api/2199/4 "2021-11-30T16:10:26Z")

</div>

What you see here is a v1 API that uploads a CSV file of entitlements. V1 APIs aren’t gauranteed to be stable or supported, so please be cautious when using them.

I looked it up in my Chrome dev tools, and here is how you can use it.

POST [https://partnerinstance.api.identitynow.com/cc/api/source/loadEntitlements/{sourceId}](https://partnerinstance.api.identitynow.com/cc/api/source/loadEntitlements/%7BsourceId%7D)

The payload is a content type of multipart/form-data, which is the contents of your entitlements CSV file. The following cURL call should work:

```nohighlight
curl --location --request POST 'https://{org}.api.identitynow.com/cc/api/source/loadEntitlements/{sourceId}' \
--header 'Authorization: Bearer {access_token}' \
--form 'data=@"/path/to/entitlements.csv"'

```

---

<div class="post-metadata">

**Author:** ![rk2021](https://avatars.discourse-cdn.com/v4/letter/r/65b543/32.png) [@rk2021](https://developer.sailpoint.com/discuss/u/rk2021)\
**Post date:** [November 30, 2021, 4:25pm UTC](https://developer.sailpoint.com/discuss/t/create-entitlement-api/2199/5 "2021-11-30T16:25:33Z")

</div>

@colin_mckibben Thank you for your response. I have already tried the above and was getting the below error for my test delimited application.

```auto
{
    "msg_template": "IllegalArgumentException: s3Bucket and s3Key are required for source \"TestDelimitedApplication [source]\" of type Delimited File",
    "slpt_error_code": "SLPT-1009",
    "formatted_msg": "IllegalArgumentException: s3Bucket and s3Key are required for source \"TestDelimitedApplication [source]\" of type Delimited File",
    "exception_id": "17D71A615AB",
    "error_code": 1009,
    "exception_class": "groovyx.net.http.HttpResponseException",
    "exception_detail": {
        "file": "RESTClient.java",
        "method": "defaultFailureHandler",
        "line_number": 240,
        "class": "groovyx.net.http.RESTClient"
    },
    "http_response_code": 400,
    "timestamp": "2021-11-30 16:20:49.707",
    "exception_message": "Bad Request"
}

```

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [November 30, 2021, 7:49pm UTC](https://developer.sailpoint.com/discuss/t/create-entitlement-api/2199/6 "2021-11-30T19:49:54Z")

</div>

Upon closer inspection it seems that my cURL command is failing for me as well. The key `data` is incorrect. It should be `file`. Here is the correct cURL command.

```nohighlight
curl --location --request POST 'https://{org}.api.identitynow.com/cc/api/source/loadEntitlements/{sourceId}' \
--header 'Authorization: Bearer {access_token}' \
--form 'file=@"/path/to/entitlements.csv"'

```

---

<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:** [July 19, 2023, 2:22pm UTC](https://developer.sailpoint.com/discuss/t/create-entitlement-api/2199/7 "2023-07-19T14:22:19Z")

</div>

Closed on July 19, 2023, 2:22pm UTC


