The BeLazy spreadsheet holds every project and job BeLazy monitors, kept up to date automatically. Google Apps Script, the JavaScript environment built into the Google suite of tools, lets you build automations on top of it: assigning vendors based on capacity, checking systems that have no events, or starting work from a sheet, a form or a message. The scripts run in your own Google account.

Apps Script is the right place for automations that need consolidated data in a different view. BeLazy sees one project at a time, but the Google Sheet contains all of them, and an Apps Script can merge that with, among other things, your calendars, your capacity figures or any other source you can reach.

What you can build

  • Capacity-based vendor assignment. Go through the open jobs of each in-house linguist, check their calendar for days off and part-time days, apply their usual daily output per work type (legal texts take longer than marketing copy), and assign new jobs according to your own strategy.
  • Around-the-clock checks of systems without events. A time-driven trigger can run as often as every minute, call any REST API, and create projects through the Project Ingestion API when something new appears.
  • Reacting to BeLazy events. A script deployed as a web app can receive BeLazy webhooks and act on them, for example post a message to a team channel when a vendor is assigned.
  • Starting work from a sheet or a form. A new row in a request sheet or a Google Form submission becomes a BeLazy project.
  • Partial automation. A menu item that a project manager runs when they decide to, for example to rebalance the assignments of the day.

How scripts reach BeLazy

Scripts are communicating with BeLazy through the BeLazy APIs.

Create an API token under Api access tokens in the BeLazy profile menu, and store it in the script's properties rather than in the code:

function callBeLazy(method, path, body) {
  const token = PropertiesService.getScriptProperties().getProperty('BELAZY_TOKEN');
  const options = {
    method: method,
    headers: { Authorization: 'ApiKey ' + token },
    contentType: 'application/json',
    muteHttpExceptions: true
  };
  if (body) options.payload = JSON.stringify(body);
  const response = UrlFetchApp.fetch('https://api.belazy.cat/api' + path, options);
  return JSON.parse(response.getContentText() || '{}');
}

// Example: read an opportunity
// const opportunity = callBeLazy('get', '/opportunities/v1/' + opportunityId);

Where to put your code

BeLazy installs and maintains its own scripts in the spreadsheet. Keep your own code in a separate Apps Script project, and open the BeLazy spreadsheet from it by its ID.

If your script needs to store its own data, such as capacity figures or an assignment log, put it in a tab you create yourself. BeLazy leaves your own tabs alone. Columns you add to BeLazy's sheets are removed when the structure is updated. See Sheets in the BeLazy spreadsheet and what you can edit.

Receiving webhooks

Deploy the script as a web app and use its URL as the webhook URL in BeLazy. Apps Script does not give the script access to request headers, so a header-based secret will not reach your code. Add a secret as a query parameter in the webhook URL instead, and check it in doPost before doing anything else.

Writing scripts with an LLM

Describe the process to an LLM such as Claude, Gemini or ChatGPT, give it the BeLazy API definition and the column headers of the sheets you use, and ask for an Apps Script. Ask it to explain the finished script step by step, or to draw it as a flowchart, so you can check that it does what you intended. Test it on demo data first: Create Demo Data in BeLazy's Google Sheets settings fills the spreadsheet with a demo data set.

Limits

Apps Script is not built for thousands of calls per minute. Google's quotas apply, including a maximum run time of 6 minutes per execution and daily limits that depend on your Google account type. For very high-frequency or must-never-miss polling, a serverless function or an iPaaS orchestrator is the better choice.

Microsoft users: the same patterns work with a scheduled Power Automate flow, optionally running an Office Script. BeLazy's spreadsheet integration itself is available for Google Sheets.