Skip to content
Streamkap
Esc
↑↓navigate↵open⌘Jpreview

Get Agent Sample Record

Pull the latest record from the topic that matches topicPattern.

Useful as a concrete sample record for POST /agents/test-run. Returns 200 in every “no record” case (regex matches no topic, every matched topic is empty, deserialization fails), with the reason in the response body rather than an HTTP error.

Requires read:agents.

Per-tenant rate limit: 30 req/min -> 429 with Retry-After.

POST/agents/sample-record
Authorization
AuthorizationBearer token · headerrequired
Request body
requiredapplication/json
topicPatternstringrequired

Regex pattern for input topics, e.g. '^(orders)$'

min length 1 · max length 1024
inputSerializationSampleRecordSerializationEnumrequired

Format used to deserialize the latest record

Allowed:AvroConfluentJsonConfluentProtobufString
Responses
200

Successful Response

recordobject | null

The latest deserialized record, or null if none was found

Show properties
Any of:
object
object
null
null
sourceTopicstring | null

Concrete topic name the record came from after regex resolution

Show properties
Any of:
string
string
null
null
errorMessagestring | null

Set when a topic was found but its latest record could not be read or deserialized

Show properties
Any of:
string
string
null
null
422

Validation Error

detailValidationError[]
Show properties
Array of ValidationError
locstring | integer[]required
Show properties
Array of string | integer
Any of:
string
string
integer
integer
msgstringrequired
typestringrequired
inputany
ctxobject
Request
curl -X POST 'https://api.streamkap.com/agents/sample-record' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "topicPattern": "string",
  "inputSerialization": "AvroConfluent"
}'
Response
{
  "record": {},
  "sourceTopic": "string",
  "errorMessage": "string"
}