---
title: "Login using this route."
method: POST
path: "/v3/sessions/"
tags: ["sessions"]
---

# Login using this route.

`POST /v3/sessions/`

## Description
This will return a token that can be used in the Authentication header in the
form "Session-Token <your_token>" on authenticated requests.<br>
The token is valid for 30min, but if you make an authenticated request
with it, it will be renewed for the next 30min.

##  Rate limits
Maximum 5 requests per 300 seconds<br>

## Request body

- object
  - `create_social_member` boolean — If true, and the user logging in does not have an associated social member,this call will also take care of creating the social member for this user
  - `password` string, required — Your account password
  - `remember` boolean — True if the client wants Smarkets to allow this device to renew the token even after its expiration
  - `reopen_account` boolean — If true, and the user has closed their own account,then their account will be reopened and they will log in as normal.
  - `use_auth_v2` boolean — If true, and the user logging will be forced to use auth v2,and should expect refresh_token and access_token in the cookies and response
  - `username` string, email, required — Your username

## Response `201`

Token response for old and new auth v2.

- union — Token response for old and new auth v2.
  - object — Token response
    - `created_social_member` boolean
    - `factor` 'complete' | 'totp' | 'nemid' — Next factor for authentication to complete, used in multi factor authentication: <ul> <li>complete: Login is complete and there is no further factor required. <li>totp: Login is incomplete and needs the totp code. <li>nemid: Login is incomplete and needs nemid confirmation.<li> </ul>
    - `nemid_session_id` string — Session id for Denmark nemid authorization
    - `redirect_url` string — Redirect url to complete nemid authorization flow
    - `stop` string, date-time, nullable, required — This datetime specifies when the token will expire if not renewed.<br> Any authenticated API call will automatically renew the token for another 30min<br>
    - `token` string, nullable, required — This session token can be used to make authenticated requests to Smarkets.<br> We will resolve the who the user is based on this.<br> Account information, orders, up-to-date prices are examples that will require it to be sent.
    - `verify` boolean — True if further verification is required
  - object — Token response for auth v2
    - `created_social_member` boolean
    - `factor` 'complete' | 'totp' | 'nemid' — Next factor for authentication to complete, used in multi factor authentication: <ul> <li>complete: Login is complete and there is no further factor required. <li>totp: Login is incomplete and needs the totp code. <li>nemid: Login is incomplete and needs nemid confirmation.<li> </ul>
    - `refresh_token` string, required — This refresh token can be used to generate an access token.
    - `stop` string, date-time, nullable, required — This datetime specifies when the token will expire if not renewed.<br> Any authenticated API call will automatically renew the token for another 30min<br>
    - `token` string, required — This Access token can be used to make authenticated requests to Smarkets.<br> We will resolve the who the user is based on this.<br> Account information, orders, up-to-date prices are examples that will require it to be sent.
    - `verify` boolean — True if further verification is required

## Other responses

- `400` — INVALID_DEVICE_COOKIE, REQUEST_VALIDATION_ERROR
- `401` — INVALID_CREDENTIALS, PASSWORD_RESET_NEEDED
- `403` — USER_SELF_SUSPENDED, SOURCE_BLOCKED, LOGIN_VERIFICATION_REQUIRED, USER_SUSPENDED, USER_ON_TIMEOUT, SESSION_LIMIT_REACHED, USER_EXCLUDED, CLIENT_JURISDICTION_MISMATCH, IP_NOT_TRUSTED, DEVICE_NOT_TRUSTED
- `429` — RATE_LIMIT_EXCEEDED
- `451` — COUNTRY_BLOCKED
- `500` — Internal server error
- `503` — AUTH_UNAVAILABLE, TIMEOUT

---

[API](https://skmtc.dev/smarkets/apis/smarkets-http-api.md) · [All operations](https://skmtc.dev/smarkets/apis/smarkets-http-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/smarkets/smarkets-http-api/revisions/75f7e3050340/schema)
