Orgs

Orgs

The Organization:

Organizations (Orgs) are the top level of the Log Harvestor permissions hierarchy. All billing is done at the Org level, and all users must belong to an Org.

Structure:

An organization can have multiple projects and users.

Users assigned to an organization can have different roles, which determine what they can do within the organization.

Users roles will be inherited by all projects within the organization.

Users roles will also be inherited by all other entites that belong to the organization, such as notifications, tickets, dashboards, and cards.

Users can be assigned to multiple organizations.

Archiving/Deleting:

  • All associated entities will be archived/deleted, such as projects, forwarders, notifications, tickets, dashboards, and cards.
  • If the organization is archived, all user roles will stay unchanged.
  • However, if the organization is deleted, all user roles will be removed.
  • Billing:

  • All projects within an organization will be billed together.
  • All other entities within an organization will also be billed under that organization.
  • Billing cannot be managed via the API - all billing management must be done through the Log Harvestor application
  • For more information on billing, see the pricing section.
  • Get all

    Description


    Get all {organizations} that the user belongs to or has access to.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    Responses


    Type:

    Array of Org objects


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "LogHarvestor",
        notes: "LogHarvestor is a all in one analytics platform",
        stripeId: "cus_123456789",
        stripePlan: "pro",
        projects: [
            "0f9c0b0b4f0c6b0017f0e3b1"
        ],
        billing: {
            email: "ljack21@logharvestor.com",
            phone: "123-456-7890"
        }
    }

    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

    /org/

    Request

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

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "LogHarvestor",
        notes: "LogHarvestor is a all in one analytics platform",
        stripeId: "cus_123456789",
        stripePlan: "pro",
        projects: [
            "0f9c0b0b4f0c6b0017f0e3b1"
        ],
        billing: {
            email: "ljack21@logharvestor.com",
            phone: "123-456-7890"
        }
    }

    Get by id

    Description


    Find the organization that matches the {orgId} query parameter.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    orgId

    string

    Required

    Description:

    The id of the org

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Type:

    Org object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "LogHarvestor",
        notes: "LogHarvestor is a all in one analytics platform",
        stripeId: "cus_123456789",
        stripePlan: "pro",
        projects: [
            "0f9c0b0b4f0c6b0017f0e3b1"
        ],
        billing: {
            email: "ljack21@logharvestor.com",
            phone: "123-456-7890"
        }
    }

    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

    /org/:orgId

    Request

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

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "LogHarvestor",
        notes: "LogHarvestor is a all in one analytics platform",
        stripeId: "cus_123456789",
        stripePlan: "pro",
        projects: [
            "0f9c0b0b4f0c6b0017f0e3b1"
        ],
        billing: {
            email: "ljack21@logharvestor.com",
            phone: "123-456-7890"
        }
    }

    Get events

    Description


    Get all the events for an organization. These events include things like user or project changes, {billing} events, any other related updates.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    orgId

    string

    Required

    Description:

    Org identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns all events for the Org.


    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

    /org/:orgId/events

    Request

    1
    2
    3
    4
    curl https://logharvestor.com/api/v1/org/:orgId/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"
            }
        ]
    }

    Get notifications

    Description


    Get all the notifications for an organization.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    orgId

    string

    Required

    Description:

    Org identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns all notifications for the org.


    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

    /org/:orgId/notifications

    Request

    1
    2
    3
    4
    curl https://logharvestor.com/api/v1/org/:orgId/notifications \
        -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 stats

    Description


    Get all the {stats} for an organization. This includes things like the total numbers of users, projects, forwarders, etc.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    orgId

    string

    Required

    Description:

    Org identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns the stats for the Org.


    Type:

    OrgStats object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    {
        usersTimeseries: {},
        projectsTimeseries: {},
        forwarderTimeseries: {
            id: "forwarderTimeseries",
            total: 20053,
            totalTicks: 3,
            data: [
                {
                    _id: "168910405000",
                    count: 123
                },
                {
                    _id: "168910415000",
                    count: 5234
                },
                {
                    _id: "168910425000",
                    count: 4567
                }
            ]
        }
    }

    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

    /org/:orgId/stats

    Request

    1
    2
    3
    4
    curl https://logharvestor.com/api/v1/org/:orgId/stats \
        -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
    21
    22
    23
    {
        usersTimeseries: {},
        projectsTimeseries: {},
        forwarderTimeseries: {
            id: "forwarderTimeseries",
            total: 20053,
            totalTicks: 3,
            data: [
                {
                    _id: "168910405000",
                    count: 123
                },
                {
                    _id: "168910415000",
                    count: 5234
                },
                {
                    _id: "168910425000",
                    count: 4567
                }
            ]
        }
    }

    Create

    Description


    Create a new organization.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    body

    name

    string

    Required

    Description:

    Forwarder name

    Example:

    "LogHarvestor"

    notes

    string

    Description:

    Forwarder notes

    Example:

    "LogHarvestor is a all in one analytics platform"

    billing

    object

    Description:

    Forwarder billing

    Example:

    OrgBilling

    Responses


    Type:

    Org object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "LogHarvestor",
        notes: "LogHarvestor is a all in one analytics platform",
        stripeId: "cus_123456789",
        stripePlan: "pro",
        projects: [
            "0f9c0b0b4f0c6b0017f0e3b1"
        ],
        billing: {
            email: "ljack21@logharvestor.com",
            phone: "123-456-7890"
        }
    }

    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

    /org/

    Request

    1
    2
    3
    4
    5
    curl https://logharvestor.com/api/v1/org/ \
        -X POST \
        -H 'Authorization: Bearer <token>' \
        -H 'Content-Type: application/json' \
    	--data-raw '{"name":"\"LogHarvestor\"","notes":"\"LogHarvestor is a all in one analytics platform\""}'

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "LogHarvestor",
        notes: "LogHarvestor is a all in one analytics platform",
        stripeId: "cus_123456789",
        stripePlan: "pro",
        projects: [
            "0f9c0b0b4f0c6b0017f0e3b1"
        ],
        billing: {
            email: "ljack21@logharvestor.com",
            phone: "123-456-7890"
        }
    }

    Update

    Description


    Update an organization.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    orgId

    string

    Required

    Description:

    Org identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    body

    name

    string

    Required

    Description:

    Forwarder name

    Example:

    "LogHarvestor"

    notes

    string

    Description:

    Forwarder notes

    Example:

    "LogHarvestor is a all in one analytics platform"

    billing

    object

    Description:

    Forwarder billing

    Example:

    OrgBilling

    Responses


    Description:

    Returns the updated forwarder.


    Type:

    Org object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "LogHarvestor",
        notes: "LogHarvestor is a all in one analytics platform",
        stripeId: "cus_123456789",
        stripePlan: "pro",
        projects: [
            "0f9c0b0b4f0c6b0017f0e3b1"
        ],
        billing: {
            email: "ljack21@logharvestor.com",
            phone: "123-456-7890"
        }
    }

    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

    /org/:orgId

    Request

    1
    2
    3
    4
    5
    curl https://logharvestor.com/api/v1/org/:orgId \
        -X PUT \
        -H 'Authorization: Bearer <token>' \
        -H 'Content-Type: application/json' \
    	--data-raw '{"name":"\"LogHarvestor\"","notes":"\"LogHarvestor is a all in one analytics platform\""}'

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "LogHarvestor",
        notes: "LogHarvestor is a all in one analytics platform",
        stripeId: "cus_123456789",
        stripePlan: "pro",
        projects: [
            "0f9c0b0b4f0c6b0017f0e3b1"
        ],
        billing: {
            email: "ljack21@logharvestor.com",
            phone: "123-456-7890"
        }
    }

    Delete

    Description


    Delete an organization.

  • This will permanently a organization and all associated data.
  • A successful response will return a snapshot of the organization before it was deleted.
  • If the organization is already deleted, a 404 will be returned.
  • Associated data that will be deleted includes: Events, Notifications, & Stats
  • Before deleting an organization - please contact support if you have any questions
  • ⚠️ WARNING ⚠️

  • This action cannot be undone.
  • If you do not want to permanently delete the organization, consider archiving it instead.
  • Parameters


    Responses


    delete

    /org/:orgId

    Request

    1
    2
    3
    4
    curl https://logharvestor.com/api/v1/org/:orgId \
        -X DELETE \
        undefined \
        

    Response

    1
    

    Archive

    Description


    Archive an organization.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    orgId

    string

    Required

    Description:

    Org identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns the archived org.


    Type:

    Org object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "LogHarvestor",
        notes: "LogHarvestor is a all in one analytics platform",
        stripeId: "cus_123456789",
        stripePlan: "pro",
        projects: [
            "0f9c0b0b4f0c6b0017f0e3b1"
        ],
        billing: {
            email: "ljack21@logharvestor.com",
            phone: "123-456-7890"
        }
    }

    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

    /org/:orgId/archive

    Request

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

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "LogHarvestor",
        notes: "LogHarvestor is a all in one analytics platform",
        stripeId: "cus_123456789",
        stripePlan: "pro",
        projects: [
            "0f9c0b0b4f0c6b0017f0e3b1"
        ],
        billing: {
            email: "ljack21@logharvestor.com",
            phone: "123-456-7890"
        }
    }

    Unarchive

    Description


    Unarchive an organization.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    orgId

    string

    Required

    Description:

    Org identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns the unarchived org.


    Type:

    Org object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "LogHarvestor",
        notes: "LogHarvestor is a all in one analytics platform",
        stripeId: "cus_123456789",
        stripePlan: "pro",
        projects: [
            "0f9c0b0b4f0c6b0017f0e3b1"
        ],
        billing: {
            email: "ljack21@logharvestor.com",
            phone: "123-456-7890"
        }
    }

    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

    /org/:orgId/unarchive

    Request

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

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "LogHarvestor",
        notes: "LogHarvestor is a all in one analytics platform",
        stripeId: "cus_123456789",
        stripePlan: "pro",
        projects: [
            "0f9c0b0b4f0c6b0017f0e3b1"
        ],
        billing: {
            email: "ljack21@logharvestor.com",
            phone: "123-456-7890"
        }
    }

    Get users

    Description


    Get all users that belong to or have access to an organization.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    orgId

    string

    Required

    Description:

    Org identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns the users in the org.


    Type:

    Array of User objects


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    {
        _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
    }

    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

    /org/:orgId/user

    Request

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

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    {
        _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
    }

    Get user by id

    Description


    Find a user, belonging to the organization, that matches the {userId} query parameter.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    orgId

    string

    Required

    Description:

    Org identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns org user.


    Type:

    User object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    {
        _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
    }

    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

    /org/:orgId/user/:userid

    Request

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

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    {
        _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
    }

    Add user

    Description


    Add a new user to an organization.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    orgId

    string

    Required

    Description:

    Org identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    body

    email

    string

    Required

    Description:

    User email

    Example:

    "ljack21@logharvestor.com"

    role

    string

    Required

    Description:

    User role

    Options:

    owner | member

    Example:

    "owner"

    Responses


    Description:

    Returns the added user.


    Type:

    User object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    {
        _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
    }

    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

    /org/:orgId/user

    Request

    1
    2
    3
    4
    5
    curl https://logharvestor.com/api/v1/org/:orgId/user \
        -X POST \
        -H 'Authorization: Bearer <token>' \
        -H 'Content-Type: application/json' \
    	--data-raw '{"email":"\"ljack21@logharvestor.com\"","role":"\"owner\""}'

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    {
        _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
    }

    Update user role

    Description


    Update the {role} of a user in an organization.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    orgId

    string

    Required

    Description:

    Org identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    userid

    string

    Required

    Description:

    User identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    body

    role

    string

    Required

    Description:

    User role

    Options:

    owner | member

    Example:

    "owner"

    Responses


    Description:

    Returns the updated user.


    Type:

    User object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    {
        _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
    }

    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

    /org/:orgId/user/:userid

    Request

    1
    2
    3
    4
    5
    curl https://logharvestor.com/api/v1/org/:orgId/user/:userid \
        -X PUT \
        -H 'Authorization: Bearer <token>' \
        -H 'Content-Type: application/json' \
    	--data-raw '{"role":"\"owner\""}'

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    {
        _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
    }

    Remove user

    Description


    Remove a user from an organization.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    orgId

    string

    Required

    Description:

    Org identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    userid

    string

    Required

    Description:

    User identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns the removed user.


    Type:

    User object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    {
        _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
    }

    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

    /org/:orgId/user/:userid

    Request

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

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    {
        _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
    }

    Get forwarders

    Description


    Get all forwarders that belong to an organization.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    orgId

    string

    Required

    Description:

    Org identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns the unarchived forwarder.


    Type:

    Array of Forwarder objects


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Web server 1",
        notes: "Forwarder assigned to the web server",
        host: "10.10.10.100",
        token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
        enabled: true,
        org: "0f9c0b0b4f0c6b0017f0e3b1",
        project: "0f9c0b0b4f0c6b0017f0e3b1",
        createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
        tot_logs: 10000
    }

    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

    /org/:orgId/forwarder

    Request

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

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Web server 1",
        notes: "Forwarder assigned to the web server",
        host: "10.10.10.100",
        token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
        enabled: true,
        org: "0f9c0b0b4f0c6b0017f0e3b1",
        project: "0f9c0b0b4f0c6b0017f0e3b1",
        createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
        tot_logs: 10000
    }

    Log_Harvestor_Icon

    Join our newsletter

    support@logharvestor.com

    Copyright © Log Harvestor 2023TermsPrivacy