RU

Provider API

Manage your service from code: domains, links, settings and notifications.

Issue a key in the cabinet: Setup → API. A new key replaces the old one. Keep it on your server.

Terminal
curl https://bot.nyaclient.xyz/api/v1/provider \
  -H "Authorization: Bearer nya_..." 
MethodPathWhat it does
GET/api/v1/providerStatus: domains, devices, term, settings
POST/api/v1/domainsReplace domains: {"domains": ["sub.example.com"]}
POST/api/v1/settingsReplace app settings: {"settings": {"hide-settings": "1"}}
GET/api/v1/linksList limited links
POST/api/v1/linksCreate: {"url": "https://…", "limit": 3, "note": "order 1"}
POST/api/v1/links/deleteDelete: {"id": "…"}
POST/api/v1/encryptEncrypt an address: {"url": "https://…"}
POST/api/v1/pushSubmit a notification, fields are in notifications

The subscription address in links must be on one of your domains. Errors return code 400 with an error field, a wrong key returns 401.

A nya://lim1/… link works for a set number of devices. A device that already added it gets the address again; a new one only while the limit is not used up. The app receives the subscription address encrypted and never shows it.