Sign in with a username and password
const url = 'https://example.com/api/v1/auth/login';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"username":"example","password":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/auth/login \ --header 'Content-Type: application/json' \ --data '{ "username": "example", "password": "example" }'Starts a session and sets the session cookie. Unknown usernames and wrong passwords get the same response. Repeated failures lock the account for a while, and each client address is rate limited.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Examplegenerated
{ "username": "example", "password": "example"}Responses
Section titled “Responses”Signed in.
object
While true, only GET /me, POST /me/password and POST /auth/logout work.
Examplegenerated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "username": "example", "email": "example", "displayName": "example", "globalAdmin": true, "passwordChangeRequired": true, "createdAt": "2026-04-15T12:00:00Z"}Headers
Section titled “Headers”The session cookie.
The request is invalid.
An RFC 9457 problem with a machine-readable code.
object
Stable machine-readable error code.
Example
{ "type": "about:blank", "title": "Conflict", "status": 409, "code": "conflict"}Not signed in, or the credentials are invalid.
An RFC 9457 problem with a machine-readable code.
object
Stable machine-readable error code.
Example
{ "type": "about:blank", "title": "Conflict", "status": 409, "code": "conflict"}Too many attempts; retry later.
An RFC 9457 problem with a machine-readable code.
object
Stable machine-readable error code.
Example
{ "type": "about:blank", "title": "Conflict", "status": 409, "code": "conflict"}Headers
Section titled “Headers”Seconds to wait.
Shardkeep is free software under the AGPL-3.0. Minecraft is a trademark of Mojang AB; Shardkeep is not affiliated with or endorsed by Mojang or Microsoft.