Skip to content

Editing lists via the API

Lists in Lasso are collections of companies or people, and can be found in the portal in the menu on the left. Lists can be shared with individuals or the entire organization, with access fine-grained access permissions. Internally in Lasso a list is a tag, which is why this terminology is used in the data/endpoint examples.

This page describes how to manipulate lists using the API, including adding and removing entities.

Shared vs private lists

By default, only lists shared with the organization can be fetched/manipulated through the API. In order to get access to a private list, you must append ?userId={userId} to the URL, replacing {userId} with the ID of the user. By doing this you will affectively impersonate the provided user, getting access to all the lists that this user have access to.

Get all available lists

To fetch all avaiable lists for a given organization, use the below endpoint:

GET api.lassox.com/tags
GET api.lassox.com/tags?userId={userId}
[
    {
        "type": "Company",
        "id": "2jlIa8",
        "count": null,
        "name": "Kundeliste",
        "owner": "6d7fd739-6c2b-41gb-93a4-4f1d96a094e6",
        "followTag": false,
        "canView": true,
        "canEdit": false,
        "canDelete": false,
        "canTag": true,
        "monitors": [
            {
                "id": "093g32b3-9716-4562-bec4-da73e12c8c8a",
                "lassoUserId": "815798de-bc00-4cua-890e-019077489b19"
            }
        ]
    },
    {
        "type": "Person",
        "id": "4q8Ia8",
        "count": null,
        "name": "Kontaktpersoner",
        "owner": "6d7fd739-6c2b-41gb-93a4-4f1d96a094e6",
        "followTag": false,
        "canView": true,
        "canEdit": true,
        "canDelete": true,
        "canTag": true,
        "monitors": []
    }
]

Get specific list

Use below endpoint to get a specific list, use the Id of a list with the below endpoint:

GET api.lassox.com/tags/{tagId}
{
    "type": "Company",
    "id": "2jlIa8",
    "count": null,
    "name": "Kundeliste",
    "owner": "6d7fd739-6c2b-41gb-93a4-4f1d96a094e6",
    "followTag": false,
    "canView": true,
    "canEdit": false,
    "canDelete": false,
    "canTag": true,
    "monitors": [
        {
            "id": "093g32b3-9716-4562-bec4-da73e12c8c8a",
            "lassoUserId": "815798de-bc00-4cua-890e-019077489b19"
        }
    ]
}

Get entities in a list

To get the entities contained in a specific list, use this endpoint. The example fetches the first 1000 entities in a list, using the skip and take parameters:

GET api.lassox.com/tags/{tagId}/entities?skip=0&take=1000
{
    "results": [
        {
            "lassoId": "CVR-1-12345678",
            "name": "Anpartsselskabet ApS"
        },
        {
            "lassoId": "CVR-1-87654321",
            "name": "Aktieselskabet A/S"
        }
    ],
    "page": 1,
    "pageSize": 1000,
    "totalPages": 1,
    "resultsFound": 2,
    "resultsReturned": 2
}

Adding a single entity to a list

To add a single entity to a list, use this endpoint:

POST api.lassox.com/{lassoId}/tags/{tagId}

Removing a single entity from a list

To remove a single entity from a list, use this endpoint:

DELETE api.lassox.com/{lassoId}/tags/{tagId}

Add and/or remove multiple entities to/from a list

If you want to add/remove multiple entities at the same time, you must provide the relevant entity Ids, and the lists that the entities is to be added/removed from/to:

POST api.lassox.com/tags/change
With a payload in the body of the following format. This example adds to entities to one list, and removes them from another.
{
    "lassoIds": ["CVR-1-12345678", "CVR-1-87654321"], //lassoIds to add/remove
    "tagsToAdd": ["2jlIa8"], // list of tag Ids that the entities must be added to
    "tagsToRemove": ["4q8Ia8"], // list of tag Ids that the entities must be removed from
}