> For the complete documentation index, see [llms.txt](https://docs.sudoplatform.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sudoplatform.com/guides/entitlements/administrative-api/entitlement-definitions.md).

# Entitlement Definitions

Entitlement definitions describe particular entitlements. They specify whether an entitlement is Boolean or numeric and whether a numeric entitlement is expendable or not.

## Common Entitlements Definition Types

```graphql
type EntitlementDefinition
  name: String!
  description: String
  type: String!
  expendable: Boolean!
}
```

## Listing Entitlement Definitions

Call the `listEntitlementDefinitions` query to list all of the entitlement definitions in the system. This list will vary depending on the Sudo Platform service enabled in your environment.

The results list is paginated with a default page size of 10. To retrieve all results your application must implement the following algorithm.

```
1. Call listEntitlementDefinitions query with nextToken set to null
2. If nextToken in the returned EntitlementDefinitionsConnection is null, 
   there are no more results to retrieve
3. Call listEntitlementDefinitions query with nextToken set to the value
   returned from the previous call
4. Go to step 2
```

```graphql
# Pagination connection for use when listing entitlement definitions
type EntitlementDefinitionConnection {
  items: [EntitlementsDefinition!]!
  nextToken: String
}

# Input for the listEntitlementDefinitions query
input ListEntitlementDefinitionsInput {
  token: String!
}

type Query {
# Retrieves all entitlement definitions.
listEntitlementDefinitions(
  nextToken: String
): EntitlementDefinitionConnection!
}
```

### Possible Errors

* **ServiceError** will be returned for internal errors.

Listing entitlement definitions using SDK.

{% tabs %}
{% tab title="Swift" %}

```swift
do {
    let listOutput = try await client.listEntitlementDefinitionsWithNextToken(
        limit: 50,
        nextToken: nil,
    ) 
} catch {
    // Handle error. An error may be thrown if the backend is unable perform
    // the operation due to invalid input, availability or security issues.
}
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
val listOutput =
    client.listEntitlementDefinitions(
        50,
        null 
    )
```

{% endtab %}

{% tab title="TypeScript" %}

```typescript
const limit = 50
let nextToken: string|undefined
const listOutput = await client.listEntitlementDefinitions(
  limit,
  nextToken
)

```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sudoplatform.com/guides/entitlements/administrative-api/entitlement-definitions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
