I've been looking for the right object to query using the API to get the used/total amount per license type, but I'm not quite sure which one holds this information.

PermissionSetLicense seems to contain Used/Total values, but it is related to Permission Sets and returns 0 results when I query it. http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_permissionset.htm

UserLicense seems related to License too, but it doesn't contain field related to this. http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_userlicense.htm

Am I missing something?

  • Based on this salesforce.stackexchange.com/questions/171/… the information may well not be exposed.
    – Keith C
    Apr 2, 2014 at 17:35
  • @KeithC I'll wait to see if someone has more inspiration then doing webscraping, because this is definitely not a stable way to get this information :)! Thanks for pointing this out!
    – jpmonette
    Apr 2, 2014 at 19:26

2 Answers 2


Sorry to be the bearer of bad news, but license counts (available, that is) are not available to apps/API.

But while we're on the topic, are you talking about ISV app licenses or about Salesforce seats of various varieties (Standard, platform, portal, Chatter Free, etc)? Because neither of those are available from within the app... BUT you can expose a web service back on your LMA and can tell the customer's installation of your application how many licenses you have given the customer.


There are UsedLicenses / TotalLicenses fields from UserLicense object available only through API call and only available for organization subscribed for related Pilot Program.

If your question relates to usage of UsedLicenses / TotalLicenses fields, you may vote up for this idea https://success.salesforce.com/ideaView?id=08730000000cJTEAA2 and also you may be interested in a managed beta package I created recently which may serve as workaround for this. It screenscrapes company profile page and gets number of total license.

This package includes a User_License_Extended__c custom object which contains Total License number and Used Licenses number ( and some more fields ), these numbers are updated whenever a user is activated or deactivated or user profile is changed assuming package is properly set up with necessary data

Install link for production-like org https://login.salesforce.com/packaging/installPackage.apexp?p0=04t580000001ENa

More details and release notes https://patlatus.wordpress.com/2016/03/07/salesforce-uletas-beta-1-0-release-notes/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .