{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "definitions": {
        "scope": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "status": {
            "type": "string",
            "enum": [
                "active",
                "inactive"
            ]
        }
    },
    "properties": {
        "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "accessTokenId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "userId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
        },
        "creationDate": {
            "type": "string",
            "format": "date-time"
        },
        "lastUpdated": {
            "type": "string",
            "format": "date-time"
        },
        "expirationDate": {
            "type": "string",
            "format": "date-time"
        },
        "scope": {
            "$ref": "#/definitions/scope"
        },
        "status": {
            "$ref": "#/definitions/status"
        },
        "token": {
            "type": "string"
        }
    }
}