Platform Management API

Platform Management API

Written by James Chan
Last update: Sunday, Sep 17, 2023

Platform Management API


Create New Project with Website or Funnel


Every website or funnel is within a Project. The project is just a holder of the customer subscription. Depending on the subscription, it can have one or many websites or funnels in it.


To create new project with 1 website or funnel in it, and associate it to your customer, make a POST request to:


https://api.<wl-domain>/api/v1/website


with header: 

X-CLIENT-KEY: YOUR_CLIENT_KEY


and parameters (application/x-www-form-urlencoded):

templateId - Optional. The id of the WEBSITE template to start with. Can be empty. If both templateId and funnelTemplateId are empty, the customer will be prompted to select a template. If passed, will create a WEBSITE with this template.


funnelTemplateId - Optional. The id of the FUNNEL template to start with. Can be empty. If both templateId and funnelTemplateId are empty, the customer will be prompted to select a template. If passed, will create a FUNNEL with this template.


externalCustomerId - (or customerId) - If customers are fully managed externally (i.e. not registering in the builder), this is the unique ID of the customer on your end to assign to that website (website owner), or:

userId - The ID of the user registered in the builder, if customers are managed in the builder. Use either externalCustomerId or userId.


customerFirstName - The first name of the customer.

customerLastName - The last name of the customer.

customerEmail - The email of the customer. If the customer is not found on our end (by the customer id), we'll create a customer from the id / name / email and associate him with the website.

customerSubdomain - Optional. The subdomain (or a variation of it) to use for the website/funnel

websiteName - Optional. The name to use for the project and website.


Optional parameters:

brandColor - The initial Primary color for this website. Can be HEX (ex.: #3e3e3e) or RGBA value (ex: rgba(123, 123, 123, 0.5) )

secondaryColor1, secondaryColor2, secondaryColor3, secondaryColor4 - the 4 secondary colors


personalizationTags - The initial personalization tags to set to the template (if there are any in the template). 

Format of the tags:

[{ "name": "tag-name", "value": "tag-value" }, { "name": "tag-2-name", "value": "tag-value" }]


The tags parameter is a JSON string of the name/value pairs, name holding the tag name, value holding the tag value. Only supplied tags will be updated.



The response will be a JSON object:

{
    "success": true / false,
    data: {
	websiteId: the unique ID of the newly created website. You need to store this on your end
	projectId: the id of the project,
	subdomain:  the subdomain of the newly created website
    }
}



Add New Website or Funnel to existing Project


To add new website or funnel to existing project, you can make a POST request to:


https://api.<wl-domain>/api/v1/website/add


with header: 

X-CLIENT-KEY: YOUR_CLIENT_KEY


and parameters (application/x-www-form-urlencoded):

projectId - The id of the project to add the new website/funnel to.


templateId - The id of the WEBSITE template to start with. Can be empty. If both templateId and funnelTemplateId are empty, the customer will be prompted to select a template. If passed, will create a WEBSITE with this template.


funnelTemplateId - The id of the FUNNEL template to start with. Can be empty. If both templateId and funnelTemplateId are empty, the customer will be prompted to select a template. If passed, will create a FUNNEL with this template.


Optional parameters:

brandColor - The initial Primary color for this website. Can be HEX (ex.: #3e3e3e) or RGBA value (ex: rgba(123, 123, 123, 0.5) )

secondaryColor1, secondaryColor2, secondaryColor3, secondaryColor4 - the 4 secondary colors

customerSubdomain - Optional. The subdomain (or a variation of it) to use for the website/funnel


personalizationTags - The initial personalization tags to set to the template (if there are any in the template). 

Format of the tags:

[{ "name": "tag-name", "value": "tag-value" }, { "name": "tag-2-name", "value": "tag-value" }]


The tags parameter is a JSON string of the name/value pairs, name holding the tag name, value holding the tag value. Only supplied tags will be updated.

The response will be a JSON object:

{

    "success": true / false,

    data: {

websiteId: the unique ID of the newly created website. You need to store this on your end

projectId: the id of the project,

subdomain:  the subdomain of the newly created website

    }

}

Assign Customer to Project or Website/Funnel


To add an admin to a project or a single site or funnel in a project, you can make a POST request to:


https://api.<wl-domain>/api/v1/website/assign


with header: 

X-CLIENT-KEY: YOUR_CLIENT_KEY


and parameters (application/x-www-form-urlencoded):

projectId - The id of the project to assign the customer to. Required if no websiteId is provided. If websiteId is provided, the projectId must be the project of the website/funnel provided in websiteId


websiteId - The id of the website or the funnel to assign the customer to. If websiteId is empty, the customer will receive access to all websites/funnels in the project sent in projectId 


externalCustomerId - If customers are fully managed externally (i.e. not registering in the builder), this is the unique ID of the customer on your end, as provided in the Create Project endpoint, or:

userId - The ID of the user registered in the builder, if customers are managed in the builder. Use either externalCustomerId or userId.


customerFirstName - The first name of the customer.

customerLastName - The last name of the customer.

customerEmail - The email of the customer. If the customer is not found on our end (by the customer id), we'll create a customer from the id / name / email and associate them with the project or website/funnel.


The response will be a JSON object:

{

    "success": true / false

}

Unassign Customer from a project / website / funnel

To revoke access to a project or a single site / funnel in a project, you can make a POST request to:


https://api.<wl-domain>/api/v1/website/unassign


with header: 

X-CLIENT-KEY: YOUR_CLIENT_KEY


and parameters (application/x-www-form-urlencoded):

projectId - The id of the project to unassign the customer from. Required.


websiteId - The id of the individual website or funnel to unassign the customer from. If websiteId is empty, the customer will be unassigned from the whole project (all sites / funnels)


externalCustomerId - If customers are fully managed externally (i.e. not registering in the builder), this is the unique ID of the customer on your end, as provided in the Create Project endpoint, or:

userId - The ID of the user registered in the builder, if customers are managed in the builder. Use either externalCustomerId or userId.


The response will be a JSON object:

{

    "success": true / false,

}

Create New User Account


Important - usually when using the Platform API, users are managed externally, as part of a “bigger” service offering. In this case it’s recommended not to create user accounts but use Single-Sign-On to give access to existing external customers to a project / website.


To create new user account, make a POST request to:


https://api.<wl-domain>/api/v1/users


with header: 

X-CLIENT-KEY: YOUR_CLIENT_KEY


and parameters (application/x-www-form-urlencoded):

name - The full name of the user


email - The email of the user


password - Optional. The account password. If not set, a password-reset email will be sent to the user to enter their password.


locale - Optional. The locale for this user. Can be one of the currently supported locales:

en, bg, da, de, el, es, ca, fr, it, nb, nl_NL, pt_PT, pt_BR, ro, sv_SE, pl, zh, zh_JO, iw, ar, hu, hr, th, kr, vn, ru, is, jp, gr, ka, lt, sr, af, az, cz, lv, sk, sl, tr, cs, et, uk


ip - Optional. The ip address of the user.


The response will be a JSON object:

{

    "success": true / false,

    data: {

id: the unique ID of the newly created user

email: the email of the user,

name:  the name of the user,

locale: the locale of the user

    }

}

Get User Account Details


To get the details of a user by its id, make a GET request to:


https://api.<wl-domain>/api/v1/users/{userId}


with header: 

X-CLIENT-KEY: YOUR_CLIENT_KEY


and path parameters:

userId = The unique ID of the user


Which will return a JSON object with the user details:


{

        "id": 1234,

        "name": "User Name",

        "email": "user@email.com",

        “locale”: “en”

}

Search for User Account


To get the details of a user by its email, make a POST request to:


https://api.<wl-domain>/api/v1/users/search


with header: 

X-CLIENT-KEY: YOUR_CLIENT_KEY


and parameter (application/x-www-form-urlencoded):


email - The email of the user


Which will return a JSON object with the user details:


{

        "id": 1234,

        "name": "User Name",

        "email": "user@email.com",

        “locale”: “en”

}

Delete User Account


To delete a user by its id, make a DELETE request to:


https://api.<wl-domain>/api/v1/users/{userId}


with header: 

X-CLIENT-KEY: YOUR_CLIENT_KEY


and path parameters:

userId = The unique ID of the user


If the user has a project that’s active, an error will be returned. Make sure there are no active projects owned by this user first.

List Website Templates


To list all WEBSITE templates, make a GET request to:


https://api.<your-wl-domain>/api/v1/templates


with header:

X-CLIENT-KEY:YOUR_CLIENT_KEY


Which will return a JSON array with details on each template:


[{

id: 1,

name: "...",

primaryCategories: "Website, Online Store, Landing Page",

categories: "Art, Business, Consulting",

visible: true/false,

systemTemplate: true / false,

previewUrl: "subdomain.your-wl-domain.com",

thumb: "thumbnail url"

}, 

{...}, {...}]


Where each property is:

id - the id of the template

name - user-friendly name of the template

primaryCategories - the primary category of this template as defined in your admin (i.e. high-level type of the template)

categories - domain-oriented categories, as defined in your admin. Check https://simvoly.com/themes for an example of the filtering done with primaryCategories + categories

visible - either true or false - if you've enabled this template for your customers

systemTemplate - either true or false - if this is a system template (built by us) or one of your custom templates

previewUrl - url for a live preview of the template

thumb - thumbnail of the template


To get the details of a single Template, make a GET request to:

https://api.<your-wl-domain>/api/v1/templates/:id


with header:  X-CLIENT-KEY: YOUR_CLIENT_KEY

List Funnel Templates


To list all FUNNEL templates, make a GET request to:


https://api.<your-wl-domain>/api/v1/funnel-templates


with header:

X-CLIENT-KEY: YOUR_CLIENT_KEY


Which will return a JSON array with details on each template:


[{

"name": {

"en": "category name in English",

"fr": "category name in French",

...

},

"items": [{

"id": 123

"image": "path to image",

"name": {

"en": "template name in English",

"fr": "template name in French",

...

},

"description": {

"en": "description in English",

"fr": "description in French",

...

}

}, { ... }]

}]



The response is a list of all categories, with names in multiple languages as defined in your management panel, with “items” being a list of all templates in the category.

To get the details of a single Funnel Template, make a GET request to:

https://api.<your-wl-domain>/api/v1/funnel-templates/:id


with header:

X-CLIENT-KEY: YOUR_CLIENT_KEY




List Projects per Customer


To list all customer projects per customer, you can make a GET request to:


https://api.<wl-domain>/api/v1/projects


with header: 

X-CLIENT-KEY: YOUR_CLIENT_KEY


And URL parameter:

externalCustomerId - If customers are fully managed externally (i.e. not registering in the builder), this is the unique ID of the customer on your end, as provided in the Create Project endpoint, or:

userId - The ID of the user registered in the builder, if customers are managed in the builder. 

customerEmail = The email of the customer
Use either externalCustomerId, or userId, or customerEmail


Response will be a JSON array with details on each website:



[{

"name": "Project Name",

"id": 405,

"status": "ACTIVE",

"isOwner": true

}

{...}, {...}]

Where "status" is either "ACTIVE", "TRIAL" or "EXPIRED" and "isOwner" shows whether or not the customer is the owner of this project





List All Project Websites


To list all websites or funnels in a project, you can make a GET request to:


https://api.<wl-domain>/api/v1/projects/{id}/websites


with header: 

X-CLIENT-KEY: YOUR_CLIENT_KEY


and path parameters:

id = The unique ID of the project


Which will return a JSON array with details on each website:



[{

"id": 1234,

"domain": "custom-domain.com",

"name": "Website Name",

"subdomain": "website-subdomain",

“hasTemplate”: true,

"type": "WEBSITE"

}, {

"id": 1235,

"domain": "custom-domain.com",

"name": "Funnel Name",

"subdomain": "funnel-subdomain",

       “hasTemplate”: true,

"type": "FUNNEL"

}

{...}, {...}]

Where "type" is the type of site - either a Funnel or a Website


Get Single Project details


To get the details of a single project, you can make a GET request to:


https://api.<wl-domain>/api/v1/projects/{projectId}


with header: 

X-CLIENT-KEY: YOUR_CLIENT_KEY


and path parameters:

projectId = The unique ID of the project


Which will return a JSON array with details on each website:


{

        "id": 1234,

        "name": "Project Name",

        "status": "ACTIVE",

        "plan": {

            "id": 1234,

            "name": "Plan Name"

        },

        "sites": [

            {

                "id": 1234,

                "domain": null,

                "name": "Website Name",

                "subdomain": "website-subdomain",

  “hasTemplate”: true,

                "type": "WEBSITE"

            }

      ]

}

Where "type" is the type of site - either a Funnel or a Website

Get Single Website / Funnel details


To get the details of a single website / funnel, you can make a GET request to:


https://api.<wl-domain>/api/v1/projects/{projectId}/websites/{websiteId}


with header: 

X-CLIENT-KEY: YOUR_CLIENT_KEY


and path parameters:

projectId = The unique ID of the project

websiteId = The unique ID of the website / funnel in that project


Which will return a JSON array with details on each website:



{

"id": 1234,

"domain": "custom-domain.com",

"name": "Website Name",

"subdomain": "website-subdomain",

"type": "WEBSITE",

"hasTemplate": true

}

Where "type" is the type of site - either a Funnel or a Website and "hasTemplate" can be used to distinguish if the website has a template selected or not yet


Activate / Expire / Delete Website


With this endpoint you can DELETE a single website, ACTIVATE or EXPIRE the project of a particular website


To activate / expire / delete a website or funnel, you can make a POST request to:


https://api.<wl-domain>/api/v1/website/:id/set-status


with header:

X-CLIENT-KEY: YOUR_CLIENT_KEY


path parameters:

id = The unique ID of the website


and parameters (application/x-www-form-urlencoded):

status = "ACTIVE", "EXPIRED" or "DELETED"

planId = the id of the plan to set this website on, required only when status = ACTIVE

period = MONTHLY / YEARLY - the period to set this website on, required only when status = ACTIVE


The response will be a JSON object:

{

    "success": true / false,

    "message": "some error message if any"

}

Activate / Expire Project


With this endpoint you can ACTIVATE or EXPIRE a project


To activate / expire a project, you can make a POST request to:


https://api.<wl-domain>/api/v1/projects/:id/set-status


with header:

X-CLIENT-KEY: YOUR_CLIENT_KEY


path parameters:

id = The unique ID of the project


and parameters (application/x-www-form-urlencoded):

status = "ACTIVE", "EXPIRED"

planId = the id of the plan to set this website on, required only when status = ACTIVE

period = MONTHLY / YEARLY - the period to set this website on, required only when status = ACTIVE


The response will be a JSON object:

{

    "success": true / false,

    "message": "some error message if any"

}

Activate Project for period


With this endpoint you can ACTIVATE a project for specific number of months


To activate the project for specific number of months (for example, on a 6m promotion), then continue on a regular monthly / yearly subscription, you can make a POST request to:


https://api.<wl-domain>/api/v1/projects/:id/activate


with header:

X-CLIENT-KEY: YOUR_CLIENT_KEY


path parameters:

id = The unique ID of the project


and parameters (application/x-www-form-urlencoded):

planId = the id of the plan to set this website on, required

forMonths = the number of months to activate this project for, required

continueAs = MONTHLY / YEARLY - the period to set this website on after the initial forMonths


The response will be a JSON object:

{

    "success": true / false,

    "message": "some error message if any"

}

Activate / Deactivate Addon


With this endpoint you can ACTIVATE or DEACTIVATE an addon for a project


To activate an addon for a project, you can make a POST request to:


https://api.<wl-domain>/api/v1/projects/:id/set-addon


with header:

X-CLIENT-KEY: YOUR_CLIENT_KEY


path parameters:

id = The unique ID of the project


and parameters (application/x-www-form-urlencoded):

type = "EMAIL_MARKETING"

value = the value for the addon

Valid value for type is:

EMAIL_MARKETING - enabling / disabling the email marketing addon. (More addons coming soon)


Valid value for value is the accepted value for the specified addon. Passing 0 (zero) will deactivate the addon.
For EMAIL_MARKETING, valid values are: 0, 500, 1000, 2500, 5000, 10000, 15000, 25000, 50000, 75000, 100000

The response will be a JSON object:

{

    "success": true / false,

    "message": "some error message if any"

}




Subscription Plan - Check Limits


To check if a website can be subscribed to a particular plan (i.e. is within the plan limits), you can make a GET request to:


https://api.<wl-domain>/api/v1/website/{id}/check-limits

with header:

X-CLIENT-KEY: YOUR_CLIENT_KEY


path parameters:

id = The unique ID of the website


and parameters (application/x-www-form-urlencoded):

planId = the id of the plan to check if the website can be upgraded to


The response will be a JSON object:

{

    "success": true / false,

    "message": "some error message if any"

}


List Subscription Plans


To get a list of all available subscription plans and the plan limits, you can make a GET request to:


https://api.<wl-domain>/api/v1/plans


with header:

X-CLIENT-KEY: YOUR_CLIENT_KEY


The response will be a JSON object with a list containing all plan details:

{

    "data": [

        {

            "id": 1,

            "name": "Personal",

            "pages": 20,

            "storage": 20,

            "bandwidth": 20,

            "contributors": 20,

            "storeProducts": 10,

            "members": 20,

            "funnels": 1,

            "websites": 1,

            "bookingOperators": 1,

            "bookingServices": 1,

            "basePlan": "PERSONAL",

            "monthlyPrice": 12.0,

            "yearlyPrice": 144.0,

            "hidden": false

        }

    ],

    "success": true,

    "ok": true

}


Connect a domain


To connect a domain to a website, make a POST request to:


https://api.<wl-domain>/api/v1/website/:id/connect-domain


with header:

X-CLIENT-KEY: YOUR_CLIENT_KEY


path parameters:

id = The unique ID of the website


and parameters (application/x-www-form-urlencoded):

domain = domain.com - the domain to connect to that website


The response will be a JSON object:

{

    "success": true / false,

    "message": "some error message if any"

}


Disconnect domain


To disconnect a domain from a website, make a POST request to:


https://api.<wl-domain>/api/v1/website/:id/disconnect-domain


with header:

X-CLIENT-KEY: YOUR_CLIENT_KEY


path parameters:

id = The unique ID of the website

domain = domain.com - the domain to connect to that website


and parameters:

domain = domain.com - the domain to disconnect


The response will be a JSON object:

{

    "success": true / false,

    "message": "some error message if any"

}





Set Personalization Tags


To set the personalization tags of a website (if any tags are present), you can make a POST request to:


https://api.<wl-domain>/api/v1/website/{id}/set-personalization-tags


with header:

X-CLIENT-KEY: YOUR_CLIENT_KEY


path parameters:

id = The unique ID of the website


and parameters (application/x-www-form-urlencoded):


brandColor - The initial Primary color for this website. Can be HEX (ex.: #3e3e3e) or RGBA value (ex: rgba(123, 123, 123, 0.5) ) (optional)

secondaryColor1, secondaryColor2, secondaryColor3, secondaryColor4 - the 4 secondary colors (optional)


tags - JSON string of the name/value pairs, name holding the tag name, value holding the tag value. Only supplied tags will be updated. Example:


[{ "name": "tag-name", "value": "tag-value" }, { "name": "tag-2-name", "value": "tag-value" }]








Single Sign-On (Start Building Session)


If you already have your own authentication mechanism in your app / website, Single-Sign-On allows your authenticated users to directly access the builder without logging in again.


To do this you need to initiate a session on your end and redirect your customers to the builder.


To initiate a session, make a POST request to:


https://api.<wl-domain>/api/platform/session


With headers:


Authorization: Bearer <YOUR_CLIENT_KEY>


And POST parameters (application/x-www-form-urlencoded):


externalCustomerId - If customers are fully managed externally (i.e. not registering in the builder), this is the unique ID of the customer on your end, as provided in the Create Project endpoint, or:

userId - The ID of the user registered in the builder, if customers are managed in the builder, or: 

userEmail - The email of the user registered in the builder.

Use either externalCustomerId, userId, or userEmail.

projectId - The id of the project you want the customer to edit. The user will be given access to the last modified website in the selected project

websiteId - The id of the website/funnel you want the customer to edit (optional)

path - The path to redirect the customer to on successful login. Optional, ex: /me/website, /me/settings, /me/store, etc.

We recommend omitting the websiteId parameter and providing the project ID only to ensure the customer is given access to the latest website / funnel in their project. Providing a websiteId of a deleted website will result in error.


Response will be:


{

    "token": "<token>",

    "accessUrl": "https://api.<wl-domain>/api/platform/session/<token>",

    "createdAt": 1514764800,

    "expiresAt": 1514765700

}


The response contains the access URL. Forward the customer to that URL to start their session and give them access to the builder to edit their website / funnel. The accessUrl is valid for 15 minutes after which you need to request a new one.


[DEPRECATED]

This page describes our older, now deprecated SSO implementation. New integrations shouldn’t use this method.


To direct the customer to the builder, make a request to:


https://api.<wl-domain>/api/v1/build?token=session_token&websiteId=123


with parameters:

token - an authentication token, identifying your customer in your system

websiteId - the id of the website you want the customer to edit, OR

projectId - the id of the PROJECT you want the customer to edit. The user will be given access to the last modified website in the selected project.


If the user is not authenticated on our end, we will use the token to call your authentication service and check if the customer is logged in. If not, we will redirect them to your auth endpoint to login. If the token identifies a valid logged-in user in your platform, we’ll start a session for them on our end.


To enable this functionality, we need the following information configured:

1. Endpoint for checking if a customer is logged in - we’ll make a call back to you, passing your token, expecting you to return the customer ID / name / email if they are logged in on your end. If they are, we’ll start a session on our end and give them access to the website, if not they’ll be redirected to your login URL (2.).


2. Endpoint to redirect customers to if login is required

This method is deprecated and while still supported, we don’t recommend it.

API Key


YOUR_API_KEY (aka Platform API Key) is used for authorizing you and should be kept as your secret (i.e. do not call this endpoint from the client side). We will provide you with a client key once you start testing.

Platform Webhooks


Webhooks are a system of automated notifications indicating that an event has occurred in your website. Rather than requiring you to pull information via the API, webhooks push information to your destination when important events occur.
When an event is triggered, we'll send a HTTP POST payload to the webhook's target URL. The payload is a single JSON object that depends on the event. All times in the payload are UNIX timestamps. Each webhook will include the following headers:


X-Webhook-Id

The id of the fired webhook.

X-Webhook-Topic

The event that was fired. One of: user_created, project_created, project_deleted, website_created, website_deleted, subscription_activated, subscription_renewed, subscription_expired, trial_expired, affiliate_joined.

X-Webhook-Source

The URL of the website firing the event (the platform domain).

X-Webhook-Signature

The HMAC hex digest of the response body. Use the signature to verify that the request is actually coming from your platform. The HMAC hex digest is generated using the SHA-512 hash function and the secret as the HMAC key.




You can create webhooks for:

Subscription Activated (subscription_activated)

Receive a notification on a new subscription. Payload:

{

  "time": 1580570115,

  "project":
  {

    "id": 123456

    "name": "Project Name",

  },

  "user":
  {

    "id": 123456,

    "email": "user@email.com"

  },

  "plan":
  {

    "id": 123456,

    "name": "user@email.com"

  },

  "charge":
  {

    "transactionId": "transaction-id-from-payment-processor",

    "total": 12.00,

    "taxPercent": 19.00,

    "period": "MONTHLY",

    "invoiceNo": 1234,

  },

  "billTo":
  {

    "name": "Customer Name",

    "companyName": "Company Name",

    "companyId": "123456789",

    "vatId": "DE123456789",

    "country": "US",

    "city": "Williamsburg",

    "state": "Virginia",

    "postCode": "23185",

    "address": "15 Richmond rd"

  }

}



Subscription Renewed (subscription_renewed)

Receive a notification when a subscription renews. Payload:


{

  "time": 1580570115,

  "project":
  {

    "id": 123456

    "name": "Project Name",

  },

  "user":
  {

    "id": 123456,

    "email": "user@email.com"

  },

  "plan":
  {

    "id": 123456,

    "name": "user@email.com"

  },

  "charge":
  {

    "transactionId": "transaction-id-from-payment-processor",

    "total": 12.00,

    "taxPercent": 19.00,

    "period": "MONTHLY"

  },

  "billTo":
  {

    "name": "Customer Name",

    "companyName": "Company Name",

    "companyId": "123456789",

    "vatId": "DE123456789",

    "country": "US",

    "city": "Williamsburg",

    "state": "Virginia",

    "postCode": "23185",

    "address": "15 Richmond rd"

  }

}


Subscription Expired (subscription_expired)

Receive a notification when a subscription expires. Payload:


{

  "time": 1580570115,

  "project":
  {

    "id": 123456

    "name": "Project Name",

  },

  "user":
  {

    "id": 123456,

    "email": "user@email.com"

  }

}




New user (user_created)
Receive a notification when a new user joins. Payload:


{

  "time": 1580570115,

  "user":
  {

    "id": 123456,

    "name": "User Name",

    "email": "user@email.com"

  }

}



New project (project_created)
Receive a notification when a project is created. Payload:


{

  "time": 1580570115,

  "project":
  {

    "name": "User Name",

    "id": 123456

  },

  "user":
  {

    "id": 123456,

    "email": "user@email.com"

  }

}



Deleted project (project_deleted)
Receive a notification when a project is deleted. Payload:


{

  "time": 1580570115,

  "project":
  {

    "name": "Project Name",

    "id": 123456
  }

}


New website (website_created)
Receive a notification on new website / standalone funnel. Payload:


{

  "time": 1580570115,

  "website":
  {

    "name": "Website Name",

    "subdomain": "website-subdomain",

    "id": 123456

  },

  "project":
  {

    "name": "Project Name",

    "id": 123456

  },

  "user":
  {

    "id": 123456,

    "email": "owner@email.com"

  }

}



Deleted website (website_deleted)
Triggers when a website / standalone funnel is deleted. Payload:


{

  "time": 1580570115,

  "website":
  {

    "name": "Website Name",

    "subdomain": "website-subdomain",

    "id": 123456

  }

}



Affiliate joined (affiliate_joined)
Receive a notification when an affiliate user joins. Payload:


{

  "time": 1580570115,

  "commission": 30,

  "defaultLink": "https://domain.com/a/abcdefgh",

  "user":
  {

    "id": 123456,

    "email": "user@email.com"

  }

}


Trial Expired (trial_expired)
Receive a notification when a trial project expires. Payload:


{

  "time": 1580570115,

  "project":
  {

    "id": 123456

    "name": "Project Name",

  },

  "user":
  {

    "id": 123456,

    "email": "user@email.com"

  }

}


Bandwidth Notification (bandwidth_notification)
Receive a notification when a project reaches 80, 90, or 100% of it’s available bandwidth. Payload:


{

  "time": 1580570115,

  "project":
  {

    "id": 123456

    "name": "Project Name",

  },

  "user":
  {

    "id": 123456,

    "email": "user@email.com"

  },

  "usedBandwidth": 90

}

Accessing the Website API


Per-website data for each website is available via our Website API: https://websitebuilder.docs.apiary.io


The Website API gives access to store orders, products, messages, contacts, per website webhooks, etc.


The access to the Website API can be made in 2 ways:


1. Via the per-Website API key available in the website settings -> Applications -> Api Key and passed via the Authorization: Bearer <key>  header, or


2. Via your Platform API key - Platform administrators can access each Website API via their Platform API key. Instead of providing the Authorization: Bearer <key> header, send the X-Platform-Key header instead, for example:

GET  https://<customer-subdomain>.<wl-domain>/api/site/contacts


with header:


X-Platform-Key: <YOUR_API_KEY>


Passing the X-Platform-Key instead of the website API key grants platform administrators access to the Website API for each website in their platform.

Verifying Website API key


To check if a website API key is valid, or to get the website subdomain from a Website API key, make a GET request to:


https://api.<wl-domain>/api/platform/website/check?key=api-key-here



with header:

Authorization: Bearer <YOUR_CLIENT_KEY>


and URL parameter:

key = The Website API key you want to check


The response will be:


A JSON object on success:


{
  "name": "The Website Title",

    "domain": "https://customer-subdomain.<wl-domain>"

}


Or an error (HTTP 400 - Bad Request) if the key is not valid

Website API

5 articles in this category.
Written by James Chan.