> ## Documentation Index
> Fetch the complete documentation index at: https://docs.truscan.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Sign in

> A wrong password and a non-existent account return the same 401, and take the same time, so this endpoint cannot be used to discover which addresses are registered.



## OpenAPI

````yaml /api-reference/auth.json post /api/auth/signin
openapi: 3.1.0
info:
  title: truscan auth
  version: 1.0.0
  description: >-
    Identity: accounts, sessions, password resets and API keys.


    This is the only service that verifies a credential, because it is the
    service that issues them. Every other service decodes the identity the edge
    already verified.


    Protected routes accept either credential, a dashboard session JWT or an
    `tru_` API key, on the same path. There is no key-only variant of any route.
servers:
  - url: https://api.truscan.co
    description: Production
security: []
tags:
  - name: session
    description: Sign up, sign in, password reset
  - name: keys
    description: API key management
paths:
  /api/auth/signin:
    post:
      tags:
        - session
      summary: Sign in
      description: >-
        A wrong password and a non-existent account return the same 401, and
        take the same time, so this endpoint cannot be used to discover which
        addresses are registered.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Credentials'
      responses:
        '200':
          $ref: '#/components/responses/Session'
        '401':
          description: The email and password do not match.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Failure'
        '403':
          description: The account is suspended.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Failure'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    Credentials:
      type: object
      required:
        - email
        - password
      properties:
        email:
          type: string
          format: email
          maxLength: 254
        password:
          type: string
          minLength: 8
          maxLength: 72
          description: Capped at 72 bytes because bcrypt silently truncates beyond that.
    Failure:
      type: object
      required:
        - success
        - result
        - message
      properties:
        success:
          type: boolean
          const: false
        result:
          type: object
          properties:
            code:
              type: string
        message:
          type: string
          description: Written for a person. Safe to show as-is.
    Envelope:
      type: object
      required:
        - success
        - result
        - message
      properties:
        success:
          type: boolean
        result: {}
        message:
          type: string
    Session:
      type: object
      properties:
        token:
          type: string
          description: A signed JWT.
        expires_at:
          type: string
          format: date-time
        user:
          $ref: '#/components/schemas/User'
    User:
      type: object
      properties:
        id:
          type: string
          examples:
            - usr_9f2c1a7b3e4d5f6a7b8c9d0e
        email:
          type: string
          format: email
        plan:
          type: string
          examples:
            - free
        created_at:
          type: string
          format: date-time
  responses:
    Session:
      description: A signed-in session.
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Envelope'
            properties:
              result:
                $ref: '#/components/schemas/Session'
    RateLimited:
      description: Too many attempts. On this surface the limit is a brute-force control.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Failure'

````