POST: Add Assets in Bulk

https://api.bitsighttech.com/v1/companies/infrastructure/bulk

Set an end date for infrastructure or add assets to your infrastructure. The source of added assets are considered to be “company-provided.”

Only Admin and Group Admin can add assets to their infrastructure. See user permissions.

Parameters

* Required.

add

[Body] Assets to add.

Value: [Array] Asset and its change details.

{
  "entity": "entity_guid",
  "type": "string",
  "value": "string",
  "reason": "string"
}
Asset

[Body] An asset and its change details.

Value: [Object]

entity

* Required.

[Body] Identify the company to add assets to.

Value: [String] Company unique identifier [entity_guid]. See GET: Portfolio Details.

type

* Required.

[Body] Identify the type of asset that is being added.

Value: [String]

  • cidr
  • domain
value

* Required.

[Body] Identify the asset to add.

Value: [String]

  • Domain
  • IP address/CIDR
reason

[Body] Specify a reason for the change.

Value: [String] See reasons.

Example Requests

Add Assets

POST command
curl 'https://api.bitsighttech.com/ratings/v1/companies/infrastructure/bulk'
-H 'Content-Type: application/json'
--data-binary '{
  "add": [
    {
      "entity": "a940bb61-33c4-42c9-9231-c8194c305db3",
      "type": "ip_cidr",
      "value": "newdomain.com",
      "reason": "dev"
    }
  ]
}'
--compressed 
-u api_token:

End Date Assets

POST command
curl 'https://api.bitsighttech.com/ratings/v1/companies/infrastructure/bulk'
-H 'Content-Type: application/json'
--data-binary '{
  "expire": [
    {
      "entity": "a940bb61-33c4-42c9-9231-c8194c305db3",
      "type": "ip_cidr",
      "value": "23.4.128.0/20",
    }
  ]
}'
--compressed 
-u api_token:

Example Response

The response may include a message (value) if an error or failed validation occurs.

{
  "add":[
    {
      "value":[
        "Invalid net_cidr mask: 24.6.0.0/19. IPv4 CIDR mask must be greater or equal to 20."
      ]
    }
  ]
}

Status Codes

See common errors and status codes.

202 – Okay
Everything worked as expected.
400 – Bad Request

This can often be due to an error or missing a required parameter.

  • Malformed CIDR or domain
  • Duplicate entry
  • Not found
  • September 18, 2023: Permissions.
  • April 20, 2023: Help and troubleshooting.
  • March 31, 2023: Published.
Was this article helpful?
0 out of 0 found this helpful

Comments

3 comments
Date Votes
  • Correction… getting error 400's. I was getting Error 500 initially because it was submitted as an array (I think).

    0
  • Hello… I have answered my own question…

    ‘type’ uses ‘cidr’ or ‘domain’… (ip_cidr from example is invalid), and…

    ‘reason’ appears to be * Required. Follow link for accepted values. Found this when using the GUI, and it stated that REASON was missing.

    0
  • The BitSight GUI on adding Assets includes a preselected option “Apply a 60-day grace period before assets impact your company ratings.”

    Will this option be reflected in future updates to the API?

    We are unable to determine if the option for 60-day-grace is enabled or disabled after using the API.

    Thank you.

    0

Please sign in to leave a comment.