TRI TRI APIapi.tri1space.com

Contacts

Contacts

Contacts and conversation infrastructure

Contacts API

Protected core TRI routes

Contacts routes reuse the existing TRI application service layer and keep private key material out of the API boundary.

GET/api/tri/contactsFetch contacts available to the authenticated TRI service context
POST/api/tri/contacts/upsertCreate or update contact metadata
POST/api/tri/readUpdate read state
GET/api/tri/conversation-profileFetch conversation profile data
POST/api/tri/conversation-settingsUpdate conversation settings
POST/api/tri/conversation-stateUpdate conversation state

cURL

curl -H "Authorization: Bearer $TRI_API_SERVICE_TOKEN" \
  https://api.tri1space.com/api/tri/contacts

JavaScript fetch

const response = await fetch('https://api.tri1space.com/api/tri/contacts', {
  headers: {
    'X-TRI-API-Key': process.env.TRI_API_SERVICE_TOKEN
  }
});

const contacts = await response.json();

Upsert contact

curl -X POST https://api.tri1space.com/api/tri/contacts/upsert \
  -H "Authorization: Bearer $TRI_API_SERVICE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ownerTriId": "tri1qowner",
    "contactTriId": "tri1qcontact",
    "displayName": "Public Contact",
    "trusted": true
  }'
await fetch('https://api.tri1space.com/api/tri/contacts/upsert', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.TRI_API_SERVICE_TOKEN}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    ownerTriId: 'tri1qowner',
    contactTriId: 'tri1qcontact',
    displayName: 'Public Contact',
    trusted: true
  })
});