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

# Get the enabled auth methods

> Returns the sign-in methods enabled for the environment, so your app can
render only the buttons that will work. Also returns whether the
environment is configured to create a wallet for new users.

Call this before rendering your sign-in screen.




## OpenAPI

````yaml /openapi/authentication-api.yaml get /methods
openapi: 3.1.0
info:
  title: Portal Authentication API
  version: '3.0'
  description: |
    The Portal Authentication API signs in your end users with an email magic
    link, Google, or Apple. A completed sign-in returns a Client Session Token
    that your app uses to create and operate the user's wallet.

    ## Base URL
    `https://api.portalhq.io/api/v3/auth`

    ## Authentication
    These endpoints do not use a Portal API Key or a Client Session Token.
    Identify your environment with the `x-portal-auth-environment-id` header,
    set to the Auth Environment ID shown in the Portal dashboard under
    **Authentication > Configure**.

    Requests are rejected with `401` if the header is missing, if it does not
    match an environment, or if authentication is not enabled for that
    environment.

    ## Response format
    Successful responses are wrapped in a `data` object, alongside a `metadata`
    field that is `null` for every endpoint in this API:

    ```json
    { "data": { "sent": true }, "metadata": null }
    ```

    ## Error responses
    Every authentication failure returns the same generic `401` body, with no
    indication of which check failed. This is deliberate, so a caller cannot
    distinguish an expired token from a forged one. Treat any `401` as "start
    the sign-in flow again".
servers:
  - url: https://api.portalhq.io/api/v3/auth
    description: Production
security:
  - authEnvironmentId: []
tags:
  - name: Auth Methods
    description: Discover which sign-in methods an environment has enabled
  - name: Magic Links
    description: Send and validate email magic links
  - name: OAuth
    description: Sign in with Google or Apple
  - name: Two-Factor Authentication
    description: Validate a time-based one-time password (TOTP) code
paths:
  /methods:
    get:
      tags:
        - Auth Methods
      summary: Get the enabled auth methods
      description: |
        Returns the sign-in methods enabled for the environment, so your app can
        render only the buttons that will work. Also returns whether the
        environment is configured to create a wallet for new users.

        Call this before rendering your sign-in screen.
      operationId: getAuthMethods
      responses:
        '200':
          description: Auth methods retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthMethodsResponse'
              example:
                data:
                  allowedAuthMethods:
                    - EMAIL_MAGIC_LINK
                    - GOOGLE
                    - APPLE
                  autoCreateWallet: true
                metadata: null
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    AuthMethodsResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            allowedAuthMethods:
              type: array
              description: |
                The sign-in methods enabled for this environment. An empty array
                means no method has been enabled yet.
              items:
                $ref: '#/components/schemas/AuthMethod'
            autoCreateWallet:
              type: boolean
              description: |
                Whether this environment is configured to create a wallet for
                newly authenticated users. Portal does not generate the wallet
                itself. Use this as a signal for whether your app should call
                the SDK's wallet creation method after sign-in.
        metadata:
          type:
            - object
            - 'null'
          description: Always `null` for this endpoint.
    AuthMethod:
      type: string
      description: A sign-in method.
      enum:
        - EMAIL_MAGIC_LINK
        - GOOGLE
        - APPLE
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message describing what went wrong
        details:
          type: object
          description: Additional context about the failure, when available
        code:
          type: string
          description: Machine-readable error code, when available
  responses:
    Unauthorized:
      description: |
        Unauthorized. Returned for every authentication failure, with no
        indication of which check failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Unauthorized
  securitySchemes:
    authEnvironmentId:
      type: apiKey
      in: header
      name: x-portal-auth-environment-id
      description: |
        The Auth Environment ID for the environment you are authenticating
        against. Find it in the Portal dashboard under
        **Authentication > Configure**.

````