# Creating Assets

Now that we’ve created an Asset Type (The ‘Hero’ Asset Type), it’s time to create our first actual Asset (‘A Hero’).

### Asset Creation

Notice that Assets are incredibly flexible, they can refer to physical objects or people, as in this example (we’ll unpack this right after):

#### **Creating Asset - A Hero**

```
POST api.skyledge.com/asset-types/{assetTypeId}/assets

{  
   "assetIdentifier":"hero_001",
   "name":"High Flyer",
   "description":"A high-flying superhero.",
   "attributes":{  
      "icon":"superhero",
      "powers":[  
         "Flight"
      ]
   },
   "metrics":{  
      "remainingPower":100
   },
   "location":{  
      "type":"Point",
      "coordinates":[  
         -73.9848,
         40.7586
      ]
   }
}

```

{% tabs %}
{% tab title="cURL" %}

```
curl --location --request POST 'https://api.skyledge.com/asset-types/ASSET_TYPE_ID/assets' \
--header 'X-Authorization: API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{  
   "assetIdentifier":"hero_001",
   "name":"High Flyer",
   "description":"A high-flying superhero.",
   "attributes":{  
      "icon":"superhero",
      "powers":[  
         "Flight"
      ]
   },
   "metrics":{  
      "remainingPower":100
   },
   "location":{  
      "type":"Point",
      "coordinates":[  
         -73.9848,
         40.7586
      ]
   }
}'
```

{% endtab %}

{% tab title="NodeJs" %}

```
import { Configuration, AssetRequest, AssetsApi } from '@skyledge/sdk';

const configuration = new Configuration({
  apiKey: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX',
  basePath: 'https://api.skyledge.com',
});

const data: AssetRequest = {
  assetIdentifier: 'hero_001',
  name: 'High Flyer',
  description: 'A high-flying superhero.',
  attributes: {
    icon: 'superhero',
    powers: ['Flight'],
  },
  metrics: {
    remainingPower: 100,
  },
  location: {
    type: 'Point',
    coordinates: [[-73.9848, 40.7586]],
  },
} as any;

const assetTypeId = ASSET_TYPE_ID;

const assetApi = new AssetsApi(configuration);

const createAsset = await assetApi.createAsset(assetTypeId, data);

console.log(createAsset.status);

```

{% endtab %}

{% tab title="Python" %}

```
import requests
import json

url = "https://api.skyledge.com/asset-types/ASSET_TYPE_ID/assets"

payload = json.dumps({
  "assetIdentifier": "hero_001",
  "name": "High Flyer",
  "description": "A high-flying superhero.",
  "attributes": {
    "icon": "superhero",
    "powers": [
      "Flight"
    ]
  },
  "metrics": {
    "remainingPower": 100
  },
  "location": {
    "type": "Point",
    "coordinates": [
      -73.9848,
      40.7586
    ]
  }
})
headers = {
  'X-Authorization': 'API_KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)var axios = require('axios');
var data = JSON.stringify({
  "assetIdentifier": "hero_001",
  "name": "High Flyer",
  "description": "A high-flying superhero.",
  "attributes": {
    "icon": "superhero",
    "powers": [
      "Flight"
    ]
  },
  "metrics": {
    "remainingPower": 100
  },
  "location": {
    "type": "Point",
    "coordinates": [
      -73.9848,
      40.7586
    ]
  }
});

var config = {
  method: 'post',
  url: 'https://api.skyledge.com/asset-types/ASSET_TYPE_ID/assets',
  headers: { 
    'X-Authorization': 'API_KEY', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});


```

{% endtab %}
{% endtabs %}

You can see the asset in the control room now:

![](https://lh5.googleusercontent.com/g6kt2n-mkBDJHV9fOpNnpbXiskHH-31AyrQPUtZHueeSqimGrC5XRA-UhWh0LDTzYCvefJxsnKgp-FYOE7_QhKu4zIQfgYKFV3MSVdyRaDgit8N0zMsUmjYtQpLfVjfHnNBR50AY)

We can specify a few things as part of creating a new asset:

| **assetIdentifier** | Unique identifier of your own choosing                                                                                                                                                        |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **name**            | Meaningful name for your asset                                                                                                                                                                |
| **description**     | Describe your asset                                                                                                                                                                           |
| **attributes**      | Descriptive properties of your asset                                                                                                                                                          |
| **icon**            | Leaving this unspecified will create a default asset icon for you. If you have a custom icon, email <assets@skyledge.com> with the icon you’d like and it’ll be generated within a few hours. |

You’ll be able to see some/all of these attributes in a modal when you click on the asset. Pops up like this in the control room:

![Asset modal](https://lh3.googleusercontent.com/6XC6IBzk84o1RfCoc689rgvHjheHvMUMSQ1NkyyMk4g2_9efThzJSQi4U_Eemv136aE6IKDm4P9P05ua-C_ZkmyS1k2SEEjg_4PNASTzwPdb3ebuAQMNHtxV9Hkv3_40epkEPP9X)
