Session send
This endpoint re-send a code to user session.
API key
You must add the x-api-key: your-api-key from the admin panel settings to the headers
Endpoint
POST https://api.kod.mobi/session/send
Request
JSON body
SessionCreateBody
| Param |
Type |
Description |
Required |
| session_id |
ulid |
Session id |
true |
| type |
Channel |
Channel type |
true |
Session expiration
Each channel has 60 seconds sending timeout
Response
SessionCreateResponse
| Param |
Type |
Description |
| session_id |
ulid |
Session id |
| session_expired_at |
string | datetime |
Session expired datetime |
| channel |
SessionChannel |
Channel to sent |
Example
| curl --location 'https://api.kod.mobi/session/send' \
--header 'x-api-key: <replace me>' \
--data '{
"session_id": "<replace me>",
"type": "telegram"
}'
|
| const headers = new Headers();
myHeaders.append("x-api-key", "<replace me>");
const raw = JSON.stringify({
"session_id": "<replace me>",
"type": "telegram"
});
const requestOptions: RequestInit = {
method: "POST",
headers,
body: raw,
redirect: "follow"
};
fetch("https://api.kod.mobi/session/send", requestOptions)
.then((response) => response.json())
.then((result) => console.log(result))
.catch((error) => console.error(error));
|
| <?php
$client = new \GuzzleHttp\Client();
$headers = [
'x-api-key' => '<replace me>'
];
$body = '{
"session_id": "<replace me>",
"type": "telegram"
}';
$request = new Request('POST', 'https://api.kod.mobi/session/send', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
|
| package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
payload := strings.NewReader(`{
"session_id": "<replace me>",
"type": "telegram"
}`)
client := &http.Client {}
req, err := http.NewRequest("POST", "https://api.kod.mobi/session/send", payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("x-api-key", "<replace me>")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
|
| #[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::builder()
.build()?;
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "<replace me>".into());
let data = r#"{
"session_id": "<replace me>",
"type": "telegram"
}"#;
let json: serde_json::Value = serde_json::from_str(&data)?;
let request = client.request(reqwest::Method::POST, "https://api.kod.mobi/session/send")
.headers(headers)
.json(&json);
let response = request.send().await?;
let body = response.text().await?;
println!("{}", body);
Ok(())
}
|
Example output
{
"session_id": "01K8N1VMPN0EE389K72YW0CBM2",
"session_expired_at": "2025-10-28T10:31:00.000Z",
"channel": {
"name": "Telegram",
"type": "telegram",
"is_active": false,
"timeout": 60,
"image_url": "https://storage.kod.mobi/icons/telegram.svg",
"link": "https://t.me/my-tg-bot"
}
}