Dream Sports User Flow Block API

The User Flow Block API from Dream Sports — 3 operation(s) for user flow block.

OpenAPI Specification

dream-sports-user-flow-block-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Guardian User Flow Block API
  version: 1.0.0
tags:
- name: User Flow Block
paths:
  /v1/user/flow/block:
    post:
      tags:
      - User Flow Block
      summary: Block user flows
      description: "API to block specific authentication flows for a user identifier (email/phone/username). \nThis prevents the user from using the specified authentication methods.\n\nSupported flow types:\n- passwordless: Blocks passwordless authentication flows\n- password: Blocks username/password authentication flows  \n- social_auth: Blocks social authentication flows (Facebook, Google)\n- otp_verify: Blocks OTP verification flows\n"
      parameters:
      - $ref: '#/components/parameters/TenantIdHeader'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V1BlockUserFlowRequestBody'
        required: true
      responses:
        '204':
          description: User flows blocked successfully
        '400':
          description: Bad Request due to missing parameters or invalid data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/user/flow/unblock:
    post:
      tags:
      - User Flow Block
      summary: Unblock user flows
      description: 'API to unblock previously blocked authentication flows for a user identifier.

        This allows the user to use the specified authentication methods again.

        For password/PIN block (wrong attempts from signin or MFA signin), use unblockFlows

        ["password"] and/or ["pin"] to unblock. user_identifier must be the username, email, or

        phone number (the identifier used when signing in) for password/PIN blocks. Lifts the

        block before the block interval expires (e.g. after reset).

        '
      parameters:
      - $ref: '#/components/parameters/TenantIdHeader'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V1UnblockUserFlowRequestBody'
        required: true
      responses:
        '204':
          description: User flows unblocked successfully
        '400':
          description: Bad Request due to missing parameters or invalid data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/user/flow/blocked:
    get:
      tags:
      - User Flow Block
      summary: Get blocked flows for a user
      description: 'API to retrieve all currently blocked authentication flows for a specific user identifier.

        Returns the list of flow types that are currently blocked for the user.

        '
      parameters:
      - $ref: '#/components/parameters/TenantIdHeader'
      - name: userIdentifier
        in: query
        description: User identifier (email, phone number, username)
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Blocked flows retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1UserBlockedFlowsResponse'
        '400':
          description: Bad Request due to missing parameters or invalid data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    V1UserBlockedFlowsResponse:
      type: object
      properties:
        userIdentifier:
          type: string
          description: User identifier
          example: user@example.com
        blockedFlows:
          type: array
          items:
            type: string
            enum:
            - passwordless
            - password
            - social_auth
            - otp_verify
            - pin
          description: List of currently blocked flow types
          example:
          - passwordless
          - password
        totalCount:
          type: integer
          description: Total number of blocked flows
          example: 2
      example:
        userIdentifier: user@example.com
        blockedFlows:
        - passwordless
        - social_auth
        totalCount: 2
    V1BlockUserFlowRequestBody:
      type: object
      required:
      - userIdentifier
      - blockFlows
      - reason
      - unblockedAt
      properties:
        userIdentifier:
          type: string
          description: User identifier (email, phone number, username)
          example: user@example.com
        blockFlows:
          type: array
          items:
            type: string
            enum:
            - passwordless
            - password
            - social_auth
            - otp_verify
          description: List of flow types to block
          example:
          - passwordless
          - social_auth
        reason:
          type: string
          description: Reason for blocking the flows
          example: Suspicious activity detected
        unblockedAt:
          type: integer
          format: int64
          description: Unix timestamp when the block should automatically expire(epoch)
          example: 1704067200
      example:
        userIdentifier: user@example.com
        blockFlows:
        - passwordless
        - social_auth
        reason: Suspicious activity detected
        unblockedAt: 1704067200
    V1UnblockUserFlowRequestBody:
      type: object
      required:
      - userIdentifier
      - unblockFlows
      properties:
        userIdentifier:
          type: string
          description: User identifier (email, phone number, username)
          example: user@example.com
        unblockFlows:
          type: array
          items:
            type: string
            enum:
            - passwordless
            - password
            - social_auth
            - otp_verify
            - pin
          description: 'List of flow types to unblock. Use "password" or "pin" to unblock when

            blocked due to wrong attempts (user_identifier must be username, email, or phone).

            '
          example:
          - password
          - pin
      example:
        userIdentifier: john@example.com
        unblockFlows:
        - password
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code identifying the type of error
              example: invalid_request
            message:
              type: string
              description: Human-readable error message
              example: Something went wrong.
  parameters:
    TenantIdHeader:
      name: tenant-id
      in: header
      description: tenant-id of the client integrating with guardian
      required: true
      schema:
        type: string