API documentationAPI reference

Webhooks and events

Have Torre notify your application when someone applies, replies or a candidate search finishes. A webhook is an HTTPS endpoint in your application that receives those notifications.

Webhook subscriptions support:

1. Register your receiver

Prepare a public HTTPS receiver that you control. Replace the example URL below, then subscribe only to the events you handle:

curl -X POST https://api.torre.ai/v1/webhook-endpoints \
  -H "Authorization: Bearer $TORRE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/torre-events","events":["candidate.applied","message.replied"]}'

Save the returned endpoint id and secret in your secret store. The secret is shown once; subsequent GET responses return secret: null. Never paste it into an agent prompt.

Subscribe only to the event types that your callback handles. Update or delete an account-owned endpoint with its opaque endpoint id.

2. Verify each delivery

Torre sends Torre-Event-Id and Torre-Signature with every delivery. The signature uses HMAC-SHA-256 over <timestamp>.<raw-body> with the endpoint secret.

Verify the signature against the unmodified request body. Use the event id to deduplicate deliveries. Return a 2xx response only after accepting the event.

Parse the t timestamp and v1 digest from Torre-Signature. Reject malformed signatures and timestamps outside your chosen tolerance. Compute HMAC-SHA-256 using the complete returned secret, including its prefix, and compare equal-length digests with a timing-safe comparison. Do not parse and reserialize the JSON before verification. Persist the event before acknowledging it so a restart does not lose work. Deliveries can repeat and can be retried up to eight attempts.

Read the conversation after a reply

A new message.replied delivery identifies the person in data.candidateId, the message in data.messageId and the exact thread in data.conversationId. When the reply belongs to a job, it also includes data.openingId and data.topic:

{
  "candidateId": "2449615",
  "messageId": "message_a1B2c3D4",
  "conversationId": "room_a1B2c3D4;opportunities=8gQK2bWa",
  "openingId": "8gQK2bWa",
  "topic": { "id": "8gQK2bWa", "name": "opportunities" }
}

For a direct conversation, conversationId has no job suffix. Older stored events and their delivery retries can lack conversationId; use their openingId, or retrieve message history and select the exact thread before replying. Do not guess a conversation ID from the candidate or message ID.

Use those values with your own API key to read the sent and received messages:

curl --get "https://api.torre.ai/v1/candidates/$CANDIDATE_ID/messages" \
  -H "Authorization: Bearer $TORRE_API_KEY" \
  --data-urlencode "conversationId=$CONVERSATION_ID" \
  --data-urlencode "limit=25"

Alternatively, use openingId to select a job conversation, never both selectors. Omit both when you want all accessible topics with that person. Messages arrive newest first and include text, sender, recipients, topic and available attachment metadata. Deleted text and attachments are hidden. The stable message identity is type plus id, because native and external messages can share an id.

To reply in the same thread, copy data.candidateId into CANDIDATE_ID and the complete data.conversationId into the request body:

curl -X POST "https://api.torre.ai/v1/candidates/$CANDIDATE_ID/messages" \
  -H "Authorization: Bearer $TORRE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"body":"Thanks for your reply. What time works for you?","conversationId":"room_a1B2c3D4;opportunities=8gQK2bWa"}'

Do not remove the job context from the ID. Sending requires exactly one of conversationId or openingId; missing or conflicting selectors return 422. Mark read or unread with the same selector and read through PATCH /v1/candidates/{candidateId}/messages/read-status.

To retrieve the whole accessible history, repeat the GET with cursor set to pagination.next_cursor, keeping the same candidate and conversation selector. Copy the complete conversationId each time, or keep the same openingId if you selected by job. Stop when the cursor is null. A page keeps messages with the same timestamp together, so it can exceed the requested target size. Reading does not mark messages as seen, send anything, or spend credits. No conversation returns an empty page; inaccessible conversations return 404.

An exceptionally dense timestamp group or an invalid source response returns 502, never a successful but silently incomplete history. Retry a temporary source failure later and retain the request id if the failure persists.

3. Inspect your event history

curl --get https://api.torre.ai/v1/events \
  -H "Authorization: Bearer $TORRE_API_KEY" \
  --data-urlencode "type=message.replied" --data-urlencode "limit=25"

The response contains data and pagination. Use an event's id with GET /v1/events/{eventId} to inspect it. Follow pagination.next_cursor to continue. History is retained for 90 days; it is not a permanent archive.

With your agent, ask to see recent events, filter by the kind of update you need or inspect one event in detail. Events are listed newest first; ask it to continue through all pages for the period you want.

Event history also records api.request for API calls. This is a history event, not a webhook subscription type.

A reply can include a related topic. When available, the message.replied payload includes that topic. candidate.applied identifies the opening and candidate.

Read the API Reference for request and response bodies and delivery examples.