{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ovh/json-schema/ovh-metrics-api-token-schema.json",
  "title": "metrics.api.Token",
  "description": "Structure holding the elements about a token",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ovh-v1-metrics-openapi.yml#/components/schemas/metrics.api.Token",
  "type": "object",
  "properties": {
    "access": {
      "type": "string",
      "description": "The actual access token",
      "format": "password",
      "readOnly": true
    },
    "createdAt": {
      "type": "string",
      "description": "Token creation date",
      "format": "date-time",
      "readOnly": true
    },
    "description": {
      "type": "string",
      "description": "Description of the token",
      "readOnly": true
    },
    "expiryAt": {
      "type": "string",
      "description": "Token expiration date",
      "format": "date-time",
      "readOnly": true
    },
    "id": {
      "type": "string",
      "description": "Id of the token",
      "readOnly": true
    },
    "isRevoked": {
      "type": "boolean",
      "description": "Is your token revoked?",
      "readOnly": true
    },
    "labels": {
      "type": "array",
      "description": "Labels for the token if set",
      "items": {
        "$ref": "#/$defs/metrics.api.Label"
      },
      "readOnly": true
    },
    "permission": {
      "allOf": [
        {
          "$ref": "#/$defs/metrics.api.PermissionEnum"
        }
      ],
      "description": "Token permission: read or write",
      "readOnly": true
    }
  },
  "$defs": {
    "metrics.api.Label": {
      "type": "object",
      "description": "Structure holding the elements about a label",
      "properties": {
        "key": {
          "type": "string",
          "description": "Label key"
        },
        "value": {
          "type": "string",
          "description": "Label value"
        }
      }
    },
    "metrics.api.PermissionEnum": {
      "type": "string",
      "description": "Metrics service token permissions",
      "enum": [
        "read",
        "write"
      ]
    }
  }
}