LogSail
  • LogSail
  • API Platform
    • LogSail APIs
      • Service Accounts
      • API Tokens
      • Dataplane APIs
  • Agents
    • Deploying Reactive Agents
  • Support
Powered by GitBook
On this page
  1. API Platform
  2. LogSail APIs

API Tokens

Requesting authentication tokens for API access.

PreviousService AccountsNextDataplane APIs

Last updated 2 years ago

Warning: It is recommended to use a Service Account when accessing the LogSail API. Sharing email and passwords for a user account is not recommended when requesting API tokens for 3rd party access.

Basic Authentication

API tokens for the service account can be obtained through BasicAuth flow. This flow requires the knowledge of the service account email and password which can be exchanged for a bearer token and access token set. The following API route will return a token set with the access defined in the previous section.

Within a successful response the client will have access to a refresh_token and access_token. Access tokens have an expiry time of 5 minutes and are used for all LogSail APIs. A refresh token expires in 24 hours and is rotated upon upon each refresh of an access token. The following API endpoint will rotate the token set expiring the previous token set minted.

Revoking API tokens can be done using the following API endpoint.

Refresh Tokens

post

Mints a new access and refresh token.

Header parameters
refresh-tokenstringOptionalPattern: ^(agents-|users-)[A-Za-z0-9-_]{128}$
Responses
200
Successful Response
application/json
Responseany
422
Validation Error
application/json
post
POST /refresh/token HTTP/1.1
Host: auth.logsail.com
Accept: */*

No content

Revoke Refresh Token

post

Expires the refresh token.

Header parameters
refresh-tokenstringOptionalPattern: ^(agents-|users-)[A-Za-z0-9-_]{128}$
Responses
200
Successful Response
application/json
Responseany
422
Validation Error
application/json
post
POST /refresh/revoke HTTP/1.1
Host: auth.logsail.com
Accept: */*

No content

  • Basic Authentication
  • POSTBasic Sign In
  • POSTRefresh Tokens
  • POSTRevoke Refresh Token

Basic Sign In

post

Returns the refresh and jwt tokens for the user.

Body

Basic Auth Sign In Model

emailstring · emailRequired
passwordstringRequired
Responses
200
Successful Response
application/json
422
Validation Error
application/json
post
POST /users/basic/sign_in HTTP/1.1
Host: auth.logsail.com
Content-Type: application/json
Accept: */*
Content-Length: 44

{
  "email": "name@gmail.com",
  "password": "text"
}
{
  "access_token": "text",
  "token_type": "text",
  "expires_in": 1,
  "refresh_token": "text"
}