Entitlement Definitions

Administrative APIs for working with 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

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
# 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.

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

Last updated