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

# Register a new user account

> **System Function**: Creates a new user account in the DeFindex platform. 
    This endpoint allows new users to register for access to the DeFindex API. Upon successful registration, users receive authentication credentials that enable them to access protected endpoints and manage their DeFi investments.



## OpenAPI

````yaml POST /register
openapi: 3.0.0
info:
  title: DeFindex API
  description: >-
    Yield infrastructure for neobanks, fintechs and wallets.


    **Base URL:** `https://api.defindex.io`. Every route takes
    `?network=mainnet` (the default) or `?network=testnet`.


    **Auth:** send your API key as `Authorization: Bearer sk_...` (the console
    uses the JWT access token from `POST /login` the same way). Each operation's
    `security` says whether it needs one; `security: []` means it is public.

    - `401`: no credential, or an invalid API key. The body has a `code`
    (`MISSING_CREDENTIAL` or `INVALID_API_KEY`) and a `registerUrl` where you
    get a key, and `WWW-Authenticate` is set.

    - `403`: an expired or invalid JWT, or a valid credential without the
    required role.


    **Rate limits:** a token bucket per account (requests without a key are
    tracked by IP). Responses carry `X-RateLimit-Limit`, `X-RateLimit-Remaining`
    and `X-RateLimit-Reset` (seconds until the bucket is full). A `429` also
    carries `Retry-After` and `retryAfter` in the body.


    | Tier | Burst | Sustained |

    |---|---|---|

    | FREE | 5 | 1/s |

    | STARTER | 20 | 10/s |

    | PROFESSIONAL | 100 | 50/s |

    | BUSINESS | 200 | 100/s |


    **Units:**

    - Amounts are integers in the asset's smallest unit (7 decimals for every
    asset DeFindex lists today: 1 USDC = `10000000`). Responses send them as
    strings; request bodies take JSON integers.

    - Vault shares (dfTokens) are not underlying: `GET /vault/{address}/balance`
    returns both. The share price rises, so the underlying value of a position
    is not what was deposited.

    - Multi-asset vaults take one amount per vault asset, in the order of
    `assets` in `GET /vault/{address}`.

    - Vault `apy` is a percentage (`8.75` = 8.75%). `/strategies`
    `apy7d`/`apy30d`/`apyAllTime` are fractions (`0.0641` = 6.41%).

    - Fees are basis points (`10000` = 100%).


    **Writes never move funds by themselves.** Each write returns an unsigned
    transaction (`xdr`) for the `caller`. Sign it and submit it with `POST
    /send` (or your own RPC). `POST /send` is idempotent: resubmitting the same
    signed XDR returns the original result.
  version: 1.0.0
  contact: {}
  x-logo:
    url: https://links.paltalabs.io/defindex-full.svg
    backgroundColor: '#0e0e0e'
    altText: DeFindex Logo
    href: https://defindex.io
servers: []
security: []
tags: []
paths:
  /register:
    post:
      tags:
        - Auth
      summary: Register a new user account
      description: >-
        **System Function**: Creates a new user account in the DeFindex
        platform. 
            This endpoint allows new users to register for access to the DeFindex API. The email is stored trimmed and lowercased, and disposable domains are refused. When `GET /auth/config` has a Turnstile site key, `turnstileToken` is required too. `acceptTerms: true` is required and accepts the [terms](https://www.defindex.io/terms). Only `username`, `email`, `password`, `acceptTerms` and `turnstileToken` are read; any other field is ignored. The account is created enabled, with role USER, and a 6-digit PIN is emailed to verify the address (POST /auth/email/verify).
      operationId: AuthController_register
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthRegisterDto'
      responses:
        '201':
          description: User registered successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Confirmation message indicating successful registration
                example:
                  message: User defi_investor registered
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            x-correlation-id:
              $ref: '#/components/headers/x-correlation-id'
        '400':
          description: >-
            Invalid input: malformed or disposable email, username outside its
            rules, a password under 15 characters or over 72 bytes (UTF-8), a
            missing or refused Turnstile token, or acceptTerms missing or not
            true
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            x-correlation-id:
              $ref: '#/components/headers/x-correlation-id'
        '409':
          description: >-
            User already exists (email or username taken, including the same
            email in another case)
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            x-correlation-id:
              $ref: '#/components/headers/x-correlation-id'
        '429':
          description: Too many sign-ups from this address. See Retry-After.
          headers:
            Retry-After:
              description: Seconds until the next request is allowed.
              schema:
                type: integer
                example: 1
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            x-correlation-id:
              $ref: '#/components/headers/x-correlation-id'
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 429
                  message:
                    type: string
                    example: Rate limit exceeded
                  error:
                    type: string
                    example: Too Many Requests
                  retryAfter:
                    type: integer
                    example: 1
              example:
                statusCode: 429
                message: Rate limit exceeded
                error: Too Many Requests
                retryAfter: 1
        '503':
          description: The security check could not run. Try again.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            x-correlation-id:
              $ref: '#/components/headers/x-correlation-id'
      security: []
components:
  schemas:
    AuthRegisterDto:
      type: object
      properties:
        accountType:
          type: string
          enum:
            - COMPANY
            - INDIVIDUAL
          nullable: true
          example: COMPANY
        companyName:
          type: string
          maxLength: 120
          nullable: true
          example: Acme
        legalName:
          type: string
          description: As on invoices
          maxLength: 160
          nullable: true
          example: Acme S.A.
        country:
          type: string
          description: ISO 3166-1 alpha-2 code, stored uppercase
          nullable: true
          example: CL
        website:
          type: string
          description: An http or https URL, scheme included
          maxLength: 255
          nullable: true
          example: https://acme.com
        segment:
          type: string
          enum:
            - WALLET
            - EXCHANGE
            - FINTECH
            - PAYMENTS
            - DEFI
            - TRADING_BOT
            - AI_AGENT
            - OTHER
          nullable: true
          example: WALLET
        telegram:
          type: string
          description: >-
            Telegram username, with or without the leading @ (stored without
            it): 5 to 32 letters, digits or `_`, starting with a letter
          nullable: true
          example: acme_ops
        username:
          type: string
          description: >-
            Username: 3 to 32 letters, digits, `.`, `_` or `-`, with single
            spaces between words
          example: defi_investor
          minLength: 3
          maxLength: 32
        password:
          type: string
          description: 'Password: at least 15 characters and at most 72 bytes in UTF-8'
          example: SecurePassword123!
          minLength: 15
        email:
          type: string
          description: >-
            Email address. Stored trimmed and lowercased; disposable domains are
            refused.
          example: user@example.com
          maxLength: 254
        acceptTerms:
          type: boolean
          description: >-
            Must be true: the new account accepts the terms at
            https://www.defindex.io/terms
          example: true
        turnstileToken:
          type: string
          description: >-
            Cloudflare Turnstile token. Required when GET /auth/config has a
            site key.
      required:
        - username
        - password
        - email
        - acceptTerms
  headers:
    X-RateLimit-Limit:
      description: 'Bucket size for your tier: the most requests you can burst.'
      schema:
        type: integer
        example: 5
    X-RateLimit-Remaining:
      description: Requests left in the bucket right now.
      schema:
        type: integer
        example: 4
    X-RateLimit-Reset:
      description: >-
        Seconds (not a timestamp) until the bucket is full again. On a 429,
        seconds until the next request is allowed.
      schema:
        type: integer
        example: 1
    x-correlation-id:
      description: >-
        Request ID. Send your own `x-correlation-id` to have it echoed back;
        quote it when you report a problem.
      schema:
        type: string
        example: 454a42d5-0166-40fe-a4ad-32e77aa44962

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.