Dev's NoxDev's Nox
Auth

Login

Authenticate with credentials and return a session token.

POST
/api/auth/login

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://loading/api/auth/login" \  -H "Content-Type: application/json" \  -d '{    "identifier": "johndoe",    "password": "secret123"  }'
{
  "data": {
    "token": "tok_abc123",
    "expires": 1712000000000,
    "created_at": 1680000000000,
    "user": {
      "id": 1,
      "username": "johndoe",
      "display": "John Doe",
      "bio": "Full-stack developer",
      "pronoun": "he/him",
      "server": "my-server.com",
      "tags": [],
      "thumbnail": "https://cdn.my-server.com/thumb.png",
      "banner": null,
      "theme": 3435986943,
      "links": [
        {
          "label": "GitHub",
          "value": "https://github.com/johndoe"
        }
      ],
      "relations": {
        "out": "follow",
        "in": null
      },
      "public": "MCow...==",
      "followers": 42,
      "following": 17,
      "presence": {
        "status": "online",
        "text": "In a meeting",
        "locations": [
          "42@example.com"
        ]
      },
      "alias": [
        {
          "key": "iid",
          "value": "1@my-server.com"
        }
      ],
      "email": "john@example.com",
      "methods": {
        "email": "verified",
        "totp": "disabled",
        "passkey": "enabled"
      },
      "created_at": 1680000000000,
      "home": null,
      "avatar": null
    }
  },
  "error": null,
  "time": 1680000000000,
  "request": "/api/endpoint"
}
{
  "data": null,
  "error": {
    "code": "NOT_FOUND",
    "message": "Resource not found.",
    "status": 404
  },
  "time": 1680000000000,
  "request": "/api/endpoint"
}
{
  "data": null,
  "error": {
    "code": "NOT_FOUND",
    "message": "Resource not found.",
    "status": 404
  },
  "time": 1680000000000,
  "request": "/api/endpoint"
}
{
  "data": null,
  "error": {
    "code": "NOT_FOUND",
    "message": "Resource not found.",
    "status": 404
  },
  "time": 1680000000000,
  "request": "/api/endpoint"
}