Locoia API Authentication - Personal Access Token

Authentication with our API of Locoia itself

Creating a Personal Access Token

In Locoia

Go to your avatar (upper right corner) > User > Personal Access Token.

There you can create new access tokens, update and regenerate existing ones with full flexibility.

The token itself is only visible right after creating a personal access token. In case you didn't save it, you can generate the token. The old token will then be invalidated.

Using the API

We recommend to generate and manage personal access tokens directly in our app for, however, you can use our API for that as well.

In order to create a personal access token via API the following endpoint needs to be used:

Create personal access token

POST https://api.locoia.com/v1/personal-access-tokens

The personal access token can be defined with granular scopes and an expiration date.

Headers

NameTypeDescription

Authorization*

String

Bearer Token

Request Body

NameTypeDescription

expiration*

Int

Number of days until expiration. Use null for no expiration

scopes*

List

List of scopes

note*

String

Describe purpose, (max 255 characters)

{
  "id": "UUID",
  "token": "Token",
  "expiration": "Expiration Datetime",
  "note": "String",
  "last_used": null,
  "scopes": [
    "Scope1",
    "Scope2"
  ]
}

The token itself is only visible right after creating a personal access token, after that it is impossible to retrieve it from the API.

You can also create it directly in Locoia with this Community Library Flow.

One can regenerate a token with by sending the following POST request:

Regenerate personal access token

POST https://api.locoia.com/v1/personal-access-tokens/{{ token_id }}/regenerate

Regenerate or extend the expiration of an already created personal access token.

Path Parameters

NameTypeDescription

token_id*

String

ID of personal access token to be regenerated

Headers

NameTypeDescription

Authorization*

String

Bearer Token

Request Body

NameTypeDescription

expiration*

Int

Number of days until expiration null for no expiration

You can list all token with

Get personal access tokens

GET https://api.locoia.com/v1/personal-access-tokens

List all personal access tokens of the user.

Headers

NameTypeDescription

Authorization

String

Bearer Token

Scopes

The following scopes are available:

Scope NameEntites

automation

  • Flows

  • Flow Runs

  • Flow Run Steps

  • Run Flows

  • Connector Auths (Read only)

  • Env Variables (Read only)

  • File Uploads (Read only)

company

  • Env Variables

  • File Uploads

  • Teams

  • Users

connector_auth

  • Connector Auths

connectors

  • Connectors

  • Connector Actions

dashboard

  • Dashboards

  • Data Sources

  • Forecasts

  • Insights

  • Transforms

embed

  • Embeds

There are different access levels based on the scope extension:

Scope ExtensionSupported ScopesOperationsExample

None (leave empty)

automationcompanyconnector_authconnectorsdashboardembed

CRUD - Create, Read, Update, Delete

connector_auth - the token can create, read, update, and delete all Connector Auths to which the user who created the token has access to

:manage

automationcompanyconnector_authconnectorsdashboardembed

CRU - Create, Read, Update

connector_auth:manage - the user can do all of the above, except for deleting

:view

automationcompanyconnector_authconnectorsdashboardembed

R - Read

connector_auth:view - the user can only read the Connector Auths

webhook_run

automation

Trigger Webhook Flows

automation - the token can trigger all Webhook Flows in the account (alternative to Flow specific webhook tokens)

Using Personal Access Token

To authenticate with the token, simply specify it in the Authorization header like this: Authorization: Bearer {{ token }} or setup a Connector Auth for Locoia within the Locoia app and then use the token there.

Last updated