CreateScope

This method can be used for the following functionality: Create new assets on a project that you have Edit access to.

Parameters

The following URL, Headers and Parameters are required for requests to this API endpoint. Where a parameter is optional, it will be indicated. Otherwise treat all parameters as mandatory.

Headers

POST /api/ss/project/:id/assets HTTP/1.1
Host: demo.attackforge.com
X-SSAPI-KEY: APIKey
Content-Type: application/json
Connection: close

Query

id (string)

Id of the project.

Example:

POST /api/ss/project/5e7c29afa3362408cf502a11/assets HTTP/1.1

assets (array of strings)

Assets to create on the project.

Example:

{
   "assets": ["...", "...", "..."]
}

asset_library_ids (array of strings) (optional)

Asset libraries to map scope against.

Example:

{
   "asset_library_ids": ["6569608e55bc00bacc67b417", "...", "..."]
}

Example

The following example is a cURL request to create new assets on a project.

Request

Include API Token instead of stars in 'X-SSAPI-KEY: ***************************************' parameter.

curl -X POST 'https://demo.attackforge.com/api/ss/project/5e7c29afa3362408cf502a11/assets' -H 'Host: demo.attackforge.com' -H 'X-SSAPI-KEY: ***************************************' -H 'Content-Type: application/json' -H 'Connection: close' -d '{
  "assets": ["Asset 1", "Asset 2", "Asset 3"]
}'

Response

Response contains an array of created asset objects.

{
   "count": 999,
   "assets": [
      {
         "id": "...",
         "name": "..."
      }
   ]
}

Last updated

Check YouTube for more tutorials: https://youtube.com/@attackforge