Yes you can, the API call is similar to any other call to Tyk Cloud or the Advanced management API (depending on the type of user you are), the request object is a slightly smaller version of a regular session object when you are generating a new token:


Request:

 

POST http://advanced.api.com:PORT/api/portal/policies
Authorization: your-api-key

{
    "last_check": 0,
    "allowance": 0,
    "rate": 1000,
    "per": 1,
    "expires": 1441624993,
    "quota_max": 10000,
    "quota_renews": 1444144962,
    "quota_remaining": 0,
    "quota_renewal_rate": 2520000,
    "access_rights": {
        "b605a6f03cc14f8b74665452c263bf19": {
            "api_id": "b605a6f03cc14f8b74665452c263bf19",
            "api_name": "Tyk Test API",
            "versions": [
                "v1"
            ]
        },
        "8015afad4bbc4e246aa3ef05184fe990": {
            "api_id": "8015afad4bbc4e246aa3ef05184fe990",
            "api_name": "Test Interface (Auth Token)",
            "versions": [
                "Default"
            ]
        },
        "1cf291a99aef4a8b5543fc68f5d990f6": {
            "api_id": "1cf291a99aef4a8b5543fc68f5d990f6",
            "api_name": "Benchmark",
            "versions": [
                "Default"
            ]
        }
    },
    "name": "Test",
    "is_inactive": false,
    "hmac_enabled": false,
    "tags": [
        "test-tag"
    ]
}

 


Response:


{"Status":"OK","Message":"55ed760a30c55e661e000004","Meta":""}