API Tokens and Token Roles

The Librato API requires authentication with every request. Authentication is accomplished with a user and token pair. User is the email address you used to create your Librato account.

To find your API tokens, log in to your Librato account, click on the Integrations icon and then API Tokens. This will show you the list of API tokens you have available. Clicking on the token name shows you the token details and allows you to edit it.

account_api-tokens

If you accidentally publicized your secret token, you can set it to “Inactive” or delete it by clicking on the “X” next to the token name in the “All API tokens” list.

NOTE THAT THIS IS A DESTRUCTIVE ACTION!!!

Any existing integrations using your old token will cease to work as soon as you delete the API token.

Generate a New API Token

To generate a new API token click on the “Generate New API Token” button. You can further enhance security by limiting the token to a specific role.

token_roles

Your choices are:

  • Full Access: Full access to all resources, including user actions such as creating more API tokens.
  • Record Only: For agents and collectors to record metrics and measurements. May also view existing metric-related data.
  • View Only: Is a read only token, designed for viewing and embedding dashboards and instruments in a public arena.

API Token Role Permissions

The table below lists all the API Endpoints, and the API Token roles that are permitted to access them.

Path Method Full Access Record Only View Only
/v1/alerts GET  
  POST    
/v1/alerts/:id GET  
  PUT    
  DELETE    
/v1/alerts/:id/services POST    
/v1/alerts/:id/services/:service_id DELETE    
/v1/annotations GET
/v1/annotations/:name GET
  POST  
  PUT    
  DELETE    
/v1/annotations/:name/:id GET
  PUT    
  DELETE    
/v1/annotations/:name/:id/links POST    
/v1/annotations/:name/:id/links/:rel DELETE    
/v1/api_tokens GET    
  POST    
/v1/api_tokens/:id GET    
  PUT    
  DELETE    
/v1/charts GET    
  POST    
/v1/charts/:token DELETE    
/v1/dashboards GET  
  POST    
/v1/dashboards/:id GET  
  PUT    
  DELETE    
/v1/instruments GET  
  POST    
/v1/instruments/:id GET  
  PUT    
  DELETE    
/v1/instruments/:id/streams/:streamid GET  
/v1/metrics GET
  POST  
  DELETE    
/v1/metrics/:name GET
  PUT    
  DELETE    
/v1/services GET    
  POST    
/v1/services/:id GET    
  PUT    
  DELETE    
/v1/sources GET
/v1/sources/:name DELETE    
/v1/tags GET
/v1/tags/:name GET
  POST    
  DELETE    
/v1/users GET    
  POST    
/v1/users/:id GET    
  DELETE    
/v1/users/:inputid PUT