Sessions
A Session is an operation that allows you to make further API calls using our REST API or SDKs as a specific user. This is the only way to use the API if you know a username/password but not an API key.
Sessions in the API and SDKs use the exact same mechanism (and work the same) as sessions in the web interface.
After creating a session, the Session object returned will include plenty of relevant information about the current user, often used to customize the interface or enable further automation.
Create user session (log in)
SDK Method
files_sdk.session.create()
Return Object
Session
Authorization Requirement
No authentication required; you may call this endpoint without a key or session.
Method Arguments
| Argument | Description |
|---|---|
| username string | Username to sign in as |
| password string | Password for sign in |
| otp string | If this user has a 2FA device, provide its OTP or code here. |
| partial_session_id string | Identifier for a partially-completed login |
Delete user session (log out)
SDK Method
files_sdk.session.delete()
Return Object
No return value.
Authorization Requirement
No authentication required; you may call this endpoint without a key or session.
The Session Object
Some of the methods above return a Session object. The attributes of this object are listed below.
| Attribute | Description |
|---|---|
| id string | Session ID |
| language string | Session language |
| read_only boolean | Is this session read only? |
| sftp_insecure_ciphers boolean | Are insecure SFTP ciphers allowed for this user? (If this is set to true, the site administrator has signaled that it is ok to use less secure SSH ciphers for this user.) |