API Documentation

The Leadsie API allows you to assign a unique custom user id to your customers to see the status of a request for them.

Use Case: You've got defined users who are meant to give you access via Leadsie, and you want to automatically check if they've done it (and what they've connected) to start a different workflow.

How to get access to the API

API access is only available for PRO or Enterprise plans. To get set up, just contact us.

How to use the API

To start tracking a user, you add a "customUserId" as a parameter to the connect request URL (this works for normal request pages and embedded):

?customUserId=SOME_UNIQUE_STRING

and then you can see what connections they have done.

API Key: Found at https://app.leadsie.com/my/api

(note you can refresh this within your app if you believe it to be compromised)

API Endpoint:

POST:

https://app.leadsie.com/api/checkUserStatus

Body:

{
    apiKey: String,
    customUserId?: String | undefined
}

Response:

{
    allConnections: [
        {
            user: int, // this will be a unique identifier for the same user across multiple connections
            customUserId: String | undefined, // a customerUserId (see below)
            requestUrl: String, // the url of the request
            requestName: String, // the name of the request if there is one - or else a specific id tied to that request
            accessLevel: "view" | "admin",
            status: 'SUCCESS' | 'PARTIAL_SUCCESS' | 'FAILED',
            connectionAssets: [{
                type: "Ad Account" | "Page" | "Pixel" | "Instagram Account" | "Catalog",
                name: String,
                id: String,
                isSuccess: Boolean,
                message: String
                time: Date,
        }
    ]
}

The custom user id can be set by adding it as a `customUserId` parameter to the URL when the user connects. It will be stored in local storage so even if they navigate away and come back then it will be connected. e.g. https://app.leadsie.io/connect/2088405878138352/manage?customUserId=12345

If a user revisits with another custom user id, they will be associated ONLY with the new one.

There is no limit to the length other than the standard URL limit for a browser to parse.

Still need help? Contact Us Contact Us