{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fetchai/json-schema/fetchai-agent-v2-schema.json",
  "title": "AgentV2",
  "description": "Agent model for v2 API - excludes profile fields (name, domain, readme, avatar_url, short_description).",
  "x-generated": "2026-12-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hosting_openapi.json#/components/schemas/AgentV2",
  "properties": {
    "address": {
      "type": "string",
      "title": "Address",
      "description": "Bech32 address of the agent."
    },
    "running": {
      "type": "boolean",
      "title": "Running",
      "description": "Whether the agent is currently running."
    },
    "compiled": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Compiled",
      "description": "Whether the agent code has been compiled."
    },
    "code_digest": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Code Digest",
      "description": "Digest of the agent's code."
    },
    "wallet_address": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Wallet Address",
      "description": "Wallet address of the agent."
    },
    "code_update_timestamp": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Code Update Timestamp",
      "description": "Last time the code was updated."
    },
    "creation_timestamp": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Creation Timestamp",
      "description": "Time when the agent was created."
    },
    "revision": {
      "type": "integer",
      "title": "Revision",
      "description": "Revision number of the agent.",
      "default": 0
    },
    "metadata": {
      "anyOf": [
        {
          "$ref": "#/$defs/AgentMetadata"
        },
        {
          "type": "null"
        }
      ],
      "description": "Metadata associated with the agent."
    }
  },
  "type": "object",
  "required": [
    "address",
    "running"
  ],
  "$defs": {
    "AgentGeoLocation": {
      "properties": {
        "latitude": {
          "type": "number",
          "title": "Latitude"
        },
        "longitude": {
          "type": "number",
          "title": "Longitude"
        },
        "radius": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Radius"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "latitude",
        "longitude"
      ],
      "title": "AgentGeoLocation"
    },
    "AgentGeoLocationDetails": {
      "properties": {
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name",
          "description": "the full agent location"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description",
          "description": "the description of the agent location"
        },
        "latitude": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Latitude",
          "description": "the latitude of the agent location"
        },
        "longitude": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Longitude",
          "description": "the longitude of the agent location"
        },
        "street": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Street",
          "description": "the street where the agent is located"
        },
        "city": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "City",
          "description": "the city where the agent is located"
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "State",
          "description": "the state where the agent is located"
        },
        "postal_code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Postal Code",
          "description": "the postal code where the agent is located"
        },
        "country": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Country",
          "description": "the country where the agent is located"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Url",
          "description": "the url belonging to the agent location"
        },
        "image_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Image Url",
          "description": "the image url belonging to the agent location"
        }
      },
      "type": "object",
      "title": "AgentGeoLocationDetails"
    },
    "AgentMetadata": {
      "properties": {
        "geolocation": {
          "anyOf": [
            {
              "$ref": "#/$defs/AgentGeoLocation"
            },
            {
              "$ref": "#/$defs/AgentGeoLocationDetails"
            },
            {
              "type": "null"
            }
          ],
          "title": "Geolocation"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "title": "AgentMetadata",
      "description": "Model used to validate metadata for an agent.\n\nFramework specific fields will be added here to ensure valid serialization.\nAdditional fields will simply be passed through."
    }
  }
}