Skip to main content

ShellHub Community (1.0.0)

Download OpenAPI specification:Download

ShellHub Community documentation.

It documents all routes provided by ShellHub Community.

NOTICE: THE API IS NOT STABLE YET; ERROR AND INCONSISTENCIES MAY OCCUR.

Get info

Get info about ShellHub instance.

query Parameters
agent_version
string

Agent's version.

Responses

Response samples

Content type
application/json
{
  • "version": "latest",
  • "endpoints": {
    }
}

users

Login

Get data about a user

Request Body schema: application/json
username
required
string [ 3 .. 30 ] characters

Username

password
required
string [ 5 .. 30 ] characters

Password

Responses

Request samples

Content type
application/json
{
  • "username": "example",
  • "password": "example"
}

Response samples

Content type
application/json
{
  • "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJleGFtcGxlIiwibmFtZSI6ImV4YW1wbGUiLCJpYXQiOjE1MTYyMzkwMjJ9.zqCt70KspnNnitZlv89hDbFZ5iGMMRUn0wFEmmlY-to",
  • "user": "example",
  • "name": "Example",
  • "id": "507f1f77bcf86cd799439011",
  • "tenant": "3dd0d1f8-8246-4519-b11a-a3dd33717f65",
  • "role": "administrator",
  • "email": "example@example.com"
}

Login

Get data about a user

Request Body schema: application/json
username
required
string [ 3 .. 30 ] characters

Username

password
required
string [ 5 .. 30 ] characters

Password

Responses

Request samples

Content type
application/json
{
  • "username": "example",
  • "password": "example"
}

Response samples

Content type
application/json
{
  • "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJleGFtcGxlIiwibmFtZSI6ImV4YW1wbGUiLCJpYXQiOjE1MTYyMzkwMjJ9.zqCt70KspnNnitZlv89hDbFZ5iGMMRUn0wFEmmlY-to",
  • "user": "example",
  • "name": "Example",
  • "id": "507f1f77bcf86cd799439011",
  • "tenant": "3dd0d1f8-8246-4519-b11a-a3dd33717f65",
  • "role": "administrator",
  • "email": "example@example.com"
}

Get token

Get a token from its tenant.

Authorizations:
jwt
path Parameters
tenant
string

Tenant

Responses

Response samples

Content type
application/json
{
  • "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJleGFtcGxlIiwibmFtZSI6ImV4YW1wbGUiLCJpYXQiOjE1MTYyMzkwMjJ9.zqCt70KspnNnitZlv89hDbFZ5iGMMRUn0wFEmmlY-to",
  • "user": "example",
  • "name": "Example",
  • "id": "507f1f77bcf86cd799439011",
  • "tenant": "3dd0d1f8-8246-4519-b11a-a3dd33717f65",
  • "role": "administrator",
  • "email": "example@example.com"
}

Update user data

Update user's data.

Authorizations:
jwt
path Parameters
id
required
string

User's ID.

Request Body schema: application/json
name
required
string

User's name.

email
required
string <email>

User's e-mail.

username
required
string

User's username.

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "email": "user@example.com",
  • "username": "string"
}

Response samples

Content type
application/json
[
  • "username",
  • "email"
]

Update user password

Update only the user password.

Authorizations:
jwt
path Parameters
id
string

User ID

Request Body schema: application/json
current_password
string

User current password

new_password
string

User new password

Responses

Request samples

Content type
application/json
{
  • "current_password": "string",
  • "new_password": "string"
}

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Set session record

Define if sessions will be recorded.

Authorizations:
jwt
path Parameters
tenant
required
string (namespaceTenantID) ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-4[0-9a-fA-F]...
Example: 3dd0d1f8-8246-4519-b11a-a3dd33717f65

Namespace's tenant ID

Request Body schema: application/json
session_record
boolean
Default: false

Session's record status.

Responses

Request samples

Content type
application/json
{
  • "session_record": false
}

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Get session record

Get status from if session record feature is enable.

Authorizations:
jwt

Responses

Response samples

Content type
application/json
true

devices

Auth device

Auth a device.

Every 30 seconds, this route is hit by internal ShellHub to check device availability.

Authorizations:
jwt
header Parameters
X-Real-IP
string^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,...
Example: 127.0.0.1

Device's IP address.

X-Real-IP header is used to set a geolocation position to device when geoip feature is enable.

Request Body schema: application/json
required
object (deviceInfo)

Device's info

sessions
Array of strings
hostname
required
string([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z...
object (deviceIdentity)

Device's identity

public_key
required
string

Device's public key.

tenant_id
required
string (namespaceTenantID) ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-4[0-9a-fA-F]...

Namespace's tenant ID

Responses

Request samples

Content type
application/json
{
  • "info": {
    },
  • "sessions": [
    ],
  • "hostname": "string",
  • "identity": {
    },
  • "public_key": "string",
  • "tenant_id": "3dd0d1f8-8246-4519-b11a-a3dd33717f65"
}

Response samples

Content type
application/json
{
  • "uid": "13b0c8ea878e61ff849db69461795006a9594c8f6a6390ce0000100b0c9d7d0a",
  • "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.iUCROHt6JHANdtzT6aOuUgOqVFRalOW20SbzRsn5SkI\n",
  • "name": "example",
  • "namespace": "examplespace"
}

Auth device

Auth a device.

Every 30 seconds, this route is hit by internal ShellHub to check device availability.

Authorizations:
jwt
header Parameters
X-Real-IP
string^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,...
Example: 127.0.0.1

Device's IP address.

X-Real-IP header is used to set a geolocation position to device when geoip feature is enable.

Request Body schema: application/json
required
object (deviceInfo)

Device's info

sessions
Array of strings
hostname
required
string([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z...
object (deviceIdentity)

Device's identity

public_key
required
string

Device's public key.

tenant_id
required
string (namespaceTenantID) ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-4[0-9a-fA-F]...

Namespace's tenant ID

Responses

Request samples

Content type
application/json
{
  • "info": {
    },
  • "sessions": [
    ],
  • "hostname": "string",
  • "identity": {
    },
  • "public_key": "string",
  • "tenant_id": "3dd0d1f8-8246-4519-b11a-a3dd33717f65"
}

Response samples

Content type
application/json
{
  • "uid": "13b0c8ea878e61ff849db69461795006a9594c8f6a6390ce0000100b0c9d7d0a",
  • "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.iUCROHt6JHANdtzT6aOuUgOqVFRalOW20SbzRsn5SkI\n",
  • "name": "example",
  • "namespace": "examplespace"
}

Accept device

Change device status to accepted.

Authorizations:
jwt
path Parameters
uid
required
string (deviceUID) ^[0-9a-fA-F]{64}$
Example: 13b0c8ea878e61ff849db69461795006a9594c8f6a6390ce0000100b0c9d7d0a

Device's UID

Responses

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Get devices

Get a list of devices.

Authorizations:
jwt
query Parameters
filter
string^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[...
Example: filter=W3sidHlwZSI6InByb3BlcnR5IiwicGFyYW1zIjp7Im5hbWUiOiJuYW1lIiwib3BlcmF0b3IiOiJjb250YWlucyIsInZhbHVlIjoiZDAifX1d

Device's filter

Filter field receives a base64 enconded JSON object for limit a search. The JSON object should have a property called type, it will filter by a property called name where the value should contains linux.

If you want get only Devices name as Linux, the JSON object will looks like this

  [
    {
      "type":"property",
      "params":
        {
          "name":"name",
          "operator":"contains",
          "value":"linux"
        }
    }
  ]

So, the output encoded string will result on: W3sidHlwZSI6InByb3BlcnR5IiwicGFyYW1zIjp7Im5hbWUiOiJuYW1lIiwib3BlcmF0b3IiOiJjb250YWlucyIsInZhbHVlIjoiZDAifX1d

page
integer >= 1
Default: 1

Pagination page number

per_page
integer >= 1
Default: 10

Pagination items per page

status
string (deviceStatus)
Enum: "accepted" "rejected" "pending" "unused"
Example: status=accepted

Device's status

sort_by
string
Example: sort_by=name

Device's property to sort of

order_by
string
Enum: "asc" "desc"
Example: order_by=asc

Device's list order

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get device

Get a device.

Authorizations:
jwt
path Parameters
uid
required
string (deviceUID) ^[0-9a-fA-F]{64}$
Example: 13b0c8ea878e61ff849db69461795006a9594c8f6a6390ce0000100b0c9d7d0a

Device's UID

Responses

Response samples

Content type
application/json
{
  • "uid": "13b0c8ea878e61ff849db69461795006a9594c8f6a6390ce0000100b0c9d7d0a",
  • "name": "example",
  • "identity": {
    },
  • "info": {
    },
  • "public_key": "-----BEGIN RSA PUBLIC KEY-----MIIBCgKCAQEA0vH2Bob3mn+uWVaHlOoZD8ai01W6VnRTnXlnHVF7Ny1Vb7pl1Hc4D8bsBhb1vt7aZOYHbCyDR2r5lsrWXCELE8pY8vzfFDA+jNrLbBCJ66E1BcmTqfXCJcLospWD2lIAwU2O7IPxwZujuVkHrF8nYuEFsKeG60QTWNS++RTqydqe2KmFMEdWCQmYPm/ykN871fSR9+PzoRJMYWidY6Szn+X2ardGmS/Ldhl/PEu9h7xjcQXANWz6yV/RVReGVkLcK6TxlfuxgdpbsWAx+cS52P7xWrshNefHqjpdlm3KNbo6vqfTpU8Ld/FFISXXaa1Md5GyAHF+jzuRzQ5z5aKBGwIDAQAB-----END RSA PUBLIC KEY-----",
  • "tenant_id": "3dd0d1f8-8246-4519-b11a-a3dd33717f65",
  • "last_seen": "2020-01-01T00:00:00Z",
  • "online": true,
  • "namespace": "examplespace",
  • "status": "accepted",
  • "created_at": "2020-01-01T00:00:00Z",
  • "remote_addr": "127.0.0.1",
  • "position": {
    },
  • "tags": [
    ]
}

Delete device

Delete a device.

Authorizations:
jwt
path Parameters
uid
required
string (deviceUID) ^[0-9a-fA-F]{64}$
Example: 13b0c8ea878e61ff849db69461795006a9594c8f6a6390ce0000100b0c9d7d0a

Device's UID

Responses

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Update device name

Update device's name.

Authorizations:
jwt
path Parameters
uid
required
string (deviceUID) ^[0-9a-fA-F]{64}$
Example: 13b0c8ea878e61ff849db69461795006a9594c8f6a6390ce0000100b0c9d7d0a

Device's UID

Request Body schema: application/json
name
required
string

Device's new name.

Responses

Request samples

Content type
application/json
{
  • "name": "example"
}

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Update device status

Update device's status.

Authorizations:
jwt
path Parameters
uid
required
string (deviceUID) ^[0-9a-fA-F]{64}$
Example: 13b0c8ea878e61ff849db69461795006a9594c8f6a6390ce0000100b0c9d7d0a

Device's UID

status
required
string
Enum: "accept" "reject" "pending" "unused"
Example: accept

Device's status

Responses

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Get stats ShellHub instance

Get stats ShellHub instance.

Authorizations:
jwt

Responses

Response samples

Content type
application/json
{
  • "registered_devices": 0,
  • "online_devices": 0,
  • "pending_devices": 0,
  • "rejected_devices": 0,
  • "active_sessions": 0
}

Create a tag

Create a tag

Authorizations:
jwt
path Parameters
uid
required
string (deviceUID) ^[0-9a-fA-F]{64}$
Example: 13b0c8ea878e61ff849db69461795006a9594c8f6a6390ce0000100b0c9d7d0a

Device's UID

Request Body schema: application/json
tag
required
string (tag) [ 3 .. 255 ] characters

Tag's name.

Responses

Request samples

Content type
application/json
{
  • "tag": "tag1"
}

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Update tags to device

Update tags to device

Authorizations:
jwt
path Parameters
uid
required
string (deviceUID) ^[0-9a-fA-F]{64}$
Example: 13b0c8ea878e61ff849db69461795006a9594c8f6a6390ce0000100b0c9d7d0a

Device's UID

Request Body schema: application/json
tags
required
Array of strings (deviceTags) [ 1 .. 3 ] items [ items [ 3 .. 255 ] characters ]

Device's Tags list

Responses

Request samples

Content type
application/json
{
  • "tags": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Delete a tag from device

Delete a tag from device.

Authorizations:
jwt
path Parameters
uid
required
string (deviceUID) ^[0-9a-fA-F]{64}$
Example: 13b0c8ea878e61ff849db69461795006a9594c8f6a6390ce0000100b0c9d7d0a

Device's UID

tag
required
string (tag) [ 3 .. 255 ] characters
Example: tag

Device's tag name

Responses

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

ssh

Set SSH key

Set a SSH public key.

Authorizations:
jwt
Request Body schema: application/json
fingerprint
string

Device fingerprint

data
string

Device SSH public key

Responses

Request samples

Content type
application/json
{
  • "fingerprint": "string",
  • "data": "string"
}

Response samples

Content type
application/json
{
  • "signature": "string"
}

Get public keys

Get a list from all public keys.

Authorizations:
jwt
query Parameters
filter
string <byte>

Filter field receives a base64 enconded JSON object for limit a search. The JSON object should have a property called type, it will filter by a property called confirmed where the value is eq to true.

This is a example to filter and get only the confirmed users.


[
  {
  "type": "property",
  "params": {
      "name": "confirmed",
      "operator": "eq",
      "value": true
      }
  }
]

So, the output enconded string will result on:

WwogICAgewogICAgInR5cGUiOiAicHJvcGVydHkiLAogICAgInBhcmFtcyI6IHsKICAgICAgICAibmFtZSI6ICJjb25maXJtZWQiLAogICAgICAgICJvcGVyYXRvciI6ICJlcSIsCiAgICAgICAgInZhbHVlIjogdHJ1ZQogICAgICAgIH0KICAgIH0KXQ==

page
integer >= 1
Default: 1

Pagination page number

per_page
integer >= 1
Default: 10

Pagination items per page

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create public key

Create a new public key.

Authorizations:
jwt
Request Body schema: application/json
data
required
string (publicKeyData) ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[...

Public key's data.

The data field receives the public key enconded as base64 string.

required
object or object (publicKeyFilter)

Public key's filter rule.

The `filter`` rule defines how if the public key is valid to a device.

  • When hostname object is set, the public key will be used in a device what matches with hostname.
  • When tags object is set, it matches the device what contains at least one of that tags.
name
required
string

Public key's name.

username
required
string (publicKeyUsername)

Public key's regex username.

The username field define which user, in the device, may be access through this public key.

Responses

Request samples

Content type
application/json
{
  • "data": "c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDWWdqRkNQUWdPejBEZ0VQQUh3blEyMGYzRUlGYjd2SkNtd1YxR25uRTU2K0htaGgyY295c3o5MnZqMW9GeElxQUlKZUZxU3lQNWwzbDZjbkFUVmxhZ2MxR21OQm5vQ0NZSlpicXdOVUFiM3RMTXdiOXBaSGVWMFczWVl4OERBSVVsL2ZYaVVhQTNpQk5BcTFrczFzYjZjbVN1VmYwTVNTSjdoOXU3c2Y2RnkyVmQ0U1FqSGd3YmNvSUY1Q0kyWkZlMEx6NTNWeGQwVlZRZG5ISGNBeldRVFlTMDIxcmVXeG5QR2RRdytmWXpCRWdRMG5sTmFzQXBRc1pVUXRPZ0t4TlNFcVJ0VnJiRUR4WisrTllQaWFuNUdSZ0huZWNUUzBaVGNjZjM4SDZYTms1Qm5XWGlEN2RCWlJBRnZ1UjBkWEF1cU9mYUM3SVl5MVJnS1lkdEsrUnY=",
  • "filter": {
    },
  • "name": "example",
  • "username": ".*"
}

Response samples

Content type
application/json
{
  • "data": "c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDWWdqRkNQUWdPejBEZ0VQQUh3blEyMGYzRUlGYjd2SkNtd1YxR25uRTU2K0htaGgyY295c3o5MnZqMW9GeElxQUlKZUZxU3lQNWwzbDZjbkFUVmxhZ2MxR21OQm5vQ0NZSlpicXdOVUFiM3RMTXdiOXBaSGVWMFczWVl4OERBSVVsL2ZYaVVhQTNpQk5BcTFrczFzYjZjbVN1VmYwTVNTSjdoOXU3c2Y2RnkyVmQ0U1FqSGd3YmNvSUY1Q0kyWkZlMEx6NTNWeGQwVlZRZG5ISGNBeldRVFlTMDIxcmVXeG5QR2RRdytmWXpCRWdRMG5sTmFzQXBRc1pVUXRPZ0t4TlNFcVJ0VnJiRUR4WisrTllQaWFuNUdSZ0huZWNUUzBaVGNjZjM4SDZYTms1Qm5XWGlEN2RCWlJBRnZ1UjBkWEF1cU9mYUM3SVl5MVJnS1lkdEsrUnY=",
  • "fingerprint": "48:6e:fc:94:01:01:74:57:eb:57:49:91:15:e4:9c:7a",
  • "tenant_id": "3dd0d1f8-8246-4519-b11a-a3dd33717f65",
  • "name": "example",
  • "filter": {
    },
  • "username": ".*"
}

Update public key

Update a public key.

Authorizations:
jwt
path Parameters
fingerprint
required
string (publickKeyFingerprint) ^([0-9a-f]{2}:){15}[0-9a-f]{2}$
Example: 48:6e:fc:94:01:01:74:57:eb:57:49:91:15:e4:9c:7a

Public key's fingerprint.

Request Body schema: application/json
name
required
string

Public key's name.

username
required
string

Public key's username.

required
object or object (publicKeyFilter)

Public key's filter rule.

The `filter`` rule defines how if the public key is valid to a device.

  • When hostname object is set, the public key will be used in a device what matches with hostname.
  • When tags object is set, it matches the device what contains at least one of that tags.

Responses

Request samples

Content type
application/json
{
  • "name": "example",
  • "username": "example",
  • "filter": {
    }
}

Response samples

Content type
application/json
{
  • "data": "c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDWWdqRkNQUWdPejBEZ0VQQUh3blEyMGYzRUlGYjd2SkNtd1YxR25uRTU2K0htaGgyY295c3o5MnZqMW9GeElxQUlKZUZxU3lQNWwzbDZjbkFUVmxhZ2MxR21OQm5vQ0NZSlpicXdOVUFiM3RMTXdiOXBaSGVWMFczWVl4OERBSVVsL2ZYaVVhQTNpQk5BcTFrczFzYjZjbVN1VmYwTVNTSjdoOXU3c2Y2RnkyVmQ0U1FqSGd3YmNvSUY1Q0kyWkZlMEx6NTNWeGQwVlZRZG5ISGNBeldRVFlTMDIxcmVXeG5QR2RRdytmWXpCRWdRMG5sTmFzQXBRc1pVUXRPZ0t4TlNFcVJ0VnJiRUR4WisrTllQaWFuNUdSZ0huZWNUUzBaVGNjZjM4SDZYTms1Qm5XWGlEN2RCWlJBRnZ1UjBkWEF1cU9mYUM3SVl5MVJnS1lkdEsrUnY=",
  • "fingerprint": "48:6e:fc:94:01:01:74:57:eb:57:49:91:15:e4:9c:7a",
  • "created_at": "2020-05-01T00:00:00.000Z",
  • "tenant_id": "3dd0d1f8-8246-4519-b11a-a3dd33717f65",
  • "name": "example",
  • "filter": {
    },
  • "username": ".*"
}

Delete public key

Delete a public key.

Authorizations:
jwt
path Parameters
fingerprint
required
string (publickKeyFingerprint) ^([0-9a-f]{2}:){15}[0-9a-f]{2}$
Example: 48:6e:fc:94:01:01:74:57:eb:57:49:91:15:e4:9c:7a

Public key's fingerprint.

Responses

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Add tag public key

Add a tag to a public key.

Authorizations:
jwt
path Parameters
fingerprint
required
string (publickKeyFingerprint) ^([0-9a-f]{2}:){15}[0-9a-f]{2}$
Example: 48:6e:fc:94:01:01:74:57:eb:57:49:91:15:e4:9c:7a

Public key's fingerprint.

Request Body schema: application/json
tag
required
string (tag) [ 3 .. 255 ] characters

Tag's name.

Responses

Request samples

Content type
application/json
{
  • "tag": "tag"
}

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Update tags public key

Update all tags in a public key.

Authorizations:
jwt
path Parameters
fingerprint
required
string (publickKeyFingerprint) ^([0-9a-f]{2}:){15}[0-9a-f]{2}$
Example: 48:6e:fc:94:01:01:74:57:eb:57:49:91:15:e4:9c:7a

Public key's fingerprint.

Request Body schema: application/json
tags
Array of strings (tag) [ 1 .. 3 ] items unique [ items [ 3 .. 255 ] characters ]

Public key's new tags.

Responses

Request samples

Content type
application/json
{
  • "tags": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Remove tag public key

Remove a tag from public key.

Authorizations:
jwt
path Parameters
fingerprint
required
string (publickKeyFingerprint) ^([0-9a-f]{2}:){15}[0-9a-f]{2}$
Example: 48:6e:fc:94:01:01:74:57:eb:57:49:91:15:e4:9c:7a

Public key's fingerprint.

tag
required
string (tag) [ 3 .. 255 ] characters
Example: tag

Tag's name.

Responses

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

namespaces

Get a new namespace's token

This route works like a login's one; returns a JWT token and extra information about namespace.

You can use this route to swap between namespaces.

Authorizations:
jwt
path Parameters
tenant
required
string (namespaceTenantID) ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-4[0-9a-fA-F]...
Example: 3dd0d1f8-8246-4519-b11a-a3dd33717f65

Namespace's tenant ID

Responses

Response samples

Content type
application/json
{
  • "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJleGFtcGxlIiwibmFtZSI6ImV4YW1wbGUiLCJpYXQiOjE1MTYyMzkwMjJ9.zqCt70KspnNnitZlv89hDbFZ5iGMMRUn0wFEmmlY-to",
  • "user": "example",
  • "name": "Example",
  • "id": "507f1f77bcf86cd799439011",
  • "tenant": "3dd0d1f8-8246-4519-b11a-a3dd33717f65",
  • "role": "administrator",
  • "email": "example@example.com"
}

Get namespaces list

Returns a list of namespaces.

Authorizations:
jwt
query Parameters
filter
string^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[...
Example: filter=W3sidHlwZSI6InByb3BlcnR5IiwicGFyYW1zIjp7Im5hbWUiOiJuYW1lIiwib3BlcmF0b3IiOiJjb250YWlucyIsInZhbHVlIjoiZXhhbXBsZXNwYWNlIn19XQ==

Namespaces's filter.

Filter field receives a base64 enconded JSON object for limit a search. The JSON object should have a property called type, it will filter by a property called name where the value should contains examplespace.

If you want get only Namespaces name as examplespace, the JSON object will looks like this

[
  {
    "type":"property",
    "params":{
      "name":"name",
      "operator":"contains",
      "value":"examplespace"
    }
  }
]

So, the output encoded string will result on: W3sidHlwZSI6InByb3BlcnR5IiwicGFyYW1zIjp7Im5hbWUiOiJuYW1lIiwib3BlcmF0b3IiOiJjb250YWlucyIsInZhbHVlIjoiZXhhbXBsZXNwYWNlIn19XQ==

page
integer >= 1
Default: 1

Pagination page number

per_page
integer >= 1
Default: 10

Pagination items per page

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create namespace

Create a namespace.

Authorizations:
jwt
Request Body schema: application/json
name
required
string (namespaceName)

Namespace's name

Responses

Request samples

Content type
application/json
{
  • "name": "examplespace"
}

Response samples

Content type
application/json
{
  • "name": "examplespace",
  • "owner": "507f1f77bcf86cd799439011",
  • "tenant_id": "3dd0d1f8-8246-4519-b11a-a3dd33717f65",
  • "members": [
    ],
  • "settings": {
    },
  • "max_devices": 3,
  • "device_count": 0,
  • "created_at": "2020-05-01T00:00:00.000Z",
  • "billing": null
}

Get a namespace

Get a namespace.

Authorizations:
jwt
path Parameters
tenant
required
string (namespaceTenantID) ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-4[0-9a-fA-F]...
Example: 3dd0d1f8-8246-4519-b11a-a3dd33717f65

Namespace's tenant ID

Responses

Response samples

Content type
application/json
{
  • "name": "examplespace",
  • "owner": "507f1f77bcf86cd799439011",
  • "tenant_id": "3dd0d1f8-8246-4519-b11a-a3dd33717f65",
  • "members": [
    ],
  • "settings": {
    },
  • "max_devices": 3,
  • "device_count": 0,
  • "created_at": "2020-05-01T00:00:00.000Z",
  • "billing": null
}

Edit namespace

Edit a namespace.

Authorizations:
jwt
path Parameters
tenant
required
string (namespaceTenantID) ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-4[0-9a-fA-F]...
Example: 3dd0d1f8-8246-4519-b11a-a3dd33717f65

Namespace's tenant ID

Request Body schema: application/json
name
required
string (namespaceName)

Namespace's name

Responses

Request samples

Content type
application/json
{
  • "name": "examplespace"
}

Response samples

Content type
application/json
{
  • "name": "examplespace",
  • "owner": "507f1f77bcf86cd799439011",
  • "tenant_id": "3dd0d1f8-8246-4519-b11a-a3dd33717f65",
  • "members": [
    ],
  • "settings": {
    },
  • "max_devices": 3,
  • "device_count": 0,
  • "created_at": "2020-05-01T00:00:00.000Z",
  • "billing": null
}

Delete namespace

Delete a namespace.

Authorizations:
jwt
path Parameters
tenant
required
string (namespaceTenantID) ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-4[0-9a-fA-F]...
Example: 3dd0d1f8-8246-4519-b11a-a3dd33717f65

Namespace's tenant ID

Responses

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Add a member to a namespace

Add a member to a namespace.

Authorizations:
jwt
path Parameters
tenant
required
string (namespaceTenantID) ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-4[0-9a-fA-F]...
Example: 3dd0d1f8-8246-4519-b11a-a3dd33717f65

Namespace's tenant ID

Request Body schema: application/json
username
required
string

Member's username.

role
required
string (namespaceMemberRole)
Enum: "administrator" "operator" "observer" "owner"

Namespace's member role

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "role": "administrator"
}

Response samples

Content type
application/json
{
  • "name": "examplespace",
  • "owner": "507f1f77bcf86cd799439011",
  • "tenant_id": "3dd0d1f8-8246-4519-b11a-a3dd33717f65",
  • "members": [
    ],
  • "settings": {
    },
  • "max_devices": 3,
  • "device_count": 0,
  • "created_at": "2020-05-01T00:00:00.000Z",
  • "billing": null
}

Remove a member from a namespace

Remove a member from a namespace.

Authorizations:
jwt
path Parameters
tenant
required
string (namespaceTenantID) ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-4[0-9a-fA-F]...
Example: 3dd0d1f8-8246-4519-b11a-a3dd33717f65

Namespace's tenant ID

uid
required
string

Member's ID

Responses

Response samples

Content type
application/json
{
  • "name": "examplespace",
  • "owner": "507f1f77bcf86cd799439011",
  • "tenant_id": "3dd0d1f8-8246-4519-b11a-a3dd33717f65",
  • "members": [
    ],
  • "settings": {
    },
  • "max_devices": 3,
  • "device_count": 0,
  • "created_at": "2020-05-01T00:00:00.000Z",
  • "billing": null
}

Update a member from a namespace

Update a member role from a namespace.

Authorizations:
jwt
path Parameters
tenant
required
string (namespaceTenantID) ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-4[0-9a-fA-F]...
Example: 3dd0d1f8-8246-4519-b11a-a3dd33717f65

Namespace's tenant ID

uid
required
string

Member's ID

Request Body schema: application/json
role
string (namespaceMemberRole)
Enum: "administrator" "operator" "observer" "owner"

Namespace's member role

Responses

Request samples

Content type
application/json
{
  • "role": "administrator"
}

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

sessions

Set session record

Define if sessions will be recorded.

Authorizations:
jwt
path Parameters
tenant
required
string (namespaceTenantID) ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-4[0-9a-fA-F]...
Example: 3dd0d1f8-8246-4519-b11a-a3dd33717f65

Namespace's tenant ID

Request Body schema: application/json
session_record
boolean
Default: false

Session's record status.

Responses

Request samples

Content type
application/json
{
  • "session_record": false
}

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Get session record

Get status from if session record feature is enable.

Authorizations:
jwt

Responses

Response samples

Content type
application/json
true

Get sessions

Get a list sessions.

Authorizations:
jwt
query Parameters
page
integer >= 1
Default: 1

Pagination page number

per_page
integer >= 1
Default: 10

Pagination items per page

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get session

Get a session.

Authorizations:
jwt
path Parameters
uid
required
string (sessionUID) ^[0-9a-fA-F]{64}$
Example: 13b0c8ea878e61ff849db69461795006a9594c8f6a6390ce0000100b0c9d7d0a

Session's UID

Responses

Response samples

Content type
application/json
{
  • "uid": "13b0c8ea878e61ff849db69461795006a9594c8f6a6390ce0000100b0c9d7d0a",
  • "device_uid": "13b0c8ea878e61ff849db69461795006a9594c8f6a6390ce0000100b0c9d7d0a",
  • "device": {
    },
  • "tenant_id": "3dd0d1f8-8246-4519-b11a-a3dd33717f65",
  • "username": "string",
  • "ip_address": "127.0.0.1",
  • "started_at": "2020-01-01T00:00:00Z",
  • "last_seen": "2020-01-01T00:00:00Z",
  • "active": true,
  • "authenticated": true,
  • "recorded": true,
  • "type": "web",
  • "term": "xterm.js",
  • "position": {
    }
}

Set session authentication status

Set session authentication status.

Authorizations:
jwt
path Parameters
uid
required
string (sessionUID) ^[0-9a-fA-F]{64}$
Example: 13b0c8ea878e61ff849db69461795006a9594c8f6a6390ce0000100b0c9d7d0a

Session's UID

Request Body schema: application/json
authenticated
boolean

Session's authentication status.

Responses

Request samples

Content type
application/json
{
  • "authenticated": true
}

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

tags

Add tag public key

Add a tag to a public key.

Authorizations:
jwt
path Parameters
fingerprint
required
string (publickKeyFingerprint) ^([0-9a-f]{2}:){15}[0-9a-f]{2}$
Example: 48:6e:fc:94:01:01:74:57:eb:57:49:91:15:e4:9c:7a

Public key's fingerprint.

Request Body schema: application/json
tag
required
string (tag) [ 3 .. 255 ] characters

Tag's name.

Responses

Request samples

Content type
application/json
{
  • "tag": "tag"
}

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Update tags public key

Update all tags in a public key.

Authorizations:
jwt
path Parameters
fingerprint
required
string (publickKeyFingerprint) ^([0-9a-f]{2}:){15}[0-9a-f]{2}$
Example: 48:6e:fc:94:01:01:74:57:eb:57:49:91:15:e4:9c:7a

Public key's fingerprint.

Request Body schema: application/json
tags
Array of strings (tag) [ 1 .. 3 ] items unique [ items [ 3 .. 255 ] characters ]

Public key's new tags.

Responses

Request samples

Content type
application/json
{
  • "tags": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Remove tag public key

Remove a tag from public key.

Authorizations:
jwt
path Parameters
fingerprint
required
string (publickKeyFingerprint) ^([0-9a-f]{2}:){15}[0-9a-f]{2}$
Example: 48:6e:fc:94:01:01:74:57:eb:57:49:91:15:e4:9c:7a

Public key's fingerprint.

tag
required
string (tag) [ 3 .. 255 ] characters
Example: tag

Tag's name.

Responses

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Create a tag

Create a tag

Authorizations:
jwt
path Parameters
uid
required
string (deviceUID) ^[0-9a-fA-F]{64}$
Example: 13b0c8ea878e61ff849db69461795006a9594c8f6a6390ce0000100b0c9d7d0a

Device's UID

Request Body schema: application/json
tag
required
string (tag) [ 3 .. 255 ] characters

Tag's name.

Responses

Request samples

Content type
application/json
{
  • "tag": "tag1"
}

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Update tags to device

Update tags to device

Authorizations:
jwt
path Parameters
uid
required
string (deviceUID) ^[0-9a-fA-F]{64}$
Example: 13b0c8ea878e61ff849db69461795006a9594c8f6a6390ce0000100b0c9d7d0a

Device's UID

Request Body schema: application/json
tags
required
Array of strings (deviceTags) [ 1 .. 3 ] items [ items [ 3 .. 255 ] characters ]

Device's Tags list

Responses

Request samples

Content type
application/json
{
  • "tags": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Delete a tag from device

Delete a tag from device.

Authorizations:
jwt
path Parameters
uid
required
string (deviceUID) ^[0-9a-fA-F]{64}$
Example: 13b0c8ea878e61ff849db69461795006a9594c8f6a6390ce0000100b0c9d7d0a

Device's UID

tag
required
string (tag) [ 3 .. 255 ] characters
Example: tag

Device's tag name

Responses

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Get tags

Authorizations:
jwt

Responses

Response samples

Content type
application/json
[
  • "tag1",
  • "tag2",
  • "tag3",
  • "tag4"
]

Rename a tag name.

Authorizations:
jwt
path Parameters
tag
required
string (tag) [ 3 .. 255 ] characters
Example: tag

Tag's name.

Request Body schema: application/json
tag
string (tag) [ 3 .. 255 ] characters

Tag's name.

Responses

Request samples

Content type
application/json
{
  • "tag": "tag"
}

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}

Delete a tag name.

Authorizations:
jwt
path Parameters
tag
required
string (tag) [ 3 .. 255 ] characters
Example: tag

Tag's name.

Responses

Response samples

Content type
application/json
{
  • "message": "missing or malformated jwt"
}