Skip to main content
node
const fetch = require('node-fetch');

let url = 'https://api.coralogix.com/mgmt/openapi/aaa/api-keys/v3';

let options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <API_KEY>', 'content-type': 'application/json'},
  body: '{"hashed":true,"keyPermissions":{"permissions":[["read_logs"]],"presets":[["my_preset"]]},"name":"my_api_key","owner":{"userId":"string"}}'
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
{
  "keyId": "my_key_id",
  "name": "my_api_key",
  "value": "my_api_key_value"
}

Authorizations

Authorization
string
header
required

API key authentication

Body

application/json

This data structure is used to create an API key.

hashed
boolean
required
Example:

true

keyPermissions
object
required

This data structure allows to specify loose permissions and permission presets for an API key.

name
string
required
Example:

"my_api_key"

owner
object
required
  • Option 1
  • Option 2
  • Option 3

Response

This data structure is the response obtained when creating an API key.

keyId
string
required
Example:

"my_key_id"

name
string
required
Example:

"my_api_key"

value
string
required
Example:

"my_api_key_value"

I