{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ovh/json-schema/ovh-auth-api-credential-schema.json",
  "title": "auth.ApiCredential",
  "description": "API Credential",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ovh-v1-auth-openapi.yml#/components/schemas/auth.ApiCredential",
  "type": "object",
  "properties": {
    "allowedIPs": {
      "type": [
        "array",
        "null"
      ],
      "description": "If defined, list of ip blocks which are allowed to call API with this credential",
      "items": {
        "$ref": "#/$defs/ipBlock"
      }
    },
    "applicationId": {
      "type": "integer",
      "description": "ID of associated API Application",
      "readOnly": true
    },
    "creation": {
      "type": "string",
      "description": "Creation date of this credential",
      "format": "date-time",
      "readOnly": true
    },
    "credentialId": {
      "type": "integer",
      "description": "ID of this credential",
      "readOnly": true
    },
    "expiration": {
      "type": [
        "string",
        "null"
      ],
      "description": "Expiration date of this credential",
      "format": "date-time",
      "readOnly": true
    },
    "lastUse": {
      "type": [
        "string",
        "null"
      ],
      "description": "Last use date of this credential",
      "format": "date-time",
      "readOnly": true
    },
    "ovhSupport": {
      "type": "boolean",
      "description": "States whether this credential has been created by yourself or by the OVH support team",
      "readOnly": true
    },
    "rules": {
      "type": "array",
      "description": "API routes allowed to this credential",
      "items": {
        "$ref": "#/$defs/auth.AccessRule"
      },
      "readOnly": true
    },
    "status": {
      "allOf": [
        {
          "$ref": "#/$defs/auth.CredentialStateEnum"
        }
      ],
      "description": "State of to this credential",
      "readOnly": true
    }
  },
  "$defs": {
    "auth.AccessRule": {
      "type": "object",
      "description": "Access rule allowed to an application",
      "properties": {
        "method": {
          "allOf": [
            {
              "$ref": "#/$defs/auth.HTTPMethodEnum"
            }
          ],
          "description": "Allowed Method",
          "readOnly": true
        },
        "path": {
          "type": "string",
          "description": "Allowed path",
          "readOnly": true
        }
      }
    },
    "auth.CredentialStateEnum": {
      "type": "string",
      "description": "All states a Credential can be in",
      "enum": [
        "expired",
        "pendingValidation",
        "refused",
        "validated"
      ]
    },
    "auth.HTTPMethodEnum": {
      "type": "string",
      "description": "All HTTP methods available",
      "enum": [
        "DELETE",
        "GET",
        "PATCH",
        "POST",
        "PUT"
      ]
    },
    "ipBlock": {
      "type": "string",
      "description": "IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24)",
      "format": "ip-block"
    }
  }
}