View as Markdown

Label a session as bot or human

POST /v1/sessions/{sessionId}/label
Base URL
https://api.isnotai.com

Authenticate with Authorization: Bearer aik_v1_... (preferred) or the x-api-key header. Keys are region-bound. Authentication

Available Regions 2 regions

Labeling is an idempotent upsert: repeating the call overwrites the previous label, so it is safe to retry after a timeout or 5xx. A sessionId that does not exist - or that belongs to another integration - returns 404 NOT_FOUND (cross-tenant access intentionally returns 404 rather than 403, so ids cannot be enumerated across tenants).

Path Parameters

sessionId
string Required

Session id.

application/json

Body

isBot
boolean Required
confidence
string

How sure the labeler is. Defaults to medium when omitted.

Default is medium.
Values are high, medium, low, null.
notes
string
Maximum length is 1000.

Responses

Any authenticated route can also return 401 (missing or invalid key), 429 RATE_LIMITED (edge rate limit; Retry-After is an integer number of seconds), and 5xx errors, even where not listed below. See Error Handling and Rate Limits.

200 application/json

Payload of SessionLabelResponse

Show 1 response attribute Hide response attributes
data
object
Show 6 data attributes Hide data attributes
sessionId
string
isBot
boolean
confidence
string
labeledAt
string(date-time)
labeledBy
string
notes
string
400 application/json

Payload of ErrorEnvelope

Show 1 response attribute Hide response attributes
error
object
Show 3 error attributes Hide error attributes
code
string Required
message
string Required
details
object Required

Always present and null unless the error carries field-level context (validation errors set details.field to the offending parameter name).

401 application/json

Payload of ErrorEnvelope

Show 1 response attribute Hide response attributes
error
object
Show 3 error attributes Hide error attributes
code
string Required
message
string Required
details
object Required

Always present and null unless the error carries field-level context (validation errors set details.field to the offending parameter name).

404 application/json

Payload of ErrorEnvelope

Show 1 response attribute Hide response attributes
error
object
Show 3 error attributes Hide error attributes
code
string Required
message
string Required
details
object Required

Always present and null unless the error carries field-level context (validation errors set details.field to the offending parameter name).

POST /v1/sessions/{sessionId}/label
curl --request POST \
  --url https://api.isnotai.com/v1/sessions/your-sessionId/label \
  --header 'Authorization: Bearer aik_v1_YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"isBot":false}'
import requests

url = "https://api.isnotai.com/v1/sessions/your-sessionId/label"

payload = { "isBot": False }
headers = {
    "Authorization": "Bearer aik_v1_YOUR_API_KEY",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
const fetch = require('node-fetch');

const url = 'https://api.isnotai.com/v1/sessions/your-sessionId/label';
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer aik_v1_YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: '{"isBot":false}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("https://api.isnotai.com/v1/sessions/your-sessionId/label"),
    Headers =
    {
        { "Authorization", "Bearer aik_v1_YOUR_API_KEY" },
    },
    Content = new StringContent("{\"isBot\":false}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}

Try it

Collapse

Sent to the API as Authorization: Bearer aik_v1_.... Held only in this tab's input element; re-enter on each browser tab. The docs site never receives or stores it.

Path parameters

Session id.

Request examples
{
  "isBot": false
}
200 Response examples
{
  "data": {
    "sessionId": "string",
    "isBot": false,
    "confidence": "string",
    "labeledAt": "2024-01-01T00:00:00Z",
    "labeledBy": "string",
    "notes": "string"
  }
}
400 Response examples
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  }
}
401 Response examples
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  }
}
404 Response examples
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  }
}