---
schema_version: "1"
id: 3cbe0ea85fcdb850640aa35d35402a708ed6e3242e65bdf6cc28f87c19c1bcb1
title: UserLicense
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_userlicense.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_userlicense.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3cadda4cdf76929c8addad5b105af0133558267d0bbc56bf61544c2c00ad66c7
description: Represents a user license in your organization. A user license entitles a user to specific functionality and determines the profiles and permission sets available to the user.
---
# UserLicense

Represents a user license in your organization. A user license entitles a user to specific functionality and determines the profiles and permission sets available to the user.

## Supported Calls

describeSObjects(), query(), retrieve()

## Fields

| Field | Details |
| --- | --- |
| LicenseDefinitionKey | 
Type

string

Properties

Filter, Group, Sort

Description

A string that uniquely identifies a particular user license. Label is License Def. ID. Values are:

**AUL**: corresponds to the Salesforce Platform user license

**AUL1**: corresponds to the Salesforce Platform One user license

**AUL\_LIGHT** corresponds to the Salesforce Platform Light user license

**FDC\_ONE** corresponds to the Lightning Platform - One App user license

**FDC\_SUB** corresponds to the Lightning Platform App Subscription user license

**Overage\_Platform\_Portal\_User** corresponds to the Overage Authenticated Website user license

**PID\_STRATEGIC\_PRM**: corresponds to the Gold Partner user license

**PID\_CHATTER** corresponds to the Chatter Only user license

**PID\_CONTENT** corresponds to the Content Only user license

**PID\_Customer\_Portal\_Basic**: corresponds to the Customer Portal Manager Standard user license and the Customer Portal User license

**PID\_Customer\_Portal\_Standard**: corresponds to the Customer Portal Manager Custom user license

**PID\_FDC\_FREE** corresponds to the Lightning Platform Free user license

**PID\_IDEAS** corresponds to the Ideas Only user license

**PID\_Ideas\_Only\_Portal** corresponds to the Ideas Only Portal user license

**PID\_Ideas\_Only\_Site** corresponds to the Ideas Only Site user license

**PID\_KNOWLEDGE** corresponds to the Knowledge Only user license

**PID\_Customer\_Community** corresponds to the Customer Community license.

**PID\_Customer\_Community\_Login** corresponds to the Customer Community Login license.

**PID\_Partner\_Community** corresponds to the Partner Community license.

**PID\_Partner\_Community\_Login** corresponds to the Partner Community Login license.

**PID\_Limited\_Customer\_Portal\_Basic**: corresponds to the Limited Customer Portal Manager Standard user license

**PID\_Limited\_Customer\_Portal\_Standard**: corresponds to the Limited Customer Portal Manager Custom user license

**PID\_Overage\_Customer\_Portal\_Basic**: corresponds to the Overage Customer Portal Manager Standard user license

**PID\_Overage\_High Volume Customer Portal** corresponds to the Overage High Volume Customer Portal user license

**Platform\_Portal\_User**: corresponds to the Authenticated Website user license

**POWER\_PRM**: corresponds to the Partner user license

**POWER\_SSP**: corresponds to the Customer Portal Manager user license

**SFDC**: corresponds to the Full CRM user license





 |
| MasterLabel | 

Type

string

Properties

Filter, Group, Sort

Description

The user license label.

This field is available in API version 32.0 and later.



 |
| MonthlyLoginsEntitlement | 

Type

int

Properties

Filter, Group, Nillable, Sort

Description

The maximum number of customer or partner portal logins allowed per month. A null value in this field means the user license is charged according to the number of users rather than the number of logins.

This field is available in API version 20.0 and later.

![Note](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/images/icon_note.png)

#### Note

To be visible and queryable, this field requires:

- Digital Experiences enabled
- the View Setup and Configuration user permission















 |
| MonthlyLoginsUsed | 

Type

int

Properties

Group, Nillable, Sort

Description

The number of successful logins for all users associated with a customer or partner portal user license. This field has a non-null value if MonthlyLoginsEntitlement has a non-null value.

This field is available in API version 20.0 and later.

![Note](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/images/icon_note.png)

#### Note

To be visible and queryable, this field requires:

- Digital Experiences enabled
- the View Setup and Configuration user permission















 |
| Name | 

Type

string

Properties

Filter, Group, idLookup, Sort

Description

The internal name of the user license.

![Note](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/images/icon_note.png)

#### Note

Your organization may also include custom user licenses.















 |
| Status | 

Type

picklist

Properties

Filter, Group, Restricted picklist, Sort

Description

The current status of the user license. Valid values for this field are Active and Disabled.

This field is available in API version 32.0 and later.



 |
| TotalLicenses | 

Type

int

Properties

Filter, Group, Sort

Description

The number of user licenses in the organization.

This field is available in API version 32.0 and later.



 |
| UsedLicenses | 

Type

int

Properties

Filter, Group, Sort

Description

The number of user licenses that are assigned to active users in the organization.

This field is available in API version 32.0 and later.

This field isn’t filterable in API version 64.0 or later when using it in a WHERE clause in a SOQL query. Instead, you have to process the data after fetching all the records.



 |
| UsedLicensesLastUpdated | 

Type

dateTime

Properties

aggregate, Filter, Sort

Description

The timestamp of the query. If your license count exceeds your org’s allotted threshold, the count timestamp reflects the previous day, otherwise the timestamp reflects the current day and time.

This field is available in API version 41.0 and later.



 |

## Usage

Users with the “View Setup and Configuration” permission can use the UserLicense object to view the set of currently defined user licenses in your organization.

The UserLicense object is currently used by bulk user creation to determine the user license to which each profile and permission set belongs. For example, if you use the API to create portal users and you want to know which profile belongs to each portal user license, you can query this object for each profile and check the LicenseDefinitionKey to identify the associated user license.

#### See Also

- [Profile](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_profile.htm "Represents a profile, which defines a set of permissions to perform different operations. Operations can include creating a custom profile or querying, adding, updating, or deleting information.")
- [PermissionSet](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_permissionset.htm "Represents a set of permissions that’s used to grant more access to one or more users without changing their profile or reassigning profiles. This object is available in API version 22.0 and later.")