CrunchDAO auth API

The auth API from CrunchDAO — 6 operation(s) for auth.

OpenAPI Specification

crunchdao-auth-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Tournament activity auth API
  description: CrunchDAO Tournament Platform API Endpoints
  version: v2
servers:
- url: http://api.hub.crunchdao.com
  description: Generated server url
security: []
tags:
- name: auth
paths:
  /v3/auth/register:
    x-service-id: account-service
    post:
      tags:
      - auth
      summary: Create an account.
      operationId: register
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthRegisterForm'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterResult'
  /v3/auth/register/cancel:
    x-service-id: account-service
    post:
      tags:
      - auth
      summary: Cancel the registration.
      operationId: cancelRegistration
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthCancelRegisterForm'
        required: true
      responses:
        '202':
          description: Accepted
  /v3/auth/impersonate:
    x-service-id: account-service
    post:
      tags:
      - auth
      summary: Impersonate a user on the platform only.
      operationId: impersonate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthImpersonateForm'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImpersonateResult'
      security:
      - accessToken: []
      - apiKey: []
  /v3/auth/email-validation:
    x-service-id: account-service
    post:
      tags:
      - auth
      summary: Test if an email is allowed for registration.
      operationId: isEmailValid
      parameters:
      - name: address
        in: query
        required: true
        style: form
        explode: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: boolean
  /v2/auth/random-login:
    x-service-id: account-service
    get:
      tags:
      - auth
      summary: Generate a random login.
      operationId: randomLogin
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
      security:
      - accessToken: []
      - apiKey: []
  /.well-known/jwks.json:
    x-service-id: account-service
    get:
      tags:
      - auth
      summary: Public key to validate the signature of a signed JWT.
      operationId: login
      responses:
        '200':
          description: OK
components:
  schemas:
    AuthImpersonateForm:
      type: object
      properties:
        userId:
          type: integer
          format: int64
      required:
      - userId
    UserRole:
      type: string
      enum:
      - USER
      - MODERATOR
      - ADMINISTRATOR
    ImpersonateResult:
      type: object
      properties:
        accessToken:
          type: string
    QuantClub:
      type: string
      enum:
      - NONE
      - BANDUNG
      - BENGALURU
      - DUBAI
      - LONDON
      - NEW_YORK
      - PARIS
    FullUser:
      type: object
      properties:
        id:
          type: integer
          format: int64
        login:
          type: string
        country:
          type: string
        quantClub:
          $ref: '#/components/schemas/QuantClub'
        deleted:
          type: boolean
        createdAt:
          type: string
          format: date-time
        university:
          type: string
        restriction:
          $ref: '#/components/schemas/UserRestriction'
        role:
          $ref: '#/components/schemas/UserRole'
        ethereumAddress:
          type: string
        solanaAddress:
          type: string
        deletedAt:
          type: string
          format: date-time
        verified:
          type: boolean
        verifiedAt:
          type: string
          format: date-time
        email:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        restricted:
          type: boolean
          deprecated: true
    AuthCancelRegisterForm:
      type: object
      properties:
        authIdToken:
          type: string
      required:
      - authIdToken
    AuthRegisterForm:
      type: object
      properties:
        firstName:
          type: string
          maxLength: 100
          minLength: 1
        lastName:
          type: string
          maxLength: 100
          minLength: 1
        country:
          type: string
          maxLength: 100
          minLength: 0
        authIdToken:
          type: string
      required:
      - authIdToken
      - country
      - firstName
      - lastName
    UserRestriction:
      type: string
      enum:
      - NONE
      - PARTIAL
      - FULL
    RegisterResult:
      type: object
      properties:
        user:
          $ref: '#/components/schemas/FullUser'
  securitySchemes:
    apiKey:
      type: apiKey
      name: apiKey
      in: query
      scheme: token
    accessToken:
      type: http
      in: header
      scheme: Bearer
externalDocs:
  description: docs.crunchdao.com
  url: https://docs.crunchdao.com