Amazon Fraud Detector API

The Amazon Fraud Detector API provides programmatic access to create and manage detectors, models, event types, entities, labels, outcomes, rules, and variables for automated fraud detection workflows.

Documentation

Specifications

Examples

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/amazon-fraud-detector/refs/heads/main/json-schema/amazon-fraud-detector-detector-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/amazon-fraud-detector/refs/heads/main/json-schema/amazon-fraud-detector-model-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/amazon-fraud-detector/refs/heads/main/json-schema/amazon-fraud-detector-rule-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/amazon-fraud-detector/refs/heads/main/json-schema/amazon-fraud-detector-event-type-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/amazon-fraud-detector/refs/heads/main/json-schema/amazon-fraud-detector-tag-schema.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/amazon-fraud-detector/refs/heads/main/json-structure/amazon-fraud-detector-detector-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/amazon-fraud-detector/refs/heads/main/json-structure/amazon-fraud-detector-model-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/amazon-fraud-detector/refs/heads/main/json-structure/amazon-fraud-detector-rule-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/amazon-fraud-detector/refs/heads/main/json-structure/amazon-fraud-detector-event-type-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/amazon-fraud-detector/refs/heads/main/json-structure/amazon-fraud-detector-tag-structure.json

Other Resources

OpenAPI Specification

amazon-fraud-detector-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Amazon Fraud Detector API
  description: Amazon Fraud Detector is a fully managed service that uses machine learning to identify potentially fraudulent activities.
  version: '2019-11-15'
  contact:
    name: AWS Support
    url: https://aws.amazon.com/premiumsupport/
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://frauddetector.{region}.amazonaws.com
  variables:
    region:
      default: us-east-1
security:
- awsSigV4: []
tags:
- name: Detectors
  description: Fraud detector configurations
- name: Models
  description: ML model training and versioning
- name: Rules
  description: Business logic rules for fraud decisions
- name: Event Types
  description: Event schema definitions
- name: Predictions
  description: Real-time fraud prediction
- name: Labels
  description: Fraud and legitimate transaction labels
- name: Tags
  description: Resource metadata labels
paths:
  /detectors:
    put:
      operationId: putDetector
      summary: Put Detector
      description: Creates or updates a detector.
      tags:
      - Detectors
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PutDetectorRequest'
      responses:
        '200':
          description: Success
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      operationId: getDetectors
      summary: Get Detectors
      description: Gets all detectors or a single detector if a detectorId is specified.
      tags:
      - Detectors
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                detectorId:
                  type: string
                nextToken:
                  type: string
                maxResults:
                  type: integer
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  detectors:
                    type: array
                    items:
                      $ref: '#/components/schemas/Detector'
                  nextToken:
                    type: string
              examples:
                default:
                  x-microcks-default: true
                  value:
                    detectors:
                    - detectorId: payment-fraud-detector
                      description: Detects payment fraud
                      eventTypeName: transaction
                      arn: arn:aws:frauddetector:us-east-1:123456789012:detector/payment-fraud-detector
                      lastUpdatedTime: '2025-06-01T10:00:00Z'
                      createdTime: '2025-01-01T08:00:00Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /detectors/{detectorId}:
    delete:
      operationId: deleteDetector
      summary: Delete Detector
      description: Deletes the detector. Before deleting a detector, you must first delete all detector versions and rule versions associated with the detector.
      tags:
      - Detectors
      parameters:
      - name: detectorId
        in: path
        required: true
        schema:
          type: string
        description: The ID of the detector to delete.
      responses:
        '200':
          description: Success
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /models:
    put:
      operationId: putModel
      summary: Put Model
      description: Creates or updates a model.
      tags:
      - Models
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PutModelRequest'
      responses:
        '200':
          description: Success
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      operationId: getModels
      summary: Get Models
      description: Gets one or more models.
      tags:
      - Models
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                modelId:
                  type: string
                modelType:
                  type: string
                nextToken:
                  type: string
                maxResults:
                  type: integer
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  models:
                    type: array
                    items:
                      $ref: '#/components/schemas/Model'
                  nextToken:
                    type: string
              examples:
                default:
                  x-microcks-default: true
                  value:
                    models:
                    - modelId: fraud-model-v1
                      modelType: ONLINE_FRAUD_INSIGHTS
                      description: Online fraud ML model
                      eventTypeName: transaction
                      arn: arn:aws:frauddetector:us-east-1:123456789012:model/fraud-model-v1
                      lastUpdatedTime: '2025-06-01T10:00:00Z'
                      createdTime: '2025-01-01T08:00:00Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /rules:
    put:
      operationId: createRule
      summary: Create Rule
      description: Creates a rule for use with the specified detector.
      tags:
      - Rules
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRuleRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  rule:
                    $ref: '#/components/schemas/Rule'
              examples:
                default:
                  x-microcks-default: true
                  value:
                    rule: &id001
                      ruleId: high-risk-rule
                      detectorId: payment-fraud-detector
                      ruleVersion: '1'
                      description: Flag high-risk transactions
                      language: DETECTORPL
                      expression: $model_score > 900
                      outcomes:
                      - high_risk_block
                      arn: arn:aws:frauddetector:us-east-1:123456789012:rule/payment-fraud-detector/high-risk-rule/1
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      operationId: getRules
      summary: Get Rules
      description: Gets all rules for a detector.
      tags:
      - Rules
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                detectorId:
                  type: string
                ruleId:
                  type: string
                ruleVersion:
                  type: string
                nextToken:
                  type: string
                maxResults:
                  type: integer
              required:
              - detectorId
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  ruleDetails:
                    type: array
                    items:
                      $ref: '#/components/schemas/RuleDetail'
                  nextToken:
                    type: string
              examples:
                default:
                  x-microcks-default: true
                  value:
                    ruleDetails:
                    - *id001
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /predictions/event/{eventId}:
    post:
      operationId: getEventPrediction
      summary: Get Event Prediction
      description: Evaluates an event against a detector version and returns prediction outcomes.
      tags:
      - Predictions
      parameters:
      - name: eventId
        in: path
        required: true
        schema:
          type: string
        description: The unique ID of the event.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetEventPredictionRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEventPredictionResponse'
              examples:
                default:
                  x-microcks-default: true
                  value:
                    modelScores:
                    - modelVersion:
                        modelId: fraud-model-v1
                        modelType: ONLINE_FRAUD_INSIGHTS
                        modelVersionNumber: '1.0'
                      scores:
                        model_score: 850.0
                    ruleResults:
                    - ruleId: high-risk-rule
                      outcomes:
                      - review
                    externalModelOutputs: []
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /event-types:
    put:
      operationId: putEventType
      summary: Put Event Type
      description: Creates or updates an event type.
      tags:
      - Event Types
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PutEventTypeRequest'
      responses:
        '200':
          description: Success
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      operationId: getEventTypes
      summary: Get Event Types
      description: Gets all event types or a specific event type if a name is provided.
      tags:
      - Event Types
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                nextToken:
                  type: string
                maxResults:
                  type: integer
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  eventTypes:
                    type: array
                    items:
                      $ref: '#/components/schemas/EventType'
                  nextToken:
                    type: string
              examples:
                default:
                  x-microcks-default: true
                  value:
                    eventTypes:
                    - name: transaction
                      description: Payment transaction event
                      eventVariables:
                      - transaction_amount
                      - ip_address
                      - email
                      labels:
                      - fraud
                      - legit
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /labels:
    put:
      operationId: putLabel
      summary: Put Label
      description: Creates or updates label. A label classifies an event as fraudulent or legitimate.
      tags:
      - Labels
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                description:
                  type: string
                tags:
                  type: array
                  items:
                    $ref: '#/components/schemas/Tag'
              required:
              - name
      responses:
        '200':
          description: Success
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /tags/{resourceARN}:
    get:
      operationId: listTagsForResource
      summary: List Tags For Resource
      description: Lists all tags associated with the resource.
      tags:
      - Tags
      parameters:
      - name: resourceARN
        in: path
        required: true
        schema:
          type: string
        description: The ARN of the resource.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  tags:
                    type: array
                    items:
                      $ref: '#/components/schemas/Tag'
                  nextToken:
                    type: string
              examples:
                default:
                  x-microcks-default: true
                  value:
                    tags:
                    - key: Environment
                      value: Production
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      operationId: tagResource
      summary: Tag Resource
      description: Assigns tags to a resource.
      tags:
      - Tags
      parameters:
      - name: resourceARN
        in: path
        required: true
        schema:
          type: string
        description: The ARN of the resource.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                tags:
                  type: array
                  items:
                    $ref: '#/components/schemas/Tag'
              required:
              - tags
      responses:
        '200':
          description: Success
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  securitySchemes:
    awsSigV4:
      type: apiKey
      in: header
      name: Authorization
      description: AWS Signature Version 4
  schemas:
    Detector:
      type: object
      description: An Amazon Fraud Detector detector that orchestrates ML models and rules for fraud decisions.
      properties:
        detectorId:
          type: string
        description:
          type: string
        eventTypeName:
          type: string
        lastUpdatedTime:
          type: string
          format: date-time
        createdTime:
          type: string
          format: date-time
        arn:
          type: string
      required:
      - detectorId
      - eventTypeName
    Model:
      type: object
      description: An Amazon Fraud Detector ML model trained on labeled transaction data.
      properties:
        modelId:
          type: string
        modelType:
          type: string
          enum:
          - ONLINE_FRAUD_INSIGHTS
          - TRANSACTION_FRAUD_INSIGHTS
          - ACCOUNT_TAKEOVER_INSIGHTS
        description:
          type: string
        eventTypeName:
          type: string
        lastUpdatedTime:
          type: string
          format: date-time
        createdTime:
          type: string
          format: date-time
        arn:
          type: string
      required:
      - modelId
      - modelType
      - eventTypeName
    Rule:
      type: object
      description: A rule specifying conditions and outcomes for fraud detection decisions.
      properties:
        ruleId:
          type: string
        detectorId:
          type: string
        ruleVersion:
          type: string
        description:
          type: string
        language:
          type: string
          enum:
          - DETECTORPL
        expression:
          type: string
        outcomes:
          type: array
          items:
            type: string
        arn:
          type: string
      required:
      - ruleId
      - detectorId
      - expression
      - language
      - outcomes
    RuleDetail:
      type: object
      description: Detailed information about a Fraud Detector rule.
      properties:
        ruleId:
          type: string
        description:
          type: string
        detectorId:
          type: string
        ruleVersion:
          type: string
        expression:
          type: string
        language:
          type: string
        outcomes:
          type: array
          items:
            type: string
        lastUpdatedTime:
          type: string
          format: date-time
        createdTime:
          type: string
          format: date-time
        arn:
          type: string
    EventType:
      type: object
      description: A schema defining the structure of events analyzed by a Fraud Detector.
      properties:
        name:
          type: string
        description:
          type: string
        eventVariables:
          type: array
          items:
            type: string
        labels:
          type: array
          items:
            type: string
        entityTypes:
          type: array
          items:
            type: string
        eventIngestion:
          type: string
          enum:
          - ENABLED
          - DISABLED
        lastUpdatedTime:
          type: string
          format: date-time
        createdTime:
          type: string
          format: date-time
        arn:
          type: string
      required:
      - name
      - eventVariables
      - labels
      - entityTypes
    Tag:
      type: object
      description: A metadata label applied to a Fraud Detector resource.
      properties:
        key:
          type: string
        value:
          type: string
      required:
      - key
      - value
    ErrorResponse:
      type: object
      description: Standard error response from the Amazon Fraud Detector API.
      properties:
        message:
          type: string
        code:
          type: string
    PutDetectorRequest:
      type: object
      required:
      - detectorId
      - eventTypeName
      properties:
        detectorId:
          type: string
        description:
          type: string
        eventTypeName:
          type: string
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
    PutModelRequest:
      type: object
      required:
      - modelId
      - modelType
      - eventTypeName
      properties:
        modelId:
          type: string
        modelType:
          type: string
        description:
          type: string
        eventTypeName:
          type: string
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
    CreateRuleRequest:
      type: object
      required:
      - ruleId
      - detectorId
      - expression
      - language
      - outcomes
      properties:
        ruleId:
          type: string
        detectorId:
          type: string
        description:
          type: string
        expression:
          type: string
        language:
          type: string
        outcomes:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
    GetEventPredictionRequest:
      type: object
      required:
      - detectorId
      - eventId
      - eventTypeName
      - eventTimestamp
      - entities
      - eventVariables
      properties:
        detectorId:
          type: string
        detectorVersionId:
          type: string
        eventId:
          type: string
        eventTypeName:
          type: string
        eventTimestamp:
          type: string
        entities:
          type: array
          items:
            type: object
        eventVariables:
          type: object
          additionalProperties:
            type: string
    GetEventPredictionResponse:
      type: object
      properties:
        modelScores:
          type: array
          items:
            type: object
        ruleResults:
          type: array
          items:
            type: object
        externalModelOutputs:
          type: array
          items:
            type: object
    PutEventTypeRequest:
      type: object
      required:
      - name
      - eventVariables
      - labels
      - entityTypes
      properties:
        name:
          type: string
        description:
          type: string
        eventVariables:
          type: array
          items:
            type: string
        labels:
          type: array
          items:
            type: string
        entityTypes:
          type: array
          items:
            type: string
        eventIngestion:
          type: string
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'