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

# create entity



## OpenAPI

````yaml /openapi.json post /api/v1/trigger
openapi: 3.0.3
info:
  title: Extractor Project (dev)
  version: 0.0.649
servers: []
security: []
paths:
  /api/v1/trigger:
    post:
      tags:
        - Trigger Route
      summary: create entity
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTriggerDto'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TriggerDto'
      security:
        - SecurityScheme: []
components:
  schemas:
    CreateTriggerDto:
      required:
        - contractId
        - type
      type: object
      properties:
        status:
          description: 'Status of the entity. Default: ''ACTIVE'''
          type: string
          allOf:
            - $ref: '#/components/schemas/Status'
        alerts:
          description: List of alerts associated with the entry
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/CreateAlertDto'
        contractId:
          format: int64
          description: Unique identifier of the contract
          type: integer
        type:
          description: Type of the trigger
          type: string
          allOf:
            - $ref: '#/components/schemas/TriggerType'
        name:
          description: Name of the trigger
          type: string
        config:
          description: >
            Configuration details for the trigger. Examples by type:

            <br>

            ERC20_TRANSFER:
            {"token":"0xdac17f958d2ee523a2206206994597c13d831ec7","funcName":"Transfer","params":[{"name":"from","operator":"==","value":"0xd6dfD811E06267b25472753c4e57C0B28652bFB8"},{"name":"to","operator":"==","value":"0x3018018c44338b9728d02be12d632c6691e020d1"},{"name":"value","operator":">","value":"249000000"}]}

            <br>

            BLACKLISTED_CALLERS:
            {"blacklist":["0xd6dfD811E06267b25472753c4e57C0B28652bFB8","0x3018018c44338b9728d02be12d632c6691e020d1","0xd06678bc9550333b7832b7900cb7bca5cecbf787"]}

            <br>

            WHITELIST_CALLERS:
            {"whitelist":["0xd6dfD811E06267b25472753c4e57C0B28652bFB8","0x3018018c44338b9728d02be12d632c6691e020d1","0xd06678bc9550333b7832b7900cb7bca5cecbf787"]}

            <br>

            FAILED_TRANSACTIONS: {} or null

            <br>

            FUNCTION_CALL:
            {"funcName":"approve","params":[{"name":"_spender","operator":"==","value":"0x3018018c44338b9728d02be12d632c6691e020d1"},{"name":"_value","operator":">","value":"10"},{"name":"_value","operator":">","value":"1000"},{"name":"_value","operator":">","value":"1000000"}],"txParams":{"param":{"name":"value","operator":">","value":"100"}}}

            <br>

            EVENT_EMITTED:
            {"funcName":"Approval","params":[{"name":"owner","operator":"==","value":"0xd06678bc9550333b7832b7900cb7bca5cecbf787"},{"name":"spender","operator":"==","value":"0x3018018c44338b9728d02be12d632c6691e020d1"},{"name":"value","operator":">","value":"10"},{"name":"value","operator":">","value":"1000"},{"name":"value","operator":">","value":"1000000"}]}

            <br>

            TRANSACTION_PARAMS:
            {"operator":"AND","params":[{"operator":"OR","params":[{"param":{"name":"from_address","operator":"==","value":"or1"}},{"param":{"name":"receipt_status","operator":">","value":"1"}}]},{"param":{"name":"value","operator":"<=","value":"1000"}},{"param":{"name":"block.miner","operator":"!=","value":"qweqwe"}}]}
          type: object
          additionalProperties: {}
          example:
            blacklist:
              - '0xd6dfD811E06267b25472753c4e57C0B28652bFB8'
        actions:
          description: Action that should be executed by the user for this trigger
          type: array
          items:
            type: string
          example:
            - PAUSE
        txParams:
          description: >-
            Optional. Transaction-level filter config. Will be merged into
            config.txParams and persisted.
          type: object
          additionalProperties: {}
    TriggerDto:
      type: object
      properties:
        id:
          format: int64
          description: Unique identifier of the entity
          type: integer
          example: 1
        createdAt:
          format: int64
          description: Time when entity was created
          type: integer
        updatedAt:
          format: int64
          description: Time when entity was updated
          type: integer
        status:
          description: 'Status of the entity. Default: ''ACTIVE'''
          type: string
          allOf:
            - $ref: '#/components/schemas/Status'
        contractId:
          format: int64
          description: Unique identifier of the contract
          type: integer
        interceptorId:
          format: int64
          description: Unique identifier of the interceptor from haas-interceptor service
          type: integer
        type:
          description: Type of the trigger
          type: string
          allOf:
            - $ref: '#/components/schemas/TriggerType'
        name:
          description: Name of the trigger
          type: string
        config:
          description: >
            Configuration details for the trigger. Examples by type:

            <br>

            ERC20_TRANSFER:
            {"token":"0xdac17f958d2ee523a2206206994597c13d831ec7","funcName":"Transfer","params":[{"name":"from","operator":"==","value":"0xd6dfD811E06267b25472753c4e57C0B28652bFB8"},{"name":"to","operator":"==","value":"0x3018018c44338b9728d02be12d632c6691e020d1"},{"name":"value","operator":">","value":"249000000"}]}

            <br>

            BLACKLISTED_CALLERS:
            {"blacklist":["0xd6dfD811E06267b25472753c4e57C0B28652bFB8","0x3018018c44338b9728d02be12d632c6691e020d1","0xd06678bc9550333b7832b7900cb7bca5cecbf787"]}

            <br>

            WHITELIST_CALLERS:
            {"whitelist":["0xd6dfD811E06267b25472753c4e57C0B28652bFB8","0x3018018c44338b9728d02be12d632c6691e020d1","0xd06678bc9550333b7832b7900cb7bca5cecbf787"]}

            <br>

            FAILED_TRANSACTIONS: {} or null

            <br>

            FUNCTION_CALL:
            {"funcName":"approve","params":[{"name":"_spender","operator":"==","value":"0x3018018c44338b9728d02be12d632c6691e020d1"},{"name":"_value","operator":">","value":"10"},{"name":"_value","operator":">","value":"1000"},{"name":"_value","operator":">","value":"1000000"}],"txParams":{"param":{"name":"value","operator":">","value":"100"}}}

            <br>

            EVENT_EMITTED:
            {"funcName":"Approval","params":[{"name":"owner","operator":"==","value":"0xd06678bc9550333b7832b7900cb7bca5cecbf787"},{"name":"spender","operator":"==","value":"0x3018018c44338b9728d02be12d632c6691e020d1"},{"name":"value","operator":">","value":"10"},{"name":"value","operator":">","value":"1000"},{"name":"value","operator":">","value":"1000000"}]}

            <br>

            TRANSACTION_PARAMS:
            {"operator":"AND","params":[{"operator":"OR","params":[{"param":{"name":"from_address","operator":"==","value":"or1"}},{"param":{"name":"receipt_status","operator":">","value":"1"}}]},{"param":{"name":"value","operator":"<=","value":"1000"}},{"param":{"name":"block.miner","operator":"!=","value":"qweqwe"}}]}
          type: object
          additionalProperties: {}
          example:
            blacklist:
              - '0xd6dfD811E06267b25472753c4e57C0B28652bFB8'
        actions:
          description: Action that should be executed by the user for this trigger
          type: array
          items:
            type: string
          example:
            - PAUSE
        alerts:
          description: List of alerts associated with the entry
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/AlertDto'
    Status:
      enum:
        - ACTIVE
        - DISABLED
        - DELETED
      type: string
    CreateAlertDto:
      required:
        - severity
        - name
        - message
      type: object
      properties:
        status:
          $ref: '#/components/schemas/Status'
        severity:
          description: Severity level of the alert
          type: string
          allOf:
            - $ref: '#/components/schemas/SeverityLevel'
        name:
          description: Name of the alert
          pattern: \S
          type: string
          example: Suspicious interaction
        message:
          description: Detailed message of the alert
          pattern: \S
          type: string
          example: This is a critical alert message
        destinations:
          description: List of destinations for the alert
          type: array
          items:
            $ref: '#/components/schemas/CreateDestinationDto'
        actions:
          description: List of actions associated with the entry
          type: array
          items:
            $ref: '#/components/schemas/CreateLinkedActionDto'
    TriggerType:
      enum:
        - BLACKLISTED_CALLERS
        - WHITELIST_CALLERS
        - FAILED_TRANSACTIONS
        - FUNCTION_CALL
        - EVENT_EMITTED
        - EVENT_EMITTED_ADVANCED
        - ERC20_TRANSFER
        - TRANSACTION_PARAMS
        - VALUE_TRANSFER
        - EVENT_PARAMS
        - OPERATION_PARAMS
      type: string
    AlertDto:
      type: object
      properties:
        id:
          format: int64
          description: Unique identifier of the entity
          type: integer
          example: 1
        createdAt:
          format: int64
          description: Time when entity was created
          type: integer
        updatedAt:
          format: int64
          description: Time when entity was updated
          type: integer
        status:
          description: 'Status of the entity. Default: ''ACTIVE'''
          type: string
          allOf:
            - $ref: '#/components/schemas/Status'
        severity:
          description: Severity level of the alert
          type: string
          allOf:
            - $ref: '#/components/schemas/SeverityLevel'
        name:
          description: Name of the alert
          type: string
          example: Suspicious interaction
        message:
          description: Detailed message of the alert
          type: string
          example: This is a critical alert message
        destinations:
          description: List of destinations for the alert
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/DestinationDto'
        actions:
          description: List of actions associated with the entry
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/LinkedActionDto'
    SeverityLevel:
      enum:
        - INFO
        - LOW
        - MEDIUM
        - HIGH
        - CRITICAL
      type: string
    CreateDestinationDto:
      required:
        - tenantDestinationId
      type: object
      properties:
        status:
          $ref: '#/components/schemas/Status'
        tenantDestinationId:
          format: int64
          description: Id of the tenant contact attached to this destination
          type: integer
    CreateLinkedActionDto:
      required:
        - actionId
      type: object
      properties:
        status:
          $ref: '#/components/schemas/Status'
        scriptFilter:
          type: string
        scriptParams:
          type: object
          additionalProperties:
            type: string
        actionId:
          format: int64
          description: Action attached to parent entry
          type: integer
    DestinationDto:
      type: object
      properties:
        id:
          format: int64
          description: Unique identifier of the entity
          type: integer
          example: 1
        createdAt:
          format: int64
          description: Time when entity was created
          type: integer
        updatedAt:
          format: int64
          description: Time when entity was updated
          type: integer
        status:
          description: 'Status of the entity. Default: ''ACTIVE'''
          type: string
          allOf:
            - $ref: '#/components/schemas/Status'
        tenantDestination:
          description: User contact attached to this destination
          type: object
          allOf:
            - $ref: '#/components/schemas/TenantDestinationDto'
    LinkedActionDto:
      type: object
      properties:
        id:
          format: int64
          description: Unique identifier of the entity
          type: integer
          example: 1
        createdAt:
          format: int64
          description: Time when entity was created
          type: integer
        updatedAt:
          format: int64
          description: Time when entity was updated
          type: integer
        status:
          description: 'Status of the entity. Default: ''ACTIVE'''
          type: string
          allOf:
            - $ref: '#/components/schemas/Status'
        scriptFilter:
          description: >-
            Groovy script, return true if action should be executed. Null mean
            execute all
          type: string
          example: e.severity>=0.5
        scriptParams:
          description: >-
            Groovy script, for each action parameter, return each parameter
            value. Null means use default params
          type: object
          additionalProperties:
            type: string
          example:
            _to: e.getTxHash()
            _value: a.getTimestamp()
        actionId:
          format: int64
          description: Action attached to parent entry
          type: integer
    TenantDestinationDto:
      type: object
      properties:
        id:
          format: int64
          description: Unique identifier of the entity
          type: integer
          example: 1
        createdAt:
          format: int64
          description: Time when entity was created
          type: integer
        updatedAt:
          format: int64
          description: Time when entity was updated
          type: integer
        tenantId:
          format: int64
          description: ID of the tenant
          type: integer
        type:
          description: Type of the destination information
          type: string
          allOf:
            - $ref: '#/components/schemas/ExtDestinationType'
        uid:
          description: The uid which can be used to bind a destination
          type: string
          example: 'Telegram: /start {uid}'
        tags:
          description: Destination tags
          type: array
          items:
            $ref: '#/components/schemas/ExtTenantDestinationTag'
        value:
          description: >-
            The destination information value, e.g., an email address, phone
            number, http uri, etc.
          type: string
        telegramBotUsername:
          description: The telegram bot username
          type: string
        telegramUserId:
          description: The telegram user id
          type: string
        telegramUsername:
          description: The telegram username
          type: string
        telegramChatId:
          description: The telegram chat id
          type: string
        telegramChatTitle:
          description: The telegram chat title
          type: string
        telegramChatType:
          description: The telegram chat type
          type: string
        slackUri:
          description: Webhook slack uri
          type: string
        slackChannelId:
          description: Slack Channel id
          type: string
        slackChannelName:
          description: Slack Channel name
          type: string
        uri:
          description: Http uri
          type: string
        method:
          description: Http method
          type: string
        headers:
          description: Http headers
          type: object
          additionalProperties:
            type: string
    ExtDestinationType:
      enum:
        - EMAIL
        - TELEGRAM
        - HTTP
        - SLACK
      type: string
    ExtTenantDestinationTag:
      enum:
        - DEFAULT
        - DETECTOR
        - WALLET
      type: string
  securitySchemes:
    SecurityScheme:
      type: http
      description: Authentication
      scheme: bearer
      bearerFormat: JWT

````