API Reference Mark In-App Message Seen
Mark In-App Message Seen
Mark an in-app message as shown, so it never comes back.
Session token
Marks one of your in-app messages as seen. It leaves List In-App Messages for good, and the same message isn't emailed to you either. The dashboard calls this when you dismiss the card or follow its button.
Note
Requires a session JWT — a dashboard session or an stx login token. API keys are rejected with 401. You can only mark your own messages. Any plan.
Path Parameters
NameDescription
idThe message
id from List In-App Messages.No request body.
Error Responses
400 Bad Request
validation_error — the id isn't a UUID.
401 Unauthorized
unauthorized for a missing, invalid or expired token (or an API key); session_revoked when the session has been signed out.
404 Not Found
not_found — the id is unknown, belongs to someone else, or was already marked seen. The API doesn't say which.
json
{
"error": {
"code": "not_found",
"message": "Message not found",
"details": { "traceId": "6f1c2a9e-3b7d-4c11-9a0e-2d5f8b4c7e10" }
}
}
Was this page helpful? Yes No
Previous
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl -X POST https://api.syntext.dev/v1/me/lifecycle/messages/3b8f2c41-9d6e-4a17-b0c5-7e21f4a9d8c3/seen \
-H "Authorization: Bearer $SYNTEXT_JWT"
// A browser has no environment variables: set these to your values.
const SYNTEXT_JWT = '<SYNTEXT_JWT>';
const response = await fetch('https://api.syntext.dev/v1/me/lifecycle/messages/3b8f2c41-9d6e-4a17-b0c5-7e21f4a9d8c3/seen', {
method: 'POST',
headers: {
'Authorization': `Bearer ${SYNTEXT_JWT}`,
},
});
const data = await response.json();
console.log(response.status, data);
import os
import requests
url = "https://api.syntext.dev/v1/me/lifecycle/messages/3b8f2c41-9d6e-4a17-b0c5-7e21f4a9d8c3/seen"
headers = {
"Authorization": f"Bearer {os.environ['SYNTEXT_JWT']}",
}
response = requests.post(url, headers=headers)
print(response.status_code)
print(response.json())
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("POST", "https://api.syntext.dev/v1/me/lifecycle/messages/3b8f2c41-9d6e-4a17-b0c5-7e21f4a9d8c3/seen", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("SYNTEXT_JWT"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status)
fmt.Println(string(body))
}
require "net/http"
require "uri"
uri = URI("https://api.syntext.dev/v1/me/lifecycle/messages/3b8f2c41-9d6e-4a17-b0c5-7e21f4a9d8c3/seen")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch("SYNTEXT_JWT")}"
response = http.request(request)
puts response.code
puts response.body
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.syntext.dev/v1/me/lifecycle/messages/3b8f2c41-9d6e-4a17-b0c5-7e21f4a9d8c3/seen',
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SYNTEXT_JWT'),
],
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
echo $status, PHP_EOL, $response, PHP_EOL;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.syntext.dev/v1/me/lifecycle/messages/3b8f2c41-9d6e-4a17-b0c5-7e21f4a9d8c3/seen"))
.header("Authorization", "Bearer " + System.getenv("SYNTEXT_JWT"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.syntext.dev/v1/me/lifecycle/messages/3b8f2c41-9d6e-4a17-b0c5-7e21f4a9d8c3/seen");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer " + Environment.GetEnvironmentVariable("SYNTEXT_JWT"));
using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
Responseapplication/json
200OK
{
"data": {
"id": "3b8f2c41-9d6e-4a17-b0c5-7e21f4a9d8c3",
"seen": true
}
}