LoginHistory

Represents the login history for all successful and failed login attempts for organizations and enabled portals.

Supported Calls

describeSObjects(), query(), retrieve()

Special Access Rules

Only users with Manager Users permissions can access this object.

Fields

Field Details
ApiType
Type
string
Properties
Group, Nillable, Sort
Description
Indicates the API type, for example Soap Enterprise. Label is API Type.
APIVersion
Type
string
Properties
Group, Nillable, Sort
Description
Displays the API version used by the client. Label is API Version.
Application
Type
string
Properties
Group, Nillable, Sort
Description
The application used to access the organization. Label is Application.
Browser
Type
string
Properties
Group, Nillable, Sort
Description
The current browser version. Label isBrowser.
ClientVersion
Type
string
Properties
Group, Nillable, Sort
Description
Version of the API client. Label isClient Version.
LoginTime
Type
dateTime
Properties
Filter, Nillable, Sort
Description
Time zone is based on GMT. Label is Login Time.
LoginType
Type
picklist
Properties
Filter, Group, Restricted picklist, Sort
Description
The type of login, for example, Application. Label is Login Type.
LoginUrl
Type
string
Properties
Filter, Group, Nillable, Sort
Description
URL from which the login request is coming. Label is Login URL.
NetworkId
Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The ID of the community that the user is logging in to. This field is available in API version 31.0 and later, if Salesforce Communities is enabled for your organization.
Platform
Type
string
Properties
Group, Nillable, Sort
Description
Operating system on the login machine. Label is Platform.
SourceIp
Type
string
Properties
Group, Nillable, Sort
Description
IP address of the machine from which the login request is coming. This can be an IPv4 or IPv6 address in API version 23.0 or later. In API version 22.0 or earlier, this is an IPv4 address, and IPv6 addresses are null. Label is Source IP.
Status
Type
string
Properties
Group, Nillable, Sort
Description
Displays the status of the attempted login. Status is either success or a reason for failure. Label is Status.
UserId
Type
reference
Properties
Filter, Group, Nillable, Sort
Description
ID of the user logging in. Label is User ID.

Usage

Not all fields are filterable. You can only filter on the following fields:

The API allows you to do many powerful queries. A few examples are:

Sample Query Query String
Simple query showing UserId & LoginTime for each user SELECT UserId, LoginTime from LoginHistory;
Query showing logins only after a specified date and time SELECT UserId, LoginTime from LoginHistory WHERE LoginTime > 2010-09-20T22:16:30.000Z;
Query showing logins for a specific time interval SELECT UserId, LoginTime from LoginHistory WHERE LoginTime > 2010-09-20T22:16:30.000Z AND LoginTime < 2010-09-21T22:16:30.000Z;
© Copyright 2000–2014 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.