Log in
curl --request POST \
--url https://api.glassmarkets.io/v1/login/ \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>",
"cookie_auth": false,
"remember_me": false
}
'import requests
url = "https://api.glassmarkets.io/v1/login/"
payload = {
"email": "<string>",
"password": "<string>",
"cookie_auth": False,
"remember_me": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: '<string>',
password: '<string>',
cookie_auth: false,
remember_me: false
})
};
fetch('https://api.glassmarkets.io/v1/login/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"expiry": "2025-03-19T06:16:11.133643-04:00",
"token": "ad3dfe261c87c5556bc090aef5c2e9b6be8a647f00476d7c7bcd0412f889",
"user": {
"username": "email@address.com",
"first_name": "Firstname",
"id": 1,
"last_name": "Lastname",
"email": "email@address.com"
}
}Authentication
Log in
Exchanges your email and password for a session token. Send the token as Authorization: Token <token> on every other request.
The token expires one day after its last use, and at most 30 days after login. With remember_me, it stays valid for at least 7 days. expiry in the response is the current expiry time.
If your account has two-factor authentication, the response is 202 with a challenge_id: complete the login with POST /v1/totp/login/. cookie_auth is for the GlassMarkets web app and needs a trusted browser origin. Login is rate-limited.
Log in
curl --request POST \
--url https://api.glassmarkets.io/v1/login/ \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>",
"cookie_auth": false,
"remember_me": false
}
'import requests
url = "https://api.glassmarkets.io/v1/login/"
payload = {
"email": "<string>",
"password": "<string>",
"cookie_auth": False,
"remember_me": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: '<string>',
password: '<string>',
cookie_auth: false,
remember_me: false
})
};
fetch('https://api.glassmarkets.io/v1/login/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"expiry": "2025-03-19T06:16:11.133643-04:00",
"token": "ad3dfe261c87c5556bc090aef5c2e9b6be8a647f00476d7c7bcd0412f889",
"user": {
"username": "email@address.com",
"first_name": "Firstname",
"id": 1,
"last_name": "Lastname",
"email": "email@address.com"
}
}Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Issue the token in an HttpOnly cookie instead of the response body.
If true, the token will use a longer TTL (7 days) instead of the default session token TTL (1 day).

