NAV
shell

Introduction

Welcome to the INFIMA API! You can use this API to access stats for your company's security program.

Authentication

To authorize, use this code:

# With shell, you can just pass the correct header with each request
curl "api_endpoint_here"
  -H "X-API-Key: letmein"

Make sure to replace letmein with your API key.

INFIMA uses API keys to allow access to the API. You can register a new INFIMA API key by emailing us at hello@infimasec.com.

INFIMA expects for the API key to be included in all API requests to the server in a header that looks like the following:

X-API-Key: letmein

Stats

Get All Stats

curl "https://app.infimasecapis.com/stats/v1/getallstats"
  -H "X-API-Key: letmein"

The above command returns JSON structured like this:

{
  "allCompanies": [
    {
      "companyId": "d72e4895-8c6e-4337-a760-4c9dec873c42",
      "companyName": "Example Co",
      "userCount": 240,
      "endpointCount": 301
    },
    {
      "companyId": "0918bbab-7178-46dc-8233-f0ee0fb61a47",
      "companyName": "Example Co 2",
      "userCount": 500,
      "endpointCount": 552
    }
  ]
}

This API retrieves stats for all companies managed by an INFIMA partner.

HTTP Request

GET https://app.infimasecapis.com/stats/v1/getallstats

Get User Stats

curl "https://app.infimasecapis.com/stats/v1/users?companyId=d72e4895-8c6e-4337-a760-4c9dec873c42"
  -H "X-API-Key: letmein"

The above command returns JSON structured like this:

{
  "users": [
    {
      "id": "1d52ef6e-e88c-40c8-a518-bf81d5392d4e",
      "name": "John Doe",
      "email": "john.doe@example.com"
    },
    {
      "id": "cd63dab2-b40b-4bc1-92a0-e89d09fd5385",
      "name": "Jane Doe",
      "email": "jane.doe@example.com"
    }
  ]
}

This API retrieves details of all users for a specific company.

HTTP Request

GET https://app.infimasecapis.com/stats/v1/users

Query Parameters

Parameter Description
companyId The ID of the company to retrieve users for

Get Endpoint Stats

curl "https://app.infimasecapis.com/stats/v1/endpoints?companyId=d72e4895-8c6e-4337-a760-4c9dec873c42"
  -H "X-API-Key: letmein"

The above command returns JSON structured like this:

{
  "endpoints": [
    {
      "deviceName": "EX-SRV-01",
      "dns": "EX-SRV-01.example.com"
    },
    {
      "deviceName": "EX-SRV-02",
      "dns": "EX-SRV-02.example.com"
    }
  ]
}

This API retrieves details of all endpoints for a specific company.

HTTP Request

GET https://app.infimasecapis.com/stats/v1/endpoints

Query Parameters

Parameter Description
companyId The ID of the company to retrieve users for

Errors

The INFIMA API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
429 Too Many Requests -- You've made too many requests for a given time period.
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.