CTY Auth Docs Get an API key

API Reference


Applications

Read the applications in the workspace and the durations they price.

An application is one product you sell keys for. You create and configure them in the panel; this API reads them so your own code can pick the right application_id and duration when it issues a key.

Worth knowing

The application id Every application has one id, the pub_ string shown as Application id on the application in the panel. This API takes and returns only that string, for example pub_your_application_id.
Durations are strings A duration is written <number><unit>, where the unit is hour or day, plus the special value lifetime. 7day, 12hour and lifetime are all valid. Only durations this endpoint lists can be sold.

#List applications

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

Every application in the workspace with its priced durations. A locked token sees only its own.

Can answer

GET /applications
GET /manage/v1/applications HTTP/1.1
Host: api.ctyauth.com
X-Api-Key: ck_your_key
X-Api-Secret: sk_your_secret
Accept: application/json
{
    "applications": [
        {
            "id": "pub_your_application_id",
            "name": "My App",
            "description": null,
            "status": "active",
            "is_active": true,
            "current_version": "1.4.2",
            "key_prefix": null,
            "key_version": 2,
            "signing_public_key": "your_public_key_base64",
            "durations": [
                {
                    "duration": "7day",
                    "label": "7 Days",
                    "key_prefix": null,
                    "price_cents": 500
                },
                {
                    "duration": "30day",
                    "label": "30 Days",
                    "key_prefix": null,
                    "price_cents": 1500
                }
            ]
        }
    ],
    "max_duration_days": 3650
}