Skip to main content
POST
/
metadata
Create a metadata object
curl --request POST \
  --url https://api.altostrat.io/metadata \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "resource_id": "9b52d930-f432-4c0a-bac0-4c12dff85544",
  "type": "mikrotik.device",
  "metadata": {
    "name": "Main Office Router",
    "location": "Level 5, Server Room A",
    "contact_person": "john.doe@example.com"
  }
}'
{
  "resource_id": "9b52d930-f432-4c0a-bac0-4c12dff85544",
  "type": "mikrotik.device",
  "metadata": {
    "circuit_id": "AS12345-XYZ",
    "install_date": "2025-01-15",
    "is_critical": true,
    "rack_units": 2
  }
}

Authorizations

Authorization
string
header
required

A bearer token is required for all API requests.

Body

application/json

The resource identifier and the metadata to associate with it.

resource_id
string<uuid>
required

The UUID of the resource to associate metadata with.

Example:

"9b52d930-f432-4c0a-bac0-4c12dff85544"

type
string
required

A string identifying the type of the resource.

Example:

"mikrotik.device"

metadata
object
required

The key-value data to store. A 'name' key is required when creating new metadata.

Example:
{
"name": "Main Office Router",
"location": "Level 5, Server Room A",
"contact_person": "john.doe@example.com"
}

Response

Metadata created or updated successfully.

resource_id
string<uuid>

The unique identifier of the resource this metadata belongs to.

Example:

"9b52d930-f432-4c0a-bac0-4c12dff85544"

type
string

A string identifying the type of the resource.

Example:

"mikrotik.device"

metadata
object

A free-form object containing key-value pairs. Values can be strings, numbers, or booleans.

Example:
{
"circuit_id": "AS12345-XYZ",
"install_date": "2025-01-15",
"is_critical": true,
"rack_units": 2
}