API Command: set_session_attributes

The set_session_attributes command sets the external key and other custom attributes for an active session.

The command API is an authenticated API. For instructions on using authenticated APIs using OAuth, see Authenticate to the PA API. The API account used to issue this command must have full access to the command API.

Required Parameter for set_session_attributes

lsid=[string] The ID of the session whose attributes you wish to set. The session must currently be active.

Optional Parameters for set_session_attributes

session.custom.external_key=[string] An arbitrary string that can link this session to an identifier on an external system, such as a customer relationship management ticket ID. This has a maximum length of 1024 characters.
session.custom.[custom field]=[string]

The code name and value of any custom fields. These fields must first be configured in /login > Management > API Configuration.

Each attribute must be specified as a different parameter. Each custom field has a maximum length of 1024 characters. The maximum total size of all combined custom fields, including the external key, must be limited to 10KB.

Note: If an attribute is not listed in the URL, it will keep its existing value. To clear an attribute, you must set the attribute to an empty string.

XML Response for set_session_attributes Query

<success> Returns a message of Session attributes were set if the attributes were set successfully.
<error> Returns an error message if the attributes were not set successfully.

Query Examples: set_session_attributes

Set external key for session c69a8e10bea9428f816cfababe9815fe
  • https://access.example.com/api/command?action=
    set_session_attributes&lsid=
    c69a8e10bea9428f816cfababe9815fe&
    session.custom.external_key=ABC123
Set a custom value for session c69a8e10bea9428f816cfababe9815fe
  • https://access.example.com/api/command?action=
    set_session_attributes&lsid=
    c69a8e10bea9428f816cfababe9815fe&
    session.custom.custom_field1=Custom%20Value