POST: Add Assets in Bulk

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

The infrastructure bulk endpoint add assets to a company’s infrastructure and sets end dates for assets that the company no longer owns. You send both actions as a single POST request with a JSON body. Bitsight reviews each end-date request before it takes effect. The source of added assets are considered to be “company-provided.”

Applies to: Admin and Group Admin users with API access to the company. See user permissions.

Before you begin

  • Confirm that your user has the Admin or Group Admin role. Other roles receive a 403 error.
  • Have an API token. 
  • Get the company’s entity GUID from the Portfolio Details endpoint.
  • For end dates, get each asset’s current values from GET /v1/companies/{company_guid}/infrastructure: attributed_to.guid, type, value, source.slug, and start_date.

Parameters

add

[Body] Assets to add.

Value: [Array] Asset and its change details.

{
  "entity": "entity_guid",
  "type": "string",
  "value": "string",
  "reason": "string"
}
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.

End date assets

Identify each asset with the values that Bitsight returns for it in the company's infrastructure (GET /v1/companies/{company_guid}/infrastructure): attributed_to.guid, type, value, source.slug and start_date.

expire

[Body] Assets to end-date.

Value: [Array] 1 to 50 assets, with no duplicates. Each asset must match an active asset in the company's infrastructure.

{
  "entity": "entity_guid",
  "type": "string",
  "value": "string",
  "source_slug": "string",
  "start_date": "YYYY-MM-DD",
  "end_date": "YYYY-MM-DD"
}
entity

* Required.

[Body] Identify the company that the asset is attributed to.

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

type

* Required.

[Body] Identify the type of asset.

Value: [String]

  • cidr
  • domain
value

* Required.

[Body] Identify the asset to end-date.

Value: [String]

  • Domain
  • IP address/CIDR
source_slug

* Required.

[Body] Identify the asset's source, as the asset's source.slug. Domains with the primary_domain or secondary_domain source can't be end-dated.

Value: [String] Example: dns_domain

start_date

* Required.

[Body] Identify the asset's start date, as Bitsight returns it.

Value: [String] See reasons.

end_date

* Required.

[Body] Define the date that the asset stopped belonging to your organization.

Value: [String] YYYY-MM-DD, from 2011-01-01 (the start of the Bitsight platform) through today, and not before the asset's start date. Future dates are not permitted.

↻ Default: Date of request (today, in UTC).

How End Dates Work

  • Bitsight reviews each end date request before applying it. Track the request with GET: Company-Provided Assets and operation_type.slug=expire. The request is pending until Bitsight decides, then completed, refuted or error. A refuted request's message explains why. See statuses.
  • Once applied, changes are recalculated from the end date onward.
  • End-dating a domain ends it for all of its sources on that company, except primary_domain and secondary_domain. If the request only names the domain's company-provided source, only the company-provided domain is end-dated.
  • A request is rejected if one of its assets already has a pending end date request.

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

The first asset ends on October 31, 2026. The second asset has no end_date, so it ends today.

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": "cidr",
      "value": "23.4.128.0/20",
      "source_slug": "ARIN",
      "start_date": "2019-06-01",
      "end_date": "2026-10-31"
    },
    {
      "entity": "a940bb61-33c4-42c9-9231-c8194c305db3",
      "type": "domain",
      "value": "olddomain.com",
      "source_slug": "dns_domain",
      "start_date": "2024-01-15"
    }
  ]
}'
--compressed
-u api_token:

Example Response

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

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": "cidr",
      "value": "23.4.128.0/20",
      "source_slug": "ARIN",
      "start_date": "2019-06-01",
      "end_date": "2026-10-31"
    },
    {
      "entity": "a940bb61-33c4-42c9-9231-c8194c305db3",
      "type": "domain",
      "value": "olddomain.com",
      "source_slug": "dns_domain",
      "start_date": "2024-01-15"
    }
  ]
}'
--compressed
-u api_token:

Example Responses

A successful request returns 202 with an empty object.

{}

Add Assets Errors

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."
      ]
    }
  ]
}

End Date Assets Errors

Errors in an expire request are listed in errors. Each error has its type, the field that it's about, the value sent and a description.

{
  "type": "invalid_post_request",
  "message": "There are errors in your request body",
  "errors": [
    {
      "type": "missing_required_field",
      "field": "start_date",
      "value": "",
      "description": "This field is required"
    },
    {
      "type": "invalid_parameter",
      "field": "end_date",
      "value": "2030-01-01",
      "description": "The end date cannot be in the future."
    }
  ]
}

Errors and status codes

Error types

Error type Meaning
missing_required_field A required field is missing, or expire is empty.
invalid_field_format A value has the wrong format, such as a date that isn't YYYY-MM-DD or a malformed domain or CIDR.
invalid_parameter A value isn't allowed, such as an unknown type, the primary_domain or secondary_domain source, or an end date in the future, before the start date or before 2011-01-01.
not_found The company wasn't found, or no active asset matches the entity, type, value, source_slug and start_date.
unauthorized You can't manage this company's infrastructure.
duplicate_entry The same asset is listed more than once.
limit_exceeded The request has more than 50 assets.
pending_expiration_exists The asset already has a pending end date request.

Status codes

Code Meaning
202 Okay - Everything worked as expected.
400 Bad request - The request is malformed or has a validation error. Common causes are a malformed CIDR or domain, a duplicate entry, or an asset that wasn’t found.
403 Forbidden - Your user role can’t add assets or set end dates. Only Admin and Group Admin can.

For other status codes, see common errors and status codes.

Publish Date or Recent Edits
  • November 18, 2026: End dates for any attributed asset: source_slug, start_date and end_date parameters, end date errors, and how end dates work.
  • 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.