Notifications

Notifications

The Notification:

Notifications are configurations that send alerts to users when a certain criteria has been met.

This criteria is defined in the notification's configuration. Each log that is processed is checked against the notification's configuration. If the log matches the configuration, then the user will notified.

Configuration parts:

Owner

  • User, organization, or project that the notification belongs to.
  • This determines which logs the notification will be checked against.
  • This also determines which users will be notified.
  • Rules (criteria)

  • Set of criteria that the log must match in order to trigger the notification.
  • Essentially a query that is run against the log. If the log matches the query, then the notification is triggered.
  • Mediums

  • The methods that Log Harvestor will utilize in order to notify the user.
  • Email, SMS, Slack, etc.
  • Practical example:

  • A user creates a notification that will send an email to all users in their organization.
  • The notification is configured to trigger whenever a log is received that has a severity of "error".
  • Enabling/Disabling:

  • A notification can be enabled or disabled at any time.
  • When a notification is disabled, it will not be checked against any logs.
  • Inheritance:

  • A user can inherit notifications from their organization or project.
  • A project can inherit notifications from their organization.
  • Access Control:

  • A notification can only be edited by a user with proper access to it's owner.
  • So if an user inherits a notification from their organization, then they can only edit it if they have proper access to the organization.
  • Silencing:

  • A user can silence a notification at any time via the user settings.
  • Silencing a notification will only stop that specific user from receiving the notification.
  • Silencing a notification will not prevent other users from receiving the notification.
  • To silence a notification for all users, the notification must be disabled at the owner level.
  • Get all

    Description


    Get all notifications that the user has access to.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    Responses


    Type:

    Array of Notification objects


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Error notification",
        notes: "This notification is for errors",
        ownerEntityType: "User",
        ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1",
        rules: {
            id: "0f9c0b0b4f0c6b0017f0e3b1",
            field: "typ",
            operator: "EQUALS",
            comparator: "error",
            combinator: "AND"
        },
        mediums: {
            email: true,
            sms: true,
            push: true
        },
        enabled: true
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Invalid Role",
        message: "You do not have the required role to access this resource",
        status: 401
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Entity not found",
        message: "Entity not found",
        status: 404
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Internal Server Error",
        message: "Internal Server Error",
        status: 500
    }

    get

    /notification/

    Request

    1
    2
    3
    4
    curl https://logharvestor.com/api/v1/notification/ \
        -X GET \
        -H 'Authorization: Bearer <token>' \
        

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Error notification",
        notes: "This notification is for errors",
        ownerEntityType: "User",
        ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1",
        rules: {
            id: "0f9c0b0b4f0c6b0017f0e3b1",
            field: "typ",
            operator: "EQUALS",
            comparator: "error",
            combinator: "AND"
        },
        mediums: {
            email: true,
            sms: true,
            push: true
        },
        enabled: true
    }

    Get owner options

    Description


    Get all notification owner options that the user has access to.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    body

    entityType

    string

    Required

    Description:

    The type of entity to get options for. Must be one of: "org", "project", or "user".

    Options:

    Chart | Forwarder | Log | Notification | Org | Project | Ticket | User

    Example:

    "Forwarder"

    Responses


    Type:

    Array of RBAC objects


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        user: {
            _id: "0f9c0b0b4f0c6b0017f0e3b1",
            fname: "Jack",
            lname: "Lumber",
            dname: "Jack Lumber",
            email: "ljack21@logharvestor.com",
            password: "password",
            image: "{image url}",
            phone: "123-456-7890",
            queries: {},
            settings: {},
            role: "demo",
            onboardingStage: "welcome",
            dismissOnboarding: false
        },
        role: "owner",
        entity: "0f9c0b0b4f0c6b0017f0e3b1",
        entityType: "Forwarder"
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Invalid Role",
        message: "You do not have the required role to access this resource",
        status: 401
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Entity not found",
        message: "Entity not found",
        status: 404
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Internal Server Error",
        message: "Internal Server Error",
        status: 500
    }

    post

    /notification/entityOptions

    Request

    1
    2
    3
    4
    5
    curl https://logharvestor.com/api/v1/notification/entityOptions \
        -X POST \
        -H 'Authorization: Bearer <token>' \
        -H 'Content-Type: application/json' \
    	--data-raw '{"entityType":"\"Forwarder\""}'

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        user: {
            _id: "0f9c0b0b4f0c6b0017f0e3b1",
            fname: "Jack",
            lname: "Lumber",
            dname: "Jack Lumber",
            email: "ljack21@logharvestor.com",
            password: "password",
            image: "{image url}",
            phone: "123-456-7890",
            queries: {},
            settings: {},
            role: "demo",
            onboardingStage: "welcome",
            dismissOnboarding: false
        },
        role: "owner",
        entity: "0f9c0b0b4f0c6b0017f0e3b1",
        entityType: "Forwarder"
    }

    Get by id

    Description


    Find the notification that matches the {id} query parameter.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    id

    string

    Required

    Description:

    The id of the notification

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Type:

    Notification object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Error notification",
        notes: "This notification is for errors",
        ownerEntityType: "User",
        ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1",
        rules: {
            id: "0f9c0b0b4f0c6b0017f0e3b1",
            field: "typ",
            operator: "EQUALS",
            comparator: "error",
            combinator: "AND"
        },
        mediums: {
            email: true,
            sms: true,
            push: true
        },
        enabled: true
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Invalid Role",
        message: "You do not have the required role to access this resource",
        status: 401
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Entity not found",
        message: "Entity not found",
        status: 404
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Internal Server Error",
        message: "Internal Server Error",
        status: 500
    }

    get

    /notification/:id

    Request

    1
    2
    3
    4
    curl https://logharvestor.com/api/v1/notification/:id \
        -X GET \
        -H 'Authorization: Bearer <token>' \
        

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Error notification",
        notes: "This notification is for errors",
        ownerEntityType: "User",
        ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1",
        rules: {
            id: "0f9c0b0b4f0c6b0017f0e3b1",
            field: "typ",
            operator: "EQUALS",
            comparator: "error",
            combinator: "AND"
        },
        mediums: {
            email: true,
            sms: true,
            push: true
        },
        enabled: true
    }

    Get events

    Description


    Get all events that the notification has triggered. These include how and to whom the notification was sent, as well as when the notification was created or updated.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    forwarderId

    string

    Required

    Description:

    Forwarder identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns all events for the Notification.


    Type:

    Array of Event objects


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        type: "updated",
        message: "User 0f9c0b0b4f0c6b0017f0e3b1 updated forwarder 0f9c0b0b4f0c6b0017f0e3b1",
        user: "0f9c0b0b4f0c6b0017f0e3b1",
        entity: "0f9c0b0b4f0c6b0017f0e3b1",
        entityType: "Forwarder",
        refs: [
            {
                entity: "0f9c0b0b4f0c6b0017f0e3b1",
                entityType: "Forwarder"
            },
            {
                entity: "0f9c0b0b4f0c6b0017f0e3b1",
                entityType: "Project"
            }
        ]
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Invalid Role",
        message: "You do not have the required role to access this resource",
        status: 401
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Entity not found",
        message: "Entity not found",
        status: 404
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Internal Server Error",
        message: "Internal Server Error",
        status: 500
    }

    get

    /notification/:id/events

    Request

    1
    2
    3
    4
    curl https://logharvestor.com/api/v1/notification/:id/events \
        -X GET \
        -H 'Authorization: Bearer <token>' \
        

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        type: "updated",
        message: "User 0f9c0b0b4f0c6b0017f0e3b1 updated forwarder 0f9c0b0b4f0c6b0017f0e3b1",
        user: "0f9c0b0b4f0c6b0017f0e3b1",
        entity: "0f9c0b0b4f0c6b0017f0e3b1",
        entityType: "Forwarder",
        refs: [
            {
                entity: "0f9c0b0b4f0c6b0017f0e3b1",
                entityType: "Forwarder"
            },
            {
                entity: "0f9c0b0b4f0c6b0017f0e3b1",
                entityType: "Project"
            }
        ]
    }

    Create

    Description


    Create a new notification. The notification will be enabled by default.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    body

    name

    string

    Required

    Description:

    Name of the notification

    Example:

    "Error notification"

    notes

    string

    Description:

    Notes of the notification

    Example:

    "This notification is for errors"

    owner

    string

    Required

    Description:

    Owner of the notification

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    ownerEntityType

    string

    Required

    Description:

    Owner entity type of the notification

    Options:

    Org | Project | User | Forwarder

    Example:

    "User"

    rules

    array

    Required

    Description:

    Rules of the notification

    Example:

    rules

    mediums

    object

    Required

    Description:

    Mediums of the notification

    Example:

    NotificationMediums

    Responses


    Description:

    Returns the created notification.


    Type:

    Notification object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Error notification",
        notes: "This notification is for errors",
        ownerEntityType: "User",
        ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1",
        rules: {
            id: "0f9c0b0b4f0c6b0017f0e3b1",
            field: "typ",
            operator: "EQUALS",
            comparator: "error",
            combinator: "AND"
        },
        mediums: {
            email: true,
            sms: true,
            push: true
        },
        enabled: true
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Invalid Role",
        message: "You do not have the required role to access this resource",
        status: 401
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Entity not found",
        message: "Entity not found",
        status: 404
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Internal Server Error",
        message: "Internal Server Error",
        status: 500
    }

    post

    /notification/

    Request

    1
    2
    3
    4
    5
    curl https://logharvestor.com/api/v1/notification/ \
        -X POST \
        -H 'Authorization: Bearer <token>' \
        -H 'Content-Type: application/json' \
    	--data-raw '{"name":"\"Error notification\"","notes":"\"This notification is for errors\"","owner":"\"0f9c0b0b4f0c6b0017f0e3b1\"","ownerEntityType":"\"User\""}'

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Error notification",
        notes: "This notification is for errors",
        ownerEntityType: "User",
        ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1",
        rules: {
            id: "0f9c0b0b4f0c6b0017f0e3b1",
            field: "typ",
            operator: "EQUALS",
            comparator: "error",
            combinator: "AND"
        },
        mediums: {
            email: true,
            sms: true,
            push: true
        },
        enabled: true
    }

    Update

    Description


    Update an existing notification.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    id

    string

    Required

    Description:

    The id of the notification

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    body

    name

    string

    Required

    Description:

    Name of the notification

    Example:

    "Error notification"

    notes

    string

    Description:

    Notes of the notification

    Example:

    "This notification is for errors"

    owner

    string

    Required

    Description:

    Owner of the notification

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    ownerEntityType

    string

    Required

    Description:

    Owner entity type of the notification

    Options:

    Org | Project | User | Forwarder

    Example:

    "User"

    rules

    array

    Required

    Description:

    Rules of the notification

    Example:

    rules

    mediums

    object

    Required

    Description:

    Mediums of the notification

    Example:

    NotificationMediums

    Responses


    Description:

    Returns the updated notification.


    Type:

    Notification object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Error notification",
        notes: "This notification is for errors",
        ownerEntityType: "User",
        ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1",
        rules: {
            id: "0f9c0b0b4f0c6b0017f0e3b1",
            field: "typ",
            operator: "EQUALS",
            comparator: "error",
            combinator: "AND"
        },
        mediums: {
            email: true,
            sms: true,
            push: true
        },
        enabled: true
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Invalid Role",
        message: "You do not have the required role to access this resource",
        status: 401
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Entity not found",
        message: "Entity not found",
        status: 404
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Internal Server Error",
        message: "Internal Server Error",
        status: 500
    }

    put

    /notification/:id

    Request

    1
    2
    3
    4
    5
    curl https://logharvestor.com/api/v1/notification/:id \
        -X PUT \
        -H 'Authorization: Bearer <token>' \
        -H 'Content-Type: application/json' \
    	--data-raw '{"name":"\"Error notification\"","notes":"\"This notification is for errors\"","owner":"\"0f9c0b0b4f0c6b0017f0e3b1\"","ownerEntityType":"\"User\""}'

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Error notification",
        notes: "This notification is for errors",
        ownerEntityType: "User",
        ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1",
        rules: {
            id: "0f9c0b0b4f0c6b0017f0e3b1",
            field: "typ",
            operator: "EQUALS",
            comparator: "error",
            combinator: "AND"
        },
        mediums: {
            email: true,
            sms: true,
            push: true
        },
        enabled: true
    }

    Delete

    Description


    Delete an existing notification.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    id

    string

    Required

    Description:

    The id of the notification

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns a snapshot of the deleted notification.


    Type:

    Notification object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Error notification",
        notes: "This notification is for errors",
        ownerEntityType: "User",
        ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1",
        rules: {
            id: "0f9c0b0b4f0c6b0017f0e3b1",
            field: "typ",
            operator: "EQUALS",
            comparator: "error",
            combinator: "AND"
        },
        mediums: {
            email: true,
            sms: true,
            push: true
        },
        enabled: true
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Invalid Role",
        message: "You do not have the required role to access this resource",
        status: 401
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Entity not found",
        message: "Entity not found",
        status: 404
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Internal Server Error",
        message: "Internal Server Error",
        status: 500
    }

    delete

    /notification/:id

    Request

    1
    2
    3
    4
    curl https://logharvestor.com/api/v1/notification/:id \
        -X DELETE \
        -H 'Authorization: Bearer <token>' \
        

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Error notification",
        notes: "This notification is for errors",
        ownerEntityType: "User",
        ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1",
        rules: {
            id: "0f9c0b0b4f0c6b0017f0e3b1",
            field: "typ",
            operator: "EQUALS",
            comparator: "error",
            combinator: "AND"
        },
        mediums: {
            email: true,
            sms: true,
            push: true
        },
        enabled: true
    }

    Archive

    Description


    Archive an existing notification.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    id

    string

    Required

    Description:

    The id of the notification

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns the archived notification.


    Type:

    Notification object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Error notification",
        notes: "This notification is for errors",
        ownerEntityType: "User",
        ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1",
        rules: {
            id: "0f9c0b0b4f0c6b0017f0e3b1",
            field: "typ",
            operator: "EQUALS",
            comparator: "error",
            combinator: "AND"
        },
        mediums: {
            email: true,
            sms: true,
            push: true
        },
        enabled: true
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Invalid Role",
        message: "You do not have the required role to access this resource",
        status: 401
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Entity not found",
        message: "Entity not found",
        status: 404
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Internal Server Error",
        message: "Internal Server Error",
        status: 500
    }

    post

    /notification/:id/archive

    Request

    1
    2
    3
    4
    curl https://logharvestor.com/api/v1/notification/:id/archive \
        -X POST \
        -H 'Authorization: Bearer <token>' \
        

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Error notification",
        notes: "This notification is for errors",
        ownerEntityType: "User",
        ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1",
        rules: {
            id: "0f9c0b0b4f0c6b0017f0e3b1",
            field: "typ",
            operator: "EQUALS",
            comparator: "error",
            combinator: "AND"
        },
        mediums: {
            email: true,
            sms: true,
            push: true
        },
        enabled: true
    }

    Unarchive

    Description


    Unarchive an existing notification.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    id

    string

    Required

    Description:

    The id of the notification

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns the unarchived notification.


    Type:

    Notification object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Error notification",
        notes: "This notification is for errors",
        ownerEntityType: "User",
        ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1",
        rules: {
            id: "0f9c0b0b4f0c6b0017f0e3b1",
            field: "typ",
            operator: "EQUALS",
            comparator: "error",
            combinator: "AND"
        },
        mediums: {
            email: true,
            sms: true,
            push: true
        },
        enabled: true
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Invalid Role",
        message: "You do not have the required role to access this resource",
        status: 401
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Entity not found",
        message: "Entity not found",
        status: 404
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Internal Server Error",
        message: "Internal Server Error",
        status: 500
    }

    post

    /notification/:id/unarchive

    Request

    1
    2
    3
    4
    curl https://logharvestor.com/api/v1/notification/:id/unarchive \
        -X POST \
        -H 'Authorization: Bearer <token>' \
        

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Error notification",
        notes: "This notification is for errors",
        ownerEntityType: "User",
        ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1",
        rules: {
            id: "0f9c0b0b4f0c6b0017f0e3b1",
            field: "typ",
            operator: "EQUALS",
            comparator: "error",
            combinator: "AND"
        },
        mediums: {
            email: true,
            sms: true,
            push: true
        },
        enabled: true
    }

    Enable/Disable

    Description


    Enable or disable an existing notification.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    id

    string

    Required

    Description:

    The id of the notification

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns the updated notification.


    Type:

    Notification object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Error notification",
        notes: "This notification is for errors",
        ownerEntityType: "User",
        ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1",
        rules: {
            id: "0f9c0b0b4f0c6b0017f0e3b1",
            field: "typ",
            operator: "EQUALS",
            comparator: "error",
            combinator: "AND"
        },
        mediums: {
            email: true,
            sms: true,
            push: true
        },
        enabled: true
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Invalid Role",
        message: "You do not have the required role to access this resource",
        status: 401
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Entity not found",
        message: "Entity not found",
        status: 404
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Internal Server Error",
        message: "Internal Server Error",
        status: 500
    }

    post

    /notification/:id/toggle

    Request

    1
    2
    3
    4
    curl https://logharvestor.com/api/v1/notification/:id/toggle \
        -X POST \
        -H 'Authorization: Bearer <token>' \
        

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Error notification",
        notes: "This notification is for errors",
        ownerEntityType: "User",
        ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1",
        rules: {
            id: "0f9c0b0b4f0c6b0017f0e3b1",
            field: "typ",
            operator: "EQUALS",
            comparator: "error",
            combinator: "AND"
        },
        mediums: {
            email: true,
            sms: true,
            push: true
        },
        enabled: true
    }

    Log_Harvestor_Icon

    Join our newsletter

    support@logharvestor.com

    Copyright © Log Harvestor 2023TermsPrivacy