get:
  operationId: listEntitlements
  tags:
    - Entitlements
  summary: Gets a list of entitlements.
  description: >-
    This API returns a list of entitlements.


    This API can be used in one of the two following ways:
    either getting entitlements for a specific **account-id**,
    or getting via use of **filters** (those two options are exclusive).


    Any authenticated token can call this API.
  parameters:
    - in: query
      name: account-id
      schema:
        type: string
      description: >-
        The account ID.
        If specified, returns only entitlements associated with the given Account.
        Can not be specified with the **filters**, **segmented-for-identity**, **for-segment-ids**, or
        **include-unsegmented** param(s).
      example: ef38f94347e94562b5bb8424a56397d8
      required: false
    - in: query
      name: segmented-for-identity
      schema:
        type: string
      description: >-
        If present and not empty, additionally filters Entitlements to those which are assigned to the Segment(s) which
        are visible to the Identity with the specified ID. By convention, the value **me** can stand in for the current
        user's Identity ID.

        Can not be specified with the **account-id** or **for-segment-ids** param(s). It is also illegal to specify a
        value that refers to a different user's Identity.
      example: me
      required: false
    - in: query
      name: for-segment-ids
      schema:
        type: string
        format: comma-separated
      description: >-
        If present and not empty, additionally filters Access Profiles to those which are assigned to the Segment(s)
        with the specified IDs.

        Can not be specified with the **account-id** or **segmented-for-identity** param(s).
      example: 041727d4-7d95-4779-b891-93cf41e98249,a378c9fa-bae5-494c-804e-a1e30f69f649
      required: false
    - in: query
      name: include-unsegmented
      schema:
        type: boolean
        default: true
      description: >-
        Whether or not the response list should contain unsegmented Entitlements.
        If **for-segment-ids** and **segmented-for-identity** are both absent or empty, specifying
        **include-unsegmented=false** results in an error.
      example: true
      required: false
    - $ref: '../../v3/parameters/offset.yaml'
    - $ref: '../../v3/parameters/limit.yaml'
    - $ref: '../../v3/parameters/count.yaml'
    - in: query
      name: sorters
      schema:
        type: string
        format: comma-separated
      description: >-
        Sort results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#sorting-results)

        Sorting is supported for the following fields: **id, name, created, modified, type, attribute, value, source.id**
      example: name,-modified
      required: false
      style: form
      explode: true
    - in: query
      name: filters
      schema:
        type: string
      description: >-
        Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#filtering-results)

        Filtering is supported for the following fields and operators:


        **id**: *eq, in*


        **name**: *eq, in, sw*


        **type**: *eq, in*


        **attribute**: *eq, in*


        **value**: *eq, in, sw*


        **source.id**: *eq, in*


        **requestable**: *eq*
      example: attribute eq "memberOf"
      required: false
      style: form
      explode: true
    - in: query
      name: cursor
      deprecated: true
      schema:
        type: string
      description: >-
        **WARNING: This parameter is deprecated and support will be removed in an upcoming release.**

        
        This endpoint supports cursor-based pagination as an alternative to pagination using **limit** and **offset**.
        Use of cursors is optional but may deliver significantly better performance when paginating over large result
        sets, particularly when sorting is involved.


        To obtain an initial cursor value, the initial request must be made with **offset=0** and **count=false**, or
        by omitting those parameters. Other query parameters may be specified on the initial request, to specify
        filtering and sorting for example. The response to this initial request will provide a cursor value in the
        **Slpt-Cursor** response header. Thereafter, passing in the last returned value of **Slpt-Cursor** as the value
        of the **cursor** parameter on the following request will return the next page of results, and so on. The end of
        the result set is signalled when a request returns without providing a value for **Slpt-Cursor**.


        The **cursor** param is generally incompatible with other parameters; the second and subsequent requests should
        only pass that parameter and no others. A 400 Bad Request will be returned if any incompatible parameter values
        are passed along with the **cursor**.


        Cursors expire after 15 minutes; a 400 Bad Request is returned if an expired value is provided for **cursor**.
      example: 9602877a-1c11-4c02-a399-7273ea2158da
      required: false
  responses:
    '200':
      description: List of entitlements
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '../schemas/Entitlement.yaml'
    '400':
      $ref: '../../v3/responses/400.yaml'
    '401':
      $ref: '../../v3/responses/401.yaml'
    '403':
      $ref: '../../v3/responses/403.yaml'
    '429':
      $ref: '../../v3/responses/429.yaml'
    '500':
      $ref: '../../v3/responses/500.yaml'
patch:
  operationId: patchEntitlement
  tags:
    - Entitlements
  summary: Patch a specified Entitlement
  description: >-
    This API updates an existing Entitlement using [JSON Patch](https://tools.ietf.org/html/rfc6902) syntax.


    The following fields are patchable:
    **requestable**, **privileged**, **segments**


    A token with ORG_ADMIN or SOURCE_ADMIN authority is required to call this API.
  parameters:
    - name: id
      in: path
      description: ID of the Entitlement to patch
      required: true
      schema:
        type: string
        example: 2c91808a7813090a017814121e121518
  requestBody:
    content:
      application/json-patch+json:
        schema:
          type: array
          items:
            $ref: '../schemas/JsonPatchOperation.yaml'
        examples:
          Make an Entitlement Requestable and Privileged in One Call:
            description: This example shows how multiple fields may be updated with a single patch call.
            value:
              [
                {
                  "op": "replace",
                  "path": "/requestable",
                  "value": true
                },
                {
                  "op": "replace",
                  "path": "/privileged",
                  "value": true
                }
              ]

          Assign an Entitlement to a Segment:
            description: >-
              This example illustrates the use of patch to assign an Entitlement to a Segment by adding the Segment's ID to the
              Entitlement's segments array.
            value:
              [
                {
                  "op": "add",
                  "path": "/segments/-",
                  "value": "f7b1b8a3-5fed-4fd4-ad29-82014e137e19"
                }
              ]
  responses:
    '200':
      description: Responds with the Entitlement as updated.
      content:
        application/json:
          schema:
            $ref: '../schemas/Entitlement.yaml'
    '400':
      $ref: '../../v3/responses/400.yaml'
    '401':
      $ref: '../../v3/responses/401.yaml'
    '403':
      $ref: '../../v3/responses/403.yaml'
    '404':
      $ref: '../../v3/responses/404.yaml'
    '429':
      $ref: '../../v3/responses/429.yaml'
    '500':
      $ref: '../../v3/responses/500.yaml'
