CTY Auth Docs Get an API key

API Reference


Licenses

Issue keys, read them, freeze them, move their clock and delete them.

A license is one key on one application. It carries a duration, a device limit, and a clock that only starts when the key is first used.

Keys issued through this API are free of charge and may be lifetime, because the token acts as the workspace owner rather than as a reseller spending a balance.

Worth knowing

The key is the id Every per-license path takes the key string itself, not a numeric id: /licenses/7K2M-9QXD-4TPL-B8NR.
Statuses unused has never been redeemed, active is running, expired ran out, frozen has a paused clock, disabled was revoked.

#List licenses

GET https://api.ctyauth.com/manage/v1/licenses

Newest first. Combine the filters freely.

Query parameters

application_idstringoptional
Only keys on this application. The pub_ application id from the panel.
statusstringoptional
One of active, unused, expired, frozen, disabled.
qstringoptional
Matches part of the key. Up to 64 characters.
per_pageintegeroptional
Between 1 and 200. Defaults to 50.

Can answer

GET /licenses
GET /manage/v1/licenses HTTP/1.1
Host: api.ctyauth.com
X-Api-Key: ck_your_key
X-Api-Secret: sk_your_secret
Accept: application/json
{
    "licenses": [
        {
            "key": "7K2M-9QXD-4TPL-B8NR",
            "status": "active",
            "resume_on_login": false,
            "duration": "7day",
            "application_id": "pub_your_application_id",
            "application": "My App",
            "devices": {
                "used": 1,
                "max": 3
            },
            "first_used_at": "2026-09-12T10:00:00+00:00",
            "expires_at": "2026-09-19T10:00:00+00:00",
            "created_at": "2026-09-11T18:22:00+00:00"
        }
    ],
    "page": {
        "current": 1,
        "last": 18,
        "total": 873,
        "per_page": 50
    }
}

#Issue keys

POST https://api.ctyauth.com/manage/v1/licenses

Creates one or many keys at once and answers with the plain key strings.

Body

application_idstringrequired
The application to issue on. The pub_ application id from the panel.
durationstringrequired
A duration the application prices, or lifetime.
quantityintegeroptional
Between 1 and 500. Defaults to 1.
max_devicesintegeroptional
Between 1 and 100. Defaults to 1.
custom_keystringoptional
Your own key string instead of a generated one. 6 to 64 characters of A-Z a-z 0-9 . _ -, and only with quantity 1.

Can answer

POST /licenses
POST /manage/v1/licenses HTTP/1.1
Host: api.ctyauth.com
X-Api-Key: ck_your_key
X-Api-Secret: sk_your_secret
Accept: application/json
Content-Type: application/json

{
    "application_id": "pub_your_application_id",
    "duration": "7day",
    "quantity": 10,
    "max_devices": 2
}
{
    "keys": [
        "7K2M-9QXD-4TPL-B8NR",
        "3B8N-2PLV-6HQW-T1ZC"
    ],
    "licenses": [
        {
            "key": "7K2M-9QXD-4TPL-B8NR",
            "status": "active",
            "resume_on_login": false,
            "duration": "7day",
            "application_id": "pub_your_application_id",
            "application": "My App",
            "devices": {
                "used": 1,
                "max": 3
            },
            "first_used_at": "2026-09-12T10:00:00+00:00",
            "expires_at": "2026-09-19T10:00:00+00:00",
            "created_at": "2026-09-11T18:22:00+00:00"
        }
    ]
}

#Read one key

GET https://api.ctyauth.com/manage/v1/licenses/{key}

The key with every device currently bound to it, most recently seen first.

Path parameters

keystringrequired
The license key.

Can answer

GET /licenses/{key}
GET /manage/v1/licenses/7K2M-9QXD-4TPL-B8NR HTTP/1.1
Host: api.ctyauth.com
X-Api-Key: ck_your_key
X-Api-Secret: sk_your_secret
Accept: application/json
{
    "license": {
        "key": "7K2M-9QXD-4TPL-B8NR",
        "status": "active",
        "resume_on_login": false,
        "duration": "7day",
        "application_id": "pub_your_application_id",
        "application": "My App",
        "devices": {
            "used": 1,
            "max": 3
        },
        "first_used_at": "2026-09-12T10:00:00+00:00",
        "expires_at": "2026-09-19T10:00:00+00:00",
        "created_at": "2026-09-11T18:22:00+00:00"
    },
    "devices": [
        {
            "hwid": "a1b2c3d4e5f6",
            "last_ip": "203.0.113.9",
            "last_version": "1.4.2",
            "first_seen_at": "2026-09-12T10:00:00+00:00",
            "last_seen_at": "2026-09-19T08:41:00+00:00"
        }
    ]
}

#Update a key

PATCH https://api.ctyauth.com/manage/v1/licenses/{key}

Revoke or restore a key, or change how many devices it allows.

Path parameters

keystringrequired
The license key.

Body

is_activebooleanoptional
False revokes the key, true restores it.
max_devicesintegeroptional
Between 1 and 100. Lowering it does not unbind devices already on the key.

Can answer

PATCH /licenses/{key}
PATCH /manage/v1/licenses/7K2M-9QXD-4TPL-B8NR HTTP/1.1
Host: api.ctyauth.com
X-Api-Key: ck_your_key
X-Api-Secret: sk_your_secret
Accept: application/json
Content-Type: application/json

{
    "is_active": false
}
{
    "license": {
        "key": "7K2M-9QXD-4TPL-B8NR",
        "status": "disabled",
        "resume_on_login": false,
        "duration": "7day",
        "application_id": "pub_your_application_id",
        "application": "My App",
        "devices": {
            "used": 1,
            "max": 3
        },
        "first_used_at": "2026-09-12T10:00:00+00:00",
        "expires_at": "2026-09-19T10:00:00+00:00",
        "created_at": "2026-09-11T18:22:00+00:00"
    }
}

#Freeze and unfreeze

POST https://api.ctyauth.com/manage/v1/licenses/{key}/freeze

Freezing pauses the clock and keeps the time the key has left. POST /licenses/{key}/unfreeze starts it again from that point. Either way the time spent frozen is added back to the expiry date.

Path parameters

keystringrequired
The license key.

Body

resume_on_loginbooleanoptional
True lets the key unfreeze itself the next time a client signs in with it. False, the default, keeps it frozen until you unfreeze it. Freezing a key that is already frozen only updates this choice.

Can answer

POST /licenses/{key}/freeze
POST /manage/v1/licenses/7K2M-9QXD-4TPL-B8NR/freeze HTTP/1.1
Host: api.ctyauth.com
X-Api-Key: ck_your_key
X-Api-Secret: sk_your_secret
Accept: application/json
Content-Type: application/json

{
    "resume_on_login": true
}
{
    "license": {
        "status": "frozen",
        "resume_on_login": true,
        "key": "7K2M-9QXD-4TPL-B8NR",
        "duration": "7day",
        "application_id": "pub_your_application_id",
        "application": "My App",
        "devices": {
            "used": 1,
            "max": 3
        },
        "first_used_at": "2026-09-12T10:00:00+00:00",
        "expires_at": "2026-09-19T10:00:00+00:00",
        "created_at": "2026-09-11T18:22:00+00:00"
    }
}

#Reset devices

POST https://api.ctyauth.com/manage/v1/licenses/{key}/reset-devices

Unbinds every device on the key so the next machine to run it takes a free slot. The clock is untouched.

Path parameters

keystringrequired
The license key.

Can answer

POST /licenses/{key}/reset-devices
POST /manage/v1/licenses/7K2M-9QXD-4TPL-B8NR/reset-devices HTTP/1.1
Host: api.ctyauth.com
X-Api-Key: ck_your_key
X-Api-Secret: sk_your_secret
Accept: application/json
{
    "license": {
        "devices": {
            "used": 0,
            "max": 3
        },
        "key": "7K2M-9QXD-4TPL-B8NR",
        "status": "active",
        "resume_on_login": false,
        "duration": "7day",
        "application_id": "pub_your_application_id",
        "application": "My App",
        "first_used_at": "2026-09-12T10:00:00+00:00",
        "expires_at": "2026-09-19T10:00:00+00:00",
        "created_at": "2026-09-11T18:22:00+00:00"
    }
}

#Extend and shorten

POST https://api.ctyauth.com/manage/v1/licenses/{key}/extend

Adds time to a running key, priced as one duration times a count. POST /licenses/{key}/shorten takes the same body and gives time back without refunding anything.

Path parameters

keystringrequired
The license key.

Body

durationstringrequired
A duration the application prices.
countintegeroptional
How many of that duration. Between 1 and 50. Defaults to 1.

Can answer

POST /licenses/{key}/extend
POST /manage/v1/licenses/7K2M-9QXD-4TPL-B8NR/extend HTTP/1.1
Host: api.ctyauth.com
X-Api-Key: ck_your_key
X-Api-Secret: sk_your_secret
Accept: application/json
Content-Type: application/json

{
    "duration": "7day",
    "count": 2
}
{
    "license": {
        "expires_at": "2026-10-03T10:00:00+00:00",
        "key": "7K2M-9QXD-4TPL-B8NR",
        "status": "active",
        "resume_on_login": false,
        "duration": "7day",
        "application_id": "pub_your_application_id",
        "application": "My App",
        "devices": {
            "used": 1,
            "max": 3
        },
        "first_used_at": "2026-09-12T10:00:00+00:00",
        "created_at": "2026-09-11T18:22:00+00:00"
    }
}

#Delete a key

DELETE https://api.ctyauth.com/manage/v1/licenses/{key}

Removes the key and its devices for good. Revoking with is_active: false is usually what you want instead, because it keeps the record.

Path parameters

keystringrequired
The license key.

Can answer

DELETE /licenses/{key}
DELETE /manage/v1/licenses/7K2M-9QXD-4TPL-B8NR HTTP/1.1
Host: api.ctyauth.com
X-Api-Key: ck_your_key
X-Api-Secret: sk_your_secret
Accept: application/json
{
    "deleted": "7K2M-9QXD-4TPL-B8NR"
}