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)
Command
files-cli sessions create
Output
Outputs a Session object according to the output format.
Authorization Requirement
No authentication required; you may call this endpoint without a key or session.
Flags
| Flag | 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)
Command
files-cli sessions delete
Output
No output is returned.
Authorization Requirement
No authentication required; you may call this endpoint without a key or session.
The Session Object
Some of the commands 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.) |