---
agentTools:
  projectIndex: https://lemmy.readme.io/llms.txt
---

# Log into lemmy.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Unofficial Lemmy OpenAPI Documentation",
    "version": "v0.19.3",
    "license": {
      "name": "AGPLv3",
      "url": "https://www.gnu.org/licenses/agpl-3.0.en.html#license-text"
    },
    "x-logo": {
      "url": "https://raw.githubusercontent.com/LemmyNet/lemmy-ui/main/src/assets/icons/favicon.svg",
      "altText": "Lemmy Icon",
      "href": "https://github.com/MV-GH/lemmy_openapi_spec"
    },
    "contact": {
      "url": "https://github.com/MV-GH/lemmy_openapi_spec"
    }
  },
  "servers": [
    {
      "url": "https://lemmy.ml/api/v3"
    },
    {
      "url": "https://enterprise.lemmy.ml/api/v3"
    },
    {
      "url": "https://ds9.lemmy.ml/api/v3"
    },
    {
      "url": "https://voyager.lemmy.ml/api/v3"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    },
    {
      "cookieAuth": []
    }
  ],
  "paths": {
    "/user/login": {
      "post": {
        "tags": [
          "User"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Login"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "CREATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponse"
                }
              }
            }
          },
          "400": {
            "description": "BAD REQUEST",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponseLogin"
                }
              }
            }
          }
        },
        "summary": "Log into lemmy."
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "cookieAuth": {
        "type": "apiKey",
        "in": "cookie",
        "name": "auth"
      }
    },
    "schemas": {
      "errorResponseLogin": {
        "properties": {
          "error": {
            "type": "string",
            "enum": [
              "incorrect_login",
              "email_not_verified",
              "registration_denied",
              "registration_application_pending",
              "registration_application_is_pending",
              "missing_totp_token",
              "incorrect_totp_token"
            ]
          }
        }
      },
      "LoginResponse": {
        "properties": {
          "jwt": {
            "title": "LoginResponse.jwt",
            "type": "string"
          },
          "registration_created": {
            "title": "LoginResponse.registration_created",
            "type": "boolean"
          },
          "verify_email_sent": {
            "title": "LoginResponse.verify_email_sent",
            "type": "boolean"
          }
        },
        "required": [
          "registration_created",
          "verify_email_sent"
        ],
        "additionalProperties": false,
        "title": "LoginResponse",
        "type": "object"
      },
      "Login": {
        "properties": {
          "username_or_email": {
            "title": "Login.username_or_email",
            "type": "string"
          },
          "password": {
            "title": "Login.password",
            "type": "string"
          },
          "totp_2fa_token": {
            "title": "Login.totp_2fa_token",
            "type": "string"
          }
        },
        "required": [
          "username_or_email",
          "password"
        ],
        "additionalProperties": false,
        "title": "Login",
        "type": "object"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 101,
      "1": 74,
      "2": 98,
      "3": 186,
      "4": 26,
      "5": 20,
      "6": 16,
      "7": 0,
      "8": 13,
      "9": 68,
      "10": 55,
      "11": 44
    }
  }
}
```