English
Reset Session
PUT/sessionLog the Zate device out of your Telegram account, then generate a new QR code. The session stays the same (id and session-id don't change), which makes this handy for switching Telegram accounts or fixing a login that's misbehaving.
After a reset
- The old login is cleared and the Zate device disappears from Settings → Devices in Telegram.
- A new QR is generated in the background. Fetch it with Get Session a few seconds later.
- Just like a new session, the QR must be scanned within 3 minutes. Otherwise the session is deleted.
- If the webhook is on, its settings stay, but events start over after the new login.
Endpoint Details
- Base URL:
https://api-zate.azickri.com - Headers:
idandsession-id
Headers
| Header | Type | Required | Description |
|---|---|---|---|
id | string | Yes | id from Create Session. |
session-id | string | Yes | sessionId from Create Session. |
Example Request
bash
curl -X PUT "https://api-zate.azickri.com/session" \
-H "id: YOUR_ID" \
-H "session-id: YOUR_SESSION_ID"javascript
import axios from 'axios';
const response = await axios.put('https://api-zate.azickri.com/session', null, {
headers: {
'id': 'YOUR_ID',
'session-id': 'YOUR_SESSION_ID',
},
});
console.log(response.data);javascript
const response = await fetch('https://api-zate.azickri.com/session', {
method: 'PUT',
headers: {
'id': 'YOUR_ID',
'session-id': 'YOUR_SESSION_ID',
},
});
const data = await response.json();
console.log(data);Response
json
{
"id": "68b3f0a2c1d4e5f6a7b8c9d0"
}json
{
"statusCode": 400,
"message": "invalid header"
}json
{
"statusCode": 404,
"message": "session not found"
}| Field | Type | Description |
|---|---|---|
id | string | ID of the session that was reset. |
Next
Poll Get Session until qrcode is filled in, then scan again from Settings → Devices → Link Desktop Device.