Reports API
Pull tenant transaction reports and downloadable exports.
The Reports service exposes tenant reporting and exports — pull transaction reports per tenant and download datasets for analytics and compliance.
27 endpoints
across 9 resource groups.
ECDSA-signed
every request is signed with your key pair.
JSON over HTTPS
predictable REST, conventional status codes.
OpenAPI 3.0
Base URL
All Reports endpoints are relative to your environment host. Examples on this page use the 1Kosmos pilot environment — swap in your production root when you go live.
Content type
Requests and responses use application/json.
curl -X GET 'https://pilot-root.1kosmos.net/reports/healthz' \ -H 'authMyPublicKey: YOUR_PUBLIC_KEY' \ -H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \ -H 'authLicense: YOUR_LICENSE_KEY'
Authentication
Reports uses ECDSA key-pair authentication. Each request carries your credentials as
HTTP headers; verification-grade calls additionally sign the request body. Retrieve the system signing
key from /publickeys.
curl -X GET 'https://pilot-root.1kosmos.net/reports/healthz' \ -H 'authMyPublicKey: YOUR_PUBLIC_KEY' \ -H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \ -H 'authLicense: YOUR_LICENSE_KEY'
const res = await fetch("https://pilot-root.1kosmos.net/reports/healthz", {
method: "GET",
headers: {
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
}
});
const data = await res.json();import requests
res = requests.get(
"https://pilot-root.1kosmos.net/reports/healthz",
headers={
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
}
)
print(res.json())Errors
Reports uses conventional HTTP status codes: 2xx success, 4xx a problem
with the request, 5xx a service-side error.
| Status | Meaning | Description |
|---|---|---|
| 200 / 204 | OK | The request succeeded. |
| 400 | Bad Request | Validation failed. |
| 401 | Unauthorized | Missing or invalid credentials. |
| 403 | Forbidden | Authenticated, but not permitted. |
| 404 | Not Found | The resource does not exist. |
| 500 | Server Error | Something went wrong on our side. |
{
"statusCode": 400,
"error": "Bad Request",
"message": "Validation error"
}Tenant
Per-tenant reports.
Application Usage report
This report searches in DB index formed from tenantId and communityId (index: tenantId.communityId) and collects all unique users with serviceProvider (unique tuples) where eventName = E_LOGIN_ATTEMPT and each record has latest_login and last_login (latest_login - 1, this can be null because there can be only 1 login attemp). Each tuple serviceProvider | user_id should get 1 row with number of person_id in it - person_id_count. Results are chronological, sorted by latest_login. Results are also in specified time range (from, to) and are paginated (pSize, pIndex).
Parameters
tenantId (required)
The id of tenant
communityId (required)
The id of community
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Request Body
pSize (optional)
The maximum number of hits to return default = 25, min = 1, max = 100
pIndex (optional)
Number of hits to skip default = 0
from (optional)
timestamp, default = current date - 30 days, max = current date - 90 days
to (optional)
timestamp, default = current
serviceProvider (optional)
string, optional filter
user_id (optional)
User id, string , optional filter
person_id (optional)
Person id, string, optional filter
Returns
Returns object with page info and data
| Name | Type | Description |
|---|---|---|
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
Data to filter elastic raws
| Field | Type | Description |
|---|---|---|
| pSize | Number | A limit on the number of objects to be returned. Default is 25 |
| pIndex | Number | The pIndex key is a cursor for the pagination. |
| from | string | Date from which to start the search |
| to | string | date to end the search |
| serviceProvider | string | optional filter |
curl -X POST 'https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/application_usage_report' \
-H 'licensekey: YOUR_LICENSE_KEY' \
-H 'requestid: <ecdsa-requestid>' \
-H 'publickey: <public-key>' \
-H 'authMyPublicKey: YOUR_PUBLIC_KEY' \
-H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \
-H 'authLicense: YOUR_LICENSE_KEY' \
-H 'Content-Type: application/json' \
-d '{"pSize": 10, "pIndex": 0, "from": "2021-02-01 00:00:00.000", "to": "2021-04-01 00:00:00.000", "serviceProvider": "string"}'const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/application_usage_report", {
method: "POST",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"pSize": 10,
"pIndex": 0,
"from": "2021-02-01 00:00:00.000",
"to": "2021-04-01 00:00:00.000",
"serviceProvider": "string"
})
});
const data = await res.json();import requests
res = requests.post(
"https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/application_usage_report",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
},
json={
"pSize": 10,
"pIndex": 0,
"from": "2021-02-01 00:00:00.000",
"to": "2021-04-01 00:00:00.000",
"serviceProvider": "string"
},
)
print(res.json())// no response body
// no response body
Audit Log Report
This report searches in DB and collects all events (unique tuples) where eventCategory = 'AUDIT_LOG'. Results are in reverse chronological order, by latest event_ts. Results are also in specified time range (from, to) and are paginated (pSize, pIndex).
AUDIT_LOG events
<b>E_DIRECTORY_ADDED, E_DIRECTORY_MODIFIED, E_DIRECTORY_REMOVED, E_DIRECTORY_BROKER_ENABLED, E_DIRECTORY_BROKER_DISABLED, E_DIRECTORY_BROKER_DELETED, E_DIRECTORY_BROKER_MODIFIED, E_DIRECTORY_ATTRIBUTE_ADDED, E_DIRECTORY_ATTRIBUTE_MODIFIED, E_DIRECTORY_ATTRIBUTE_DELETED, E_DIRECTORY_ADVANCED_CONFIGURATION_MODIFIED, E_IDP_CONFIGURATION_MODIFIED</b>
Parameters
tenantId (required)
The id of tenant
communityId (required)
The id of community
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Request Body
pSize (optional)
The maximum number of hits to return default = 25, min = 1, max = 100
pIndex (optional)
Number of hits to skip default = 0
from (optional)
timestamp, default = now - 24 hours, max = current date - 90 days
to (optional)
timestamp, default = now
user_id (optional)
User id, string, optional filter
Returns
Returns object with page info and data
| Name | Type | Description |
|---|---|---|
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
Data to filter raws.
This report is downloadable. To request download, please add to request body below full object |
"download": {
"requestBy": "string, email (required)",
"notificationList": [ "string, email (required, 1-5 emails)" ],
"eventData": {
"tenant_dns": "string (required)",
"user_id": "string (required)"
}
}
Download works with pIndex and fetches up to 5000 records, generates CSV file and notifies provided emails that report is ready to download
| Field | Type | Description |
|---|---|---|
| pSize | Number | A limit on the number of objects to be returned. Default is 25 |
| pIndex | Number | The pIndex key is a cursor for the pagination. |
| user_id | string | optional filter |
| from | string | Date from which to start the search |
| to | string | date to end the search |
curl -X POST 'https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/audit_log' \
-H 'licensekey: YOUR_LICENSE_KEY' \
-H 'requestid: <ecdsa-requestid>' \
-H 'publickey: <public-key>' \
-H 'authMyPublicKey: YOUR_PUBLIC_KEY' \
-H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \
-H 'authLicense: YOUR_LICENSE_KEY' \
-H 'Content-Type: application/json' \
-d '{"pSize": 25, "pIndex": 0, "user_id": "string", "from": "2022-12-19 00:00:00.000", "to": "2022-12-31 00:00:00.000"}'const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/audit_log", {
method: "POST",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"pSize": 25,
"pIndex": 0,
"user_id": "string",
"from": "2022-12-19 00:00:00.000",
"to": "2022-12-31 00:00:00.000"
})
});
const data = await res.json();import requests
res = requests.post(
"https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/audit_log",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
},
json={
"pSize": 25,
"pIndex": 0,
"user_id": "string",
"from": "2022-12-19 00:00:00.000",
"to": "2022-12-31 00:00:00.000"
},
)
print(res.json())// no response body
// no response body
Get Download Jobs
Get Download Jobs with sort and pagination
Parameters
tenantId (required)
The id of tenant
communityId (required)
The id of community
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Returns
Returns object with page info and data
| Name | Type | Description |
|---|---|---|
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
Data to sort and paginate download jobs
All fields are optional
By default: sort is undefined, pSize is 10, pIndex is 0
| Field | Type | Description |
|---|---|---|
| sort | array<object> | — |
| pSize | number | — |
| pIndex | number | — |
curl -X POST 'https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/download/jobs' \
-H 'licensekey: YOUR_LICENSE_KEY' \
-H 'requestid: <ecdsa-requestid>' \
-H 'publickey: <public-key>' \
-H 'authMyPublicKey: YOUR_PUBLIC_KEY' \
-H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \
-H 'authLicense: YOUR_LICENSE_KEY' \
-H 'Content-Type: application/json' \
-d '{"sort": [{"field": "field", "order": "desc/asc"}], "pSize": 10, "pIndex": 0}'const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/download/jobs", {
method: "POST",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"sort": [
{
"field": "field",
"order": "desc/asc"
}
],
"pSize": 10,
"pIndex": 0
})
});
const data = await res.json();import requests
res = requests.post(
"https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/download/jobs",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
},
json={
"sort": [
{
"field": "field",
"order": "desc/asc"
}
],
"pSize": 10,
"pIndex": 0
},
)
print(res.json()){
"page": {
"pSize": 10,
"pIndex": 0,
"total": 120
},
"data": [
{
"jobId": "jobId",
"createdAt": 1231242412421,
"completedAt": 1231242412421,
"status": "status",
"requestedBy": "string",
"sendNotificationTo": [
"string"
],
"size": 1234,
"downloadLink": "https://dns..."
}
]
}// no response body
// no response body
Get Events
This report searches in DB and returns all events 'as they are', not processed. Results are chronological and they are also in specified time range (from, to) and are paginated (pSize, pIndex).
This report is downloadable, please check request body for more information.
Parameters
tenantId (required)
The id of tenant
communityId (required)
The id of community
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Request Body
pSize (optional)
The maximum number of hits to return default = 25, min = 1, max = 100
pIndex (optional)
Number of hits to skip default = 0
from (optional)
timestamp, default = current date - 30 days, max = current date - 90 days
to (optional)
timestamp, default = current
query (optional)
a formatted query object to allow caller to run custom pre-formatted-queries and will run the query AS-IS to the DB.
IMPORTANT: All other fields are optional filters, you can search by any field you want
Returns
Returns object with page info and data
| Name | Type | Description |
|---|---|---|
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
Data to filter raws.
This report is downloadable. To request download, please add to request body below full object |
"download": {
"requestBy": "string, email (required)",
"notificationList": [ "string, email (required, 1-5 emails)" ],
"eventData": {
"tenant_dns": "string (required)",
"user_id": "string (required)"
}
}
Download works with pIndex and fetches up to 5000 records, generates CSV file and notifies provided emails that report is ready to download
| Field | Type | Description |
|---|---|---|
| pSize | Number | A limit on the number of objects to be returned. Default is 25 |
| pIndex | Number | The pIndex key is a cursor for the pagination. |
| from | string | Date from which to start the search |
| to | string | date to end the search |
| query | object | — |
curl -X POST 'https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/events' \
-H 'licensekey: YOUR_LICENSE_KEY' \
-H 'requestid: <ecdsa-requestid>' \
-H 'publickey: <public-key>' \
-H 'authMyPublicKey: YOUR_PUBLIC_KEY' \
-H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \
-H 'authLicense: YOUR_LICENSE_KEY' \
-H 'Content-Type: application/json' \
-d '{"pSize": 10, "pIndex": 0, "from": "2021-02-01 00:00:00.000", "to": "2021-02-01 00:00:00.000", "query": {"event_name": "E_LOGIN_SUCCEEDED", "eventData.user_firstname": "xxx"}}'const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/events", {
method: "POST",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"pSize": 10,
"pIndex": 0,
"from": "2021-02-01 00:00:00.000",
"to": "2021-02-01 00:00:00.000",
"query": {
"event_name": "E_LOGIN_SUCCEEDED",
"eventData.user_firstname": "xxx"
}
})
});
const data = await res.json();import requests
res = requests.post(
"https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/events",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
},
json={
"pSize": 10,
"pIndex": 0,
"from": "2021-02-01 00:00:00.000",
"to": "2021-02-01 00:00:00.000",
"query": {
"event_name": "E_LOGIN_SUCCEEDED",
"eventData.user_firstname": "xxx"
}
},
)
print(res.json())// no response body
// no response body
Get Hardware tokens or user assignment tokens export report
This report fetches hardware tokens or user assignment tokens from adminconsole .
This report is downloadable, please check request body for more information.
Parameters
tenantId (required)
The id of tenant
communityId (required)
The id of community
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Request Body
reports_type
type of reports to be exported
query (optional)
a formatted query object to allow caller to run custom pre-formatted-queries.
download
an object with details - notification list array, requestedBy email string and eventData object
Returns
Returns jobId
| Name | Type | Description |
|---|---|---|
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
Data to filter raws.
This report is downloadable. To request download, please add to request body below full object |
{
"reports_type": "xxxxxx",
"query": {
"searchStr" : "xxxxx"
},
"download": {
"notificationList": [
"email@1kosmos.com"
],
"requestBy": "email@1kosmos.com",
"eventData": {
"user_id": "xxxxxxxxxxxx",
"tenant_dns": "1k-dev.1kosmos.net",
"community_name":"",
"caller_ip":""
}
}
}| Field | Type | Description |
|---|---|---|
| reports_type | string | — |
| query | object | — |
| download | object | — |
curl -X POST 'https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/hardwaretokens_export' \
-H 'licensekey: YOUR_LICENSE_KEY' \
-H 'requestid: <ecdsa-requestid>' \
-H 'publickey: <public-key>' \
-H 'authMyPublicKey: YOUR_PUBLIC_KEY' \
-H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \
-H 'authLicense: YOUR_LICENSE_KEY' \
-H 'Content-Type: application/json' \
-d '{"reports_type": "hardware_tokens or user_hardwaretokens", "query": {}, "download": {"notificationList": ["email@1kosmos.com"], "requestBy": "email@1kosmos.com", "eventData": {"user_id": "xxxxxxxxxxxx", "community_name": "xxxxxxxxxxxx", "caller_ip": "xxxxxxxxxxxx", "tenant_dns": "1k-dev.1kosmos.net"}}}'const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/hardwaretokens_export", {
method: "POST",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"reports_type": "hardware_tokens or user_hardwaretokens",
"query": {},
"download": {
"notificationList": [
"email@1kosmos.com"
],
"requestBy": "email@1kosmos.com",
"eventData": {
"user_id": "xxxxxxxxxxxx",
"community_name": "xxxxxxxxxxxx",
"caller_ip": "xxxxxxxxxxxx",
"tenant_dns": "1k-dev.1kosmos.net"
}
}
})
});
const data = await res.json();import requests
res = requests.post(
"https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/hardwaretokens_export",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
},
json={
"reports_type": "hardware_tokens or user_hardwaretokens",
"query": {},
"download": {
"notificationList": [
"email@1kosmos.com"
],
"requestBy": "email@1kosmos.com",
"eventData": {
"user_id": "xxxxxxxxxxxx",
"community_name": "xxxxxxxxxxxx",
"caller_ip": "xxxxxxxxxxxx",
"tenant_dns": "1k-dev.1kosmos.net"
}
}
},
)
print(res.json())// no response body
// no response body
Create job
Creates a job in DB. You can send any job data in request body
Parameters
tenantId (required)
The id of tenant
communityId (required)
The id of community
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Request Body
Returns
Returns status code OK if everything is ok
| Name | Type | Description |
|---|---|---|
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
Request body contains 'data' field with encrypted object below:
IMPORTANT - you can send unencrypted data in this request, it is only available in Swagger
{
"jobId": "string - required",
"tenantId": "string - required",
"communityId": "string - required",
"totalParts": "number - required",
"totalCount": "number - required",
"status": "string - required",
"query": "array - required",
"requestedBy": "string - required",
"sendNotificationTo": "array - required",
"tenantDns": "string - required",
"user_id": "string - required",
"requestUuid": "string - required",
"createdAt": "number - required",
"completedAt": "number - required",
"downloadLink": "string - required",
"size": "number - required",
}| Field | Type | Description |
|---|---|---|
| jobId | string | — |
| tenantId | string | — |
| communityId | string | — |
| totalParts | number | — |
| totalCount | number | — |
| status | string | — |
| query | array<object> | — |
| requestedBy | string | — |
| sendNotificationTo | array<object> | — |
| tenantDns | string | — |
| user_id | string | — |
| requestUuid | string | — |
| createdAt | number | — |
| completedAt | number | — |
| downloadLink | string | — |
| size | number | — |
curl -X POST 'https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/job' \
-H 'licensekey: YOUR_LICENSE_KEY' \
-H 'requestid: <ecdsa-requestid>' \
-H 'publickey: <public-key>' \
-H 'authMyPublicKey: YOUR_PUBLIC_KEY' \
-H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \
-H 'authLicense: YOUR_LICENSE_KEY' \
-H 'Content-Type: application/json' \
-d '{"jobId": "string", "tenantId": "string", "communityId": "string", "totalParts": 3, "totalCount": 3, "status": "string", "query": [], "requestedBy": "string", "sendNotificationTo": [], "tenantDns": "string", "user_id": "string", "requestUuid": "string", "createdAt": 1318781876, "completedAt": 1318781876, "downloadLink": "", "size": 123}'const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/job", {
method: "POST",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"jobId": "string",
"tenantId": "string",
"communityId": "string",
"totalParts": 3,
"totalCount": 3,
"status": "string",
"query": [],
"requestedBy": "string",
"sendNotificationTo": [],
"tenantDns": "string",
"user_id": "string",
"requestUuid": "string",
"createdAt": 1318781876,
"completedAt": 1318781876,
"downloadLink": "",
"size": 123
})
});
const data = await res.json();import requests
res = requests.post(
"https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/job",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
},
json={
"jobId": "string",
"tenantId": "string",
"communityId": "string",
"totalParts": 3,
"totalCount": 3,
"status": "string",
"query": [],
"requestedBy": "string",
"sendNotificationTo": [],
"tenantDns": "string",
"user_id": "string",
"requestUuid": "string",
"createdAt": 1318781876,
"completedAt": 1318781876,
"downloadLink": "",
"size": 123
},
)
print(res.json())// no response body
// no response body
// no response body
Get last seen
This report searches in DB and returns always array with one event for given user_id, device_id, person_id or even eventName.
Parameters
tenantId (required)
The id of tenant
communityId (required)
The id of community
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Request Body
! IMPORTANT - If eventName is specified, then at least device_id and user_id is required and person_id optional. If eventName is not specified, then at least one of these fields is required: user_id, device_id or person_id.
-----
user_id (optional)
The id of user. No default value
device_id (optional)
The id of device. No default value
person_id (optional)
The id of person. No default value
eventName (optional)
The name of event. No default value
Returns
Returns object with data field containing array of only one event
| Name | Type | Description |
|---|---|---|
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
Data to filter
| Field | Type | Description |
|---|---|---|
| device_id | string | — |
| user_id | string | — |
| person_id | string | — |
| eventName | string | — |
curl -X POST 'https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/last_seen_report' \
-H 'licensekey: YOUR_LICENSE_KEY' \
-H 'requestid: <ecdsa-requestid>' \
-H 'publickey: <public-key>' \
-H 'authMyPublicKey: YOUR_PUBLIC_KEY' \
-H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \
-H 'authLicense: YOUR_LICENSE_KEY' \
-H 'Content-Type: application/json' \
-d '{"device_id": "xxxxxxxx", "user_id": "xxxxxxxx", "person_id": "xxxxxxxx", "eventName": "xxxxxxxx"}'const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/last_seen_report", {
method: "POST",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"device_id": "xxxxxxxx",
"user_id": "xxxxxxxx",
"person_id": "xxxxxxxx",
"eventName": "xxxxxxxx"
})
});
const data = await res.json();import requests
res = requests.post(
"https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/last_seen_report",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
},
json={
"device_id": "xxxxxxxx",
"user_id": "xxxxxxxx",
"person_id": "xxxxxxxx",
"eventName": "xxxxxxxx"
},
)
print(res.json())// no response body
// no response body
Login Activity Report
This report searches in DB and collects all events with eventName = E_SP_REDIRECT_SUCCEEDED. Results are also in specified time range (from, to) and are paginated (pSize, pIndex).
Parameters
tenantId (required)
The id of tenant
communityId (required)
The id of community
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Request Body
pSize (optional)
The maximum number of hits to return default = 25, min = 1, max = 100
pIndex (optional)
Number of hits to skip default = 0
from (optional)
timestamp, default = current date - 30 days, max = current date - 90 days
to (optional)
timestamp, default = current
auth_method (optional)
string, optional filter
user_id (optional)
User id, string , optional filter
Returns
Returns object with page info and data
| Name | Type | Description |
|---|---|---|
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
Data to filter
| Field | Type | Description |
|---|---|---|
| pSize | Number | A limit on the number of objects to be returned. Default is 25 |
| pIndex | Number | The pIndex key is a cursor for the pagination. |
| from | string | Date from which to start the search |
| to | string | date to end the search |
| auth_method | string | optional filter |
| user_id | string | optional filter |
curl -X POST 'https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/login_activity_report' \
-H 'licensekey: YOUR_LICENSE_KEY' \
-H 'requestid: <ecdsa-requestid>' \
-H 'publickey: <public-key>' \
-H 'authMyPublicKey: YOUR_PUBLIC_KEY' \
-H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \
-H 'authLicense: YOUR_LICENSE_KEY' \
-H 'Content-Type: application/json' \
-d '{"pSize": 10, "pIndex": 0, "from": "2021-02-01 00:00:00.000", "to": "2021-04-01 00:00:00.000", "auth_method": "string", "user_id": "string"}'const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/login_activity_report", {
method: "POST",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"pSize": 10,
"pIndex": 0,
"from": "2021-02-01 00:00:00.000",
"to": "2021-04-01 00:00:00.000",
"auth_method": "string",
"user_id": "string"
})
});
const data = await res.json();import requests
res = requests.post(
"https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/login_activity_report",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
},
json={
"pSize": 10,
"pIndex": 0,
"from": "2021-02-01 00:00:00.000",
"to": "2021-04-01 00:00:00.000",
"auth_method": "string",
"user_id": "string"
},
)
print(res.json())// no response body
// no response body
Retrieves metrics based on metrics name
This endpoint retrieves metrics information based on provided metricsName
Parameters
tenantId (required)
The id of tenant
communityId (required)
The id of community
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Request Body
metricsName (required)
Retrieve metrics information for the given metrics name, should be one of: M_C_ACTIVE_USER, M_C_LOGIN_FAILED, M_C_LOGINS, M_C_NEW_DEVICES, M_G_APPLICATION_USAGE, M_G_LOGIN_FAILED, M_GT_SUCCESSFUL_AUTHENTICATIONS, M_GT_PROOFING_SESSION or M_T_NEW_DEVICES
from (optional in UTC)
timestamp, default = current date - 1 days, max = current date - 90 days
to (optional in UTC)
timestamp, if 'to' date is equal to 'from', then metric is counted hourly (in day pointing at 'to' date) instead of daily default = current
This endpoint is downloadable. To request download, please add to request body below full object |
"download": {
"requestBy": "string, email (required)",
"notificationList": [ "string, email (required, 1-5 emails)" ],
"eventData": {
"tenant_dns": "string (required)",
"user_id": "string (required)"
}
}
Returns
Returns metrics information
| Name | Type | Description |
|---|---|---|
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
Data to filter
| Field | Type | Description |
|---|---|---|
| metricsName | string | Name of the metrics to retrieve |
| from | string | Date from which to start the search |
| to | string | Date to end the search |
| responseTimezone | string | Timezone for correctly formatting time in response |
| authModuleId | string | AuthModuleId - only applicable on M_C_ACTIVE_USER metrics |
curl -X POST 'https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/metrics' \
-H 'licensekey: YOUR_LICENSE_KEY' \
-H 'requestid: <ecdsa-requestid>' \
-H 'publickey: <public-key>' \
-H 'authMyPublicKey: YOUR_PUBLIC_KEY' \
-H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \
-H 'authLicense: YOUR_LICENSE_KEY' \
-H 'Content-Type: application/json' \
-d '{"metricsName": "M_C_LOGINS", "from": "2023-02-01 00:00:00.000", "to": "2023-02-10 00:00:00.000", "responseTimezone": "UTC - string optional", "authModuleId": "xxxxxxxx"}'const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/metrics", {
method: "POST",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"metricsName": "M_C_LOGINS",
"from": "2023-02-01 00:00:00.000",
"to": "2023-02-10 00:00:00.000",
"responseTimezone": "UTC - string optional",
"authModuleId": "xxxxxxxx"
})
});
const data = await res.json();import requests
res = requests.post(
"https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/metrics",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
},
json={
"metricsName": "M_C_LOGINS",
"from": "2023-02-01 00:00:00.000",
"to": "2023-02-10 00:00:00.000",
"responseTimezone": "UTC - string optional",
"authModuleId": "xxxxxxxx"
},
)
print(res.json())// no response body
// no response body
Passwordless Login Activity Report
This report searches in DB all unique users (by user_id field) where eventName = E_SP_REDIRECT_SUCCEEDED and each record has latest_login and last_login (latest_login - 1, this can be null because there can be only 1 login attemp). Results are chronological, sorted by latest_login. Results are also in specified time range (from, to) and are paginated (pSize, pIndex).
Parameters
tenantId (required)
The id of tenant
communityId (required)
The id of community
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Request Body
pSize (optional)
The maximum number of hits to return default = 25, min = 1 max = 100
pIndex (optional)
Number of hits to skip default = 0
from (optional)
timestamp, default = current date - 30 days, max = current date - 90 days
to (optional)
timestamp, default = current
user_id (optional)
User id, string, optional filter
person_id (optional)
Person id, string, optional filter
Returns
Returns object with page info and data
| Name | Type | Description |
|---|---|---|
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
Data to filter
| Field | Type | Description |
|---|---|---|
| pSize | Number | A limit on the number of objects to be returned. Default is 25 |
| pIndex | Number | The pIndex key is a cursor for the pagination. |
| from | string | Date from which to start the search |
| to | string | date to end the search |
curl -X POST 'https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/passwordless_login_activity_report' \
-H 'licensekey: YOUR_LICENSE_KEY' \
-H 'requestid: <ecdsa-requestid>' \
-H 'publickey: <public-key>' \
-H 'authMyPublicKey: YOUR_PUBLIC_KEY' \
-H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \
-H 'authLicense: YOUR_LICENSE_KEY' \
-H 'Content-Type: application/json' \
-d '{"pSize": 10, "pIndex": 0, "from": "2021-02-01 00:00:00.000", "to": "2021-04-01 00:00:00.000"}'const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/passwordless_login_activity_report", {
method: "POST",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"pSize": 10,
"pIndex": 0,
"from": "2021-02-01 00:00:00.000",
"to": "2021-04-01 00:00:00.000"
})
});
const data = await res.json();import requests
res = requests.post(
"https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/passwordless_login_activity_report",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
},
json={
"pSize": 10,
"pIndex": 0,
"from": "2021-02-01 00:00:00.000",
"to": "2021-04-01 00:00:00.000"
},
)
print(res.json())// no response body
// no response body
Get a role assignment report
This report is only available as a download. It collects all of the authorizations for the roles specified, then aggregates it with user data and a latest login time for the user.
Parameters
tenantId (required)
The id of tenant
communityId (required)
The id of community
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Returns
Returns object with page info and data
| Name | Type | Description |
|---|---|---|
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
Data to filter raws.
This report is only available as a download. Please add to request body below full object |
{
"roles": ["role-1", "role-2"] (optional),
"roleIds": ["id-1", "id-2"] (optional),
"download": {
"requestBy": "string, email (required)",
"notificationList": [ "string, email (required, 1-5 emails)" ],
"eventData": {
"tenant_dns": "string (required)",
"user_id": "string (required)"
}
},
"data_now": "boolean, default false (optional)"
}
Download generates CSV file and notifies provided emails that report is ready to download
| Field | Type | Description |
|---|---|---|
| roles | array<object> | roles, each of which we need to retrieve all users with that role name |
| roleIds | array<object> | roleIds, each of which we need to retrieve all users with that role authorization |
| data_now | boolean | — |
curl -X POST 'https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/role_assignment' \
-H 'licensekey: YOUR_LICENSE_KEY' \
-H 'requestid: <ecdsa-requestid>' \
-H 'publickey: <public-key>' \
-H 'authMyPublicKey: YOUR_PUBLIC_KEY' \
-H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \
-H 'authLicense: YOUR_LICENSE_KEY' \
-H 'Content-Type: application/json' \
-d '{"roles": ["role-1", "role-2"], "roleIds": ["id-1", "id-2"], "data_now": false}'const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/role_assignment", {
method: "POST",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"roles": [
"role-1",
"role-2"
],
"roleIds": [
"id-1",
"id-2"
],
"data_now": false
})
});
const data = await res.json();import requests
res = requests.post(
"https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/role_assignment",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
},
json={
"roles": [
"role-1",
"role-2"
],
"roleIds": [
"id-1",
"id-2"
],
"data_now": false
},
)
print(res.json())// no response body
// no response body
Service onbording report
This report searches in DB and is collecting every record with eventName = E_USER_ONBOARDED. Results are also in specified time range (from, to) and are paginated (pSize, pIndex).
Parameters
tenantId (required)
The id of tenant
communityId (required)
The id of community
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Request Body
pSize (optional)
The maximum number of hits to return default = 25, min = 1, max = 100
pIndex (optional)
Number of hits to skip default = 0
from (optional)
timestamp, default = current date - 30 days, max = current date - 90 days
to (optional)
timestamp, default = current
user_id (optional)
User id, string, optional filter
person_id (optional)
Person id, string, optional filter
Returns
Returns object with page info and data
| Name | Type | Description |
|---|---|---|
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
Data to filter.
This report is downloadable. To request download, please add to request body below full object |
"download": {
"requestBy": "string, email (required)",
"notificationList": [ "string, email (required, 1-5 emails)" ],
"eventData": {
"tenant_dns": "string (required)",
"user_id": "string (required)"
}
}
Download works with pIndex and fetches up to 5000 records, generates CSV file and notifies provided emails that report is ready to download
| Field | Type | Description |
|---|---|---|
| pSize | Number | A limit on the number of objects to be returned. Default is 25 |
| pIndex | Number | The pIndex key is a cursor for the pagination. |
| from | string | Date from which to start the search |
| to | string | date to end the search |
curl -X POST 'https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/service_onboarding_report' \
-H 'licensekey: YOUR_LICENSE_KEY' \
-H 'requestid: <ecdsa-requestid>' \
-H 'publickey: <public-key>' \
-H 'authMyPublicKey: YOUR_PUBLIC_KEY' \
-H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \
-H 'authLicense: YOUR_LICENSE_KEY' \
-H 'Content-Type: application/json' \
-d '{"pSize": 10, "pIndex": 0, "from": "2021-02-01 00:00:00.000", "to": "2021-04-01 00:00:00.000"}'const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/service_onboarding_report", {
method: "POST",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"pSize": 10,
"pIndex": 0,
"from": "2021-02-01 00:00:00.000",
"to": "2021-04-01 00:00:00.000"
})
});
const data = await res.json();import requests
res = requests.post(
"https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/service_onboarding_report",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
},
json={
"pSize": 10,
"pIndex": 0,
"from": "2021-02-01 00:00:00.000",
"to": "2021-04-01 00:00:00.000"
},
)
print(res.json())// no response body
// no response body
Service Usage report
This report searches in DB and collects all unique users (by user_id field) with number of eventName = E_LOGIN_SUCCEEDED. Each record has last_login. Results are chronological, sorted by last_login. Results are also in specified time range (from, to) and are paginated (pSize, pIndex).
Parameters
tenantId (required)
The id of tenant
communityId (required)
The id of community
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Request Body
pSize (optional)
The maximum number of hits to return default = 25, min = 1, max = 100
pIndex (optional)
Number of hits to skip default = 0
from (optional)
timestamp, default = current date - 30 days, max = current date - 90 days
to (optional)
timestamp, default = current
user_id (optional)
User id, string, optional filter
person_id (optional)
Person id, string, optional filter
Returns
Returns object with page info and data
| Name | Type | Description |
|---|---|---|
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
Data to filter
| Field | Type | Description |
|---|---|---|
| pSize | Number | A limit on the number of objects to be returned. Default is 25 |
| pIndex | Number | The pIndex key is a cursor for the pagination. |
| from | string | Date from which to start the search |
| to | string | date to end the search |
curl -X POST 'https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/service_usage_report' \
-H 'licensekey: YOUR_LICENSE_KEY' \
-H 'requestid: <ecdsa-requestid>' \
-H 'publickey: <public-key>' \
-H 'authMyPublicKey: YOUR_PUBLIC_KEY' \
-H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \
-H 'authLicense: YOUR_LICENSE_KEY' \
-H 'Content-Type: application/json' \
-d '{"pSize": 10, "pIndex": 0, "from": "2021-02-01 00:00:00.000", "to": "2021-04-01 00:00:00.000"}'const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/service_usage_report", {
method: "POST",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"pSize": 10,
"pIndex": 0,
"from": "2021-02-01 00:00:00.000",
"to": "2021-04-01 00:00:00.000"
})
});
const data = await res.json();import requests
res = requests.post(
"https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/service_usage_report",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
},
json={
"pSize": 10,
"pIndex": 0,
"from": "2021-02-01 00:00:00.000",
"to": "2021-04-01 00:00:00.000"
},
)
print(res.json())// no response body
// no response body
Login Activity Report
This report searches in DB and collects all events where eventName = E_SP_REDIRECT_SUCCEEDED ||eventName = E_SP_REDIRECT_SUCCEEDED and application is adminx. Results are also in specified time range (from, to) and are paginated (pSize, pIndex).
Parameters
tenantId (required)
The id of tenant
communityId (required)
The id of community
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Request Body
pSize (optional)
The maximum number of hits to return default = 25, min = 1, max = 100
pIndex (optional)
Number of hits to skip default = 0
from (optional)
timestamp, default = current date - 30 days, max = current date - 90 days
to (optional)
timestamp, default = current
auth_method (optional)
string, optional filter
user_id (optional)
User id, string , optional filter
application (optional)
application, string , optional filter
Returns
Returns object with page info and data
| Name | Type | Description |
|---|---|---|
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
Data to filter the E_LOGIN_SUCCEEDED and E_SP_REDIRECT_SUCCEEDED events.
This report is downloadable. To request download, please add to request body below full object |
"download": {
"requestBy": "string, email (required)",
"notificationList": [ "string, email (required, 1-5 emails)" ],
"eventData": {
"tenant_dns": "string (required)",
"user_id": "string (required)"
}
}
Download works with pIndex and fetches up to 5000 records, generates CSV file and notifies provided emails that report is ready to download
| Field | Type | Description |
|---|---|---|
| pSize | Number | A limit on the number of objects to be returned. Default is 25 |
| pIndex | Number | The pIndex key is a cursor for the pagination. |
| from | string | Date from which to start the search |
| to | string | date to end the search |
| auth_method | string | optional filter |
| user_id | string | optional filter |
| application | string | optional filter |
curl -X POST 'https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/v2/login_activity_report' \
-H 'licensekey: YOUR_LICENSE_KEY' \
-H 'requestid: <ecdsa-requestid>' \
-H 'publickey: <public-key>' \
-H 'authMyPublicKey: YOUR_PUBLIC_KEY' \
-H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \
-H 'authLicense: YOUR_LICENSE_KEY' \
-H 'Content-Type: application/json' \
-d '{"pSize": 10, "pIndex": 0, "from": "2021-02-01 00:00:00.000", "to": "2021-04-01 00:00:00.000", "auth_method": "string", "user_id": "string", "application": "string"}'const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/v2/login_activity_report", {
method: "POST",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"pSize": 10,
"pIndex": 0,
"from": "2021-02-01 00:00:00.000",
"to": "2021-04-01 00:00:00.000",
"auth_method": "string",
"user_id": "string",
"application": "string"
})
});
const data = await res.json();import requests
res = requests.post(
"https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/v2/login_activity_report",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
},
json={
"pSize": 10,
"pIndex": 0,
"from": "2021-02-01 00:00:00.000",
"to": "2021-04-01 00:00:00.000",
"auth_method": "string",
"user_id": "string",
"application": "string"
},
)
print(res.json())// no response body
// no response body
Get verification sessions report
This report fetches verification sessions from IDProofing.
This report is downloadable, please check request body for more information.
Parameters
tenantId (required)
The id of tenant
communityId (required)
The id of community
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Request Body
query (optional)
a formatted query object to allow caller to run custom pre-formatted-queries.
Returns
Returns jobId
| Name | Type | Description |
|---|---|---|
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
Data to filter raws.
This report is downloadable. To request download, please add to request body below full object |
{
"query": {
"id": "session id : non-mandatory",
"status": "COMPLETED_PASS | COMPLETED_FAILED | COMPLETED_NOT_PERFORMED | PENDING | EXPIRED | INPROGRESS | DECLINED | COMPLETED | ABANDONED | CANCELLED : non-mandatory",
"documentType": "dl_object | ppt_object | idcard_object : non-mandatory",
"name": "test : non-mandatory",
"startDate": "2024-12-13 00:00:00.000 : non-mandatory",
"endDate": "2024-12-19 23:59:59.000 : non-mandatory"
},
"download": {
"notificationList": [
"email@1kosmos.com"
],
"requestBy": "email@1kosmos.com",
"eventData": {
"tenant": "xxxxxxxxxxxx",
"community": "xxxxxxxxxxxx",
"user_id": "user",
"tenant_dns": "1k-dev.1kosmos.net"
}
}
}| Field | Type | Description |
|---|---|---|
| query | object | — |
| download | object | — |
curl -X POST 'https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/verification_sessions_report' \
-H 'licensekey: YOUR_LICENSE_KEY' \
-H 'requestid: <ecdsa-requestid>' \
-H 'publickey: <public-key>' \
-H 'authMyPublicKey: YOUR_PUBLIC_KEY' \
-H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \
-H 'authLicense: YOUR_LICENSE_KEY' \
-H 'Content-Type: application/json' \
-d '{"query": {"id": "xxxxxxxxxx", "status": "COMPLETED_PASS | COMPLETED_FAILED | COMPLETED_NOT_PERFORMED | PENDING | EXPIRED | INPROGRESS | DECLINED | COMPLETED | ABANDONED | CANCELLED", "documentType": "dl_object | ppt_object | idcard_object", "name": "xxxxxxxxxx", "startDate": "2024-12-19 23:59:59.000", "endDate": "2024-12-19 23:59:59.000"}, "download": {"notificationList": ["email@1kosmos.com"], "requestBy": "email@1kosmos.com", "eventData": {"tenant": "xxxxxxxxxxxx", "community": "xxxxxxxxxxxx", "user_id": "xxxxxxxxxxxx", "tenant_dns": "1k-dev.1kosmos.net"}}}'const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/verification_sessions_report", {
method: "POST",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"query": {
"id": "xxxxxxxxxx",
"status": "COMPLETED_PASS | COMPLETED_FAILED | COMPLETED_NOT_PERFORMED | PENDING | EXPIRED | INPROGRESS | DECLINED | COMPLETED | ABANDONED | CANCELLED",
"documentType": "dl_object | ppt_object | idcard_object",
"name": "xxxxxxxxxx",
"startDate": "2024-12-19 23:59:59.000",
"endDate": "2024-12-19 23:59:59.000"
},
"download": {
"notificationList": [
"email@1kosmos.com"
],
"requestBy": "email@1kosmos.com",
"eventData": {
"tenant": "xxxxxxxxxxxx",
"community": "xxxxxxxxxxxx",
"user_id": "xxxxxxxxxxxx",
"tenant_dns": "1k-dev.1kosmos.net"
}
}
})
});
const data = await res.json();import requests
res = requests.post(
"https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/verification_sessions_report",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
},
json={
"query": {
"id": "xxxxxxxxxx",
"status": "COMPLETED_PASS | COMPLETED_FAILED | COMPLETED_NOT_PERFORMED | PENDING | EXPIRED | INPROGRESS | DECLINED | COMPLETED | ABANDONED | CANCELLED",
"documentType": "dl_object | ppt_object | idcard_object",
"name": "xxxxxxxxxx",
"startDate": "2024-12-19 23:59:59.000",
"endDate": "2024-12-19 23:59:59.000"
},
"download": {
"notificationList": [
"email@1kosmos.com"
],
"requestBy": "email@1kosmos.com",
"eventData": {
"tenant": "xxxxxxxxxxxx",
"community": "xxxxxxxxxxxx",
"user_id": "xxxxxxxxxxxx",
"tenant_dns": "1k-dev.1kosmos.net"
}
}
},
)
print(res.json())// no response body
// no response body
Create Event
Creates an event in DB. You can send any number of fields in request body
Parameters
eventName (required)
The name of the event to log. Suggested values: E_USER_ONBOARDED, E_USER_INVITED, E_LOGIN_ATTEMPT, E_LOG_OTP_REQUESTED or different.
tenantId (required)
The id of tenant
communityId (required)
The id of community
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Request Body
type (required)
Event type
timestamp (optional)
Time of event in string that is able to be parsed as date
default = current time
epoch_time (optional)
Time of event in number
default = current time
Returns
Returns status code OK if everything is ok
| Name | Type | Description |
|---|---|---|
| eventNamerequired | string | Name of event |
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
Request body contains 'data' field with encrypted object below:
IMPORTANT - you can send unencrypted data in this request, it is only available in Swagger
{
"data": {
"type": "string - required",
"epoch_time": "number in seconds - optional",
"timestamp": "string in date format 'YYYY-MM-DD HH:mm:ss.SSS' or other readable - optional",
...restOfEventData
}
}| Field | Type | Description |
|---|---|---|
| data | object | — |
curl -X PUT 'https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/event/<eventName>' \
-H 'licensekey: YOUR_LICENSE_KEY' \
-H 'requestid: <ecdsa-requestid>' \
-H 'publickey: <public-key>' \
-H 'authMyPublicKey: YOUR_PUBLIC_KEY' \
-H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \
-H 'authLicense: YOUR_LICENSE_KEY' \
-H 'Content-Type: application/json' \
-d '{"data": {"type": "event", "timestamp": "2023-02-14 15:00:00.000", "epoch_time": 1318781876}}'const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/event/<eventName>", {
method: "PUT",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"data": {
"type": "event",
"timestamp": "2023-02-14 15:00:00.000",
"epoch_time": 1318781876
}
})
});
const data = await res.json();import requests
res = requests.put(
"https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/event/<eventName>",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
},
json={
"data": {
"type": "event",
"timestamp": "2023-02-14 15:00:00.000",
"epoch_time": 1318781876
}
},
)
print(res.json())// no response body
// no response body
// no response body
Cancel download job
Cancel download job
Parameters
tenantId (required)
The id of tenant
communityId (required)
The id of community
jobId (required)
The id of job
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Returns
Returns object with page info and data
| Name | Type | Description |
|---|---|---|
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| jobIdrequired | string | Id of job |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
curl -X PATCH 'https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/download/job/<jobId>' \ -H 'licensekey: YOUR_LICENSE_KEY' \ -H 'requestid: <ecdsa-requestid>' \ -H 'publickey: <public-key>' \ -H 'authMyPublicKey: YOUR_PUBLIC_KEY' \ -H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \ -H 'authLicense: YOUR_LICENSE_KEY'
const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/download/job/<jobId>", {
method: "PATCH",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
}
});
const data = await res.json();import requests
res = requests.patch(
"https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/download/job/<jobId>",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
}
)
print(res.json()){
"createdAt": 1231242412421,
"status": "Cancelled",
"sendNotificationTo": [
"string"
]
}// no response body
// no response body
Update job
Update a job in DB.
Parameters
tenantId (required)
The id of tenant
communityId (required)
The id of community
jobId (require)
Id of Job to update
Headers
apikey (required)
API key
Request Body
status (require)
Status of Job to update
downloadLink (require)
Download link of report data
size (require)
Size of report data file
completedAt (require)
completed time of report data file
Returns
Returns status code OK if everything is ok
| Name | Type | Description |
|---|---|---|
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| jobIdrequired | string | Id of job |
| Name | Type | Description |
|---|---|---|
| apikeyrequired | string | API key |
Request body contains 'data' field with encrypted object below:
IMPORTANT - you can send unencrypted data in this request, it is only available in Swagger
{
"status": "string - required",
"downloadLink": "string - optinal",
"size": "number - optinal",
"completedAt": "number - optinal",
}| Field | Type | Description |
|---|---|---|
| status | string | — |
| completedAt | number | — |
| downloadLink | string | — |
| size | number | — |
curl -X PATCH 'https://pilot-root.1kosmos.net/reports/tenant/5f3d8d0cd866fa61019cf968/community/5f3d8d0cd866fa61019cf969/job/<jobId>' \
-H 'apikey: <value>' \
-H 'Content-Type: application/json' \
-d '{"status": "string", "completedAt": 1318781876, "downloadLink": "", "size": 123}'const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/5f3d8d0cd866fa61019cf968/community/5f3d8d0cd866fa61019cf969/job/<jobId>", {
method: "PATCH",
headers: {
"apikey": "<value>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"status": "string",
"completedAt": 1318781876,
"downloadLink": "",
"size": 123
})
});
const data = await res.json();import requests
res = requests.patch(
"https://pilot-root.1kosmos.net/reports/tenant/5f3d8d0cd866fa61019cf968/community/5f3d8d0cd866fa61019cf969/job/<jobId>",
headers={
"apikey": "<value>"
},
json={
"status": "string",
"completedAt": 1318781876,
"downloadLink": "",
"size": 123
},
)
print(res.json())// no response body
// no response body
// no response body
Service Key
Service Key endpoints.
Get service keys
This endpoint returns available service keys. The license you are using must be of authLevel 'system'
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Returns
Returns array with service keys
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
curl -X GET 'https://pilot-root.1kosmos.net/reports/servicekeys' \ -H 'licensekey: YOUR_LICENSE_KEY' \ -H 'requestid: <ecdsa-requestid>' \ -H 'publickey: <public-key>' \ -H 'authMyPublicKey: YOUR_PUBLIC_KEY' \ -H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \ -H 'authLicense: YOUR_LICENSE_KEY'
const res = await fetch("https://pilot-root.1kosmos.net/reports/servicekeys", {
method: "GET",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
}
});
const data = await res.json();import requests
res = requests.get(
"https://pilot-root.1kosmos.net/reports/servicekeys",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
}
)
print(res.json())// no response body
Reset Service Key
This endpoint resets service key for given keyId. Deletes current one and recreates a new one. The license you are using must be of authLevel 'system'
Parameters
keyId (required)
The keyId of service key to reset
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Returns
Returns object with page info and data
| Name | Type | Description |
|---|---|---|
| keyIdrequired | string | keyId of service key to reset |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
curl -X DELETE 'https://pilot-root.1kosmos.net/reports/servicekey/<keyId>' \ -H 'licensekey: YOUR_LICENSE_KEY' \ -H 'requestid: <ecdsa-requestid>' \ -H 'publickey: <public-key>' \ -H 'authMyPublicKey: YOUR_PUBLIC_KEY' \ -H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \ -H 'authLicense: YOUR_LICENSE_KEY'
const res = await fetch("https://pilot-root.1kosmos.net/reports/servicekey/<keyId>", {
method: "DELETE",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
}
});
const data = await res.json();import requests
res = requests.delete(
"https://pilot-root.1kosmos.net/reports/servicekey/<keyId>",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
}
)
print(res.json())// no response body
Download
Export datasets.
Cleanup download jobs
Cleanup download jobs. Can only be accessed using infra key
Headers
licensekey (required)
Unencrypted infra key
Returns
204 No Content
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | Infra key |
curl -X DELETE 'https://pilot-root.1kosmos.net/reports/download/cleanup' \ -H 'licensekey: YOUR_LICENSE_KEY'
const res = await fetch("https://pilot-root.1kosmos.net/reports/download/cleanup", {
method: "DELETE",
headers: {
"licensekey": "YOUR_LICENSE_KEY"
}
});
const data = await res.json();import requests
res = requests.delete(
"https://pilot-root.1kosmos.net/reports/download/cleanup",
headers={
"licensekey": "YOUR_LICENSE_KEY"
}
)
print(res.json())// no response body
// no response body
ECDSA Helper
ECDSA Helper endpoints.
/ecdsa_helper/{method}
Encrypt and decrypt the data string by public key and private key.
Parameters
method (optional)
The method parameter is type of enum. Default value is encrypt.
This parameter only accepts following values
encrypt, decrypt
Request Body
dataStr (required)
The dataStr key is type of string.
publicKey (required)
The publicKey is type of string.
privateKey (required)
The privateKey is type of string.
Returns
Returns the encrypted/decrypted string.
This API throw an error if something goes wrong. A common source of error is public or private key is not valid.
| Name | Type | Description |
|---|---|---|
| method | string | — |
| Field | Type | Description |
|---|---|---|
| dataStrrequired | string | Message to encrypt or decrypt |
| publicKeyrequired | string | — |
| privateKeyrequired | string | — |
curl -X POST 'https://pilot-root.1kosmos.net/reports/ecdsa_helper/<method>' \
-H 'authMyPublicKey: YOUR_PUBLIC_KEY' \
-H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \
-H 'authLicense: YOUR_LICENSE_KEY' \
-H 'Content-Type: application/json' \
-d '{"dataStr": "Hey, This is example data string.", "publicKey": "xxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "privateKey": "xxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}'const res = await fetch("https://pilot-root.1kosmos.net/reports/ecdsa_helper/<method>", {
method: "POST",
headers: {
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"dataStr": "Hey, This is example data string.",
"publicKey": "xxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"privateKey": "xxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
})
});
const data = await res.json();import requests
res = requests.post(
"https://pilot-root.1kosmos.net/reports/ecdsa_helper/<method>",
headers={
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
},
json={
"dataStr": "Hey, This is example data string.",
"publicKey": "xxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"privateKey": "xxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
)
print(res.json()){
"data": "xxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxx"
}Environment
Environment endpoints.
/environment
Returns
Headers
### licensekey License key
| Name | Type | Description |
|---|---|---|
| licensekey | string | License key; |
curl -X GET 'https://pilot-root.1kosmos.net/reports/environment' \ -H 'licensekey: YOUR_LICENSE_KEY'
const res = await fetch("https://pilot-root.1kosmos.net/reports/environment", {
method: "GET",
headers: {
"licensekey": "YOUR_LICENSE_KEY"
}
});
const data = await res.json();import requests
res = requests.get(
"https://pilot-root.1kosmos.net/reports/environment",
headers={
"licensekey": "YOUR_LICENSE_KEY"
}
)
print(res.json())// no response body
Healthz
Healthz endpoints.
Get healthz.
Get healthz
Returns
Returns a healthz object
- ``
version = <git-tag>.<commit-id>.<dob>``
- ``
git-tag``: When code is compiled from a git-tag, this must carry the tag name. This should match one of the git tags.
- ``
commit-id``: This is the git-commit-id. eg: When code is built from this, the hex code, in the end, is the commit it.
- ``
dob``: Date Of Build. This is epoc-time-in-seconds that tell the time when the build was created.
- if the code is not built from a git-tag, then the ``
version =<commit-id>.<dob>``
curl -X GET 'https://pilot-root.1kosmos.net/reports/healthz' \ -H 'authMyPublicKey: YOUR_PUBLIC_KEY' \ -H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \ -H 'authLicense: YOUR_LICENSE_KEY'
const res = await fetch("https://pilot-root.1kosmos.net/reports/healthz", {
method: "GET",
headers: {
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
}
});
const data = await res.json();import requests
res = requests.get(
"https://pilot-root.1kosmos.net/reports/healthz",
headers={
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
}
)
print(res.json()){
"status": "all services operational",
"publicKey": "//same as <service>/publickeys endpoint",
"code": "200",
"version": "xxxx.xxxx.xxxx"
}Public Key
Public Key endpoints.
/publickeys
Get system's public key. No authorization
Returns
Returns a public key object
curl -X GET 'https://pilot-root.1kosmos.net/reports/publickeys' \ -H 'authMyPublicKey: YOUR_PUBLIC_KEY' \ -H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \ -H 'authLicense: YOUR_LICENSE_KEY'
const res = await fetch("https://pilot-root.1kosmos.net/reports/publickeys", {
method: "GET",
headers: {
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
}
});
const data = await res.json();import requests
res = requests.get(
"https://pilot-root.1kosmos.net/reports/publickeys",
headers={
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
}
)
print(res.json()){
"publicKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}// no response body
Service Directory
Service Directory endpoints.
Get all service directories.
Get all service directories.
Returns
Returns all service directories.
curl -X GET 'https://pilot-root.1kosmos.net/reports/sd' \ -H 'authMyPublicKey: YOUR_PUBLIC_KEY' \ -H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \ -H 'authLicense: YOUR_LICENSE_KEY'
const res = await fetch("https://pilot-root.1kosmos.net/reports/sd", {
method: "GET",
headers: {
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
}
});
const data = await res.json();import requests
res = requests.get(
"https://pilot-root.1kosmos.net/reports/sd",
headers={
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
}
)
print(res.json()){
"name1": "https://xxx.xxxxxx.xxx/xxxxx",
"name2": "https://xxx.xxxxxx.xxx/xxxxx",
"name3": "https://xxx.xxxxxx.xxx/xxxxx"
}Transactions
Transaction-level reporting.
Fetch transactions
This transactions searches in DB and returns all transactions 'as they are', not processed. Results are chronological and they are also in specified time range (from, to) and are paginated (pSize, pIndex).
Parameters
tenantId (required)
The id of tenant
communityId (required)
The id of community
Headers
licensekey (required)
License key encrypted with ECDSA
requestid (required)
JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now
publickey (required)
Public key
Request Body
pSize (optional)
The maximum number of hits to return default = 25, min = 1, max = 100
pIndex (optional)
Number of hits to skip default = 0
from (optional)
timestamp, default = current date - 30 days, max = current date - 90 days
to (optional)
timestamp, default = current
query (optional)
a formatted query object to allow caller to run custom pre-formatted-queries and will run the query AS-IS to the DB.
IMPORTANT: All other fields are optional filters, you can search by any field you want
Returns
Returns object with page info and data
| Name | Type | Description |
|---|---|---|
| tenantIdrequired | string | Id of tenant |
| communityIdrequired | string | Id of community |
| Name | Type | Description |
|---|---|---|
| licensekeyrequired | string | License key encrypted with ECDSA / Try Authorize 🔒 |
| requestidrequired | string | JSON string encrypted with ECDSA which should contain "appid" (string), "uuid" (string) and "ts" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 60 seconds from now / Try Authorize 🔒 |
| publickeyrequired | string | Public Key / Try Authorize 🔒 |
Data to filter raws.
| Field | Type | Description |
|---|---|---|
| pSize | Number | A limit on the number of objects to be returned. Default is 25 |
| pIndex | Number | The pIndex key is a cursor for the pagination. |
| from | string | Date from which to start the search |
| to | string | date to end the search |
| query | object | — |
curl -X POST 'https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/transactions' \
-H 'licensekey: YOUR_LICENSE_KEY' \
-H 'requestid: <ecdsa-requestid>' \
-H 'publickey: <public-key>' \
-H 'authMyPublicKey: YOUR_PUBLIC_KEY' \
-H 'authMyPrivateKey: YOUR_PRIVATE_KEY' \
-H 'authLicense: YOUR_LICENSE_KEY' \
-H 'Content-Type: application/json' \
-d '{"pSize": 10, "pIndex": 0, "from": "2021-02-01 00:00:00.000", "to": "2021-02-01 00:00:00.000", "query": {"uid": "xxxxxx"}}'const res = await fetch("https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/transactions", {
method: "POST",
headers: {
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"pSize": 10,
"pIndex": 0,
"from": "2021-02-01 00:00:00.000",
"to": "2021-02-01 00:00:00.000",
"query": {
"uid": "xxxxxx"
}
})
});
const data = await res.json();import requests
res = requests.post(
"https://pilot-root.1kosmos.net/reports/tenant/<tenantId>/community/<communityId>/transactions",
headers={
"licensekey": "YOUR_LICENSE_KEY",
"requestid": "<ecdsa-requestid>",
"publickey": "<public-key>",
"authMyPublicKey": "YOUR_PUBLIC_KEY",
"authMyPrivateKey": "YOUR_PRIVATE_KEY",
"authLicense": "YOUR_LICENSE_KEY"
},
json={
"pSize": 10,
"pIndex": 0,
"from": "2021-02-01 00:00:00.000",
"to": "2021-02-01 00:00:00.000",
"query": {
"uid": "xxxxxx"
}
},
)
print(res.json())// no response body
// no response body