Skip to content

Authentication

Some actions require a valid user session. For example, MASV Agent requires a valid user session when sending a Package to an email recipient or creating download automations. Other actions, like uploading to a Portal, do not require a user session.

When you try to perform an action without a valid session, the service responds with a 401 Unauthorized status code:

{
"code": 262146,
"message": "session is nil"
}

We recommend authenticating through an API key. Once you have generated your API key, pass it as a flag when you start the server:

Terminal window
masv server start --api-key='YOUR_KEY'

Use the following command to log in with your email and password.

Terminal window
masv user login --email {EMAIL} --password {PASSWORD}

To see which user currently has a valid session with MASV Agent:

Terminal window
masv user status

The response includes the logged-in user and their Teams:

{
"user": {
"email": "me@domain.tld",
"id": "01CWEEY5PT3535ETT4TH9NYZVP",
"name": "Firstname Lastname"
},
"teams": [
{
"custom_expiry_default": 30,
"custom_expiry_enabled": true,
"download_limit_default": 12,
"download_limit_enabled": true,
"id": "01CWEEY60MREFF7PPYZ82QSQ9J",
"max_email_recipients": 30,
"name": "Acme",
"subdomain": "acme"
}
]
}
  • user — the logged-in user’s attributes.
  • teams — an array of all Teams the user belongs to, with limits and settings configured for each Team.

Retrieve the Teams that the current user belongs to:

Terminal window
masv user teams

If there is no user session, or authentication failed, MASV Agent responds with a 401 Unauthorized status:

HTTP/1.1 401 Unauthorized
Content-Type: application/json
  • Uploads — Send files via Team email, shareable Link, or Portal.
  • Downloads — Initiate, monitor, and manage file downloads.
  • Automations — Set up automated download and upload workflows.