Skip to main content
SONZAI
Api

Wisdom

List attributed wisdom for an agent

GET
/agents/{agentId}/wisdom/attributed
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

agentId*string

Agent UUID or URL-encoded agent name

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/wisdom/attributed"
{
  "$schema": "/api/v1/schemas/ListWisdomAttributedOutputBody.json",
  "facts": [
    {
      "category": "string",
      "confidence": 0.1,
      "entity_display_name": "string",
      "entity_id": "string",
      "entity_type": "string",
      "expires_at": "2019-08-24T14:15:22Z",
      "observed_at": "2019-08-24T14:15:22Z",
      "source": "string",
      "source_ref": "string",
      "value": "string"
    }
  ]
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Create or upsert an attributed wisdom fact

POST
/agents/{agentId}/wisdom/attributed
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

agentId*string

Agent UUID or URL-encoded agent name

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/agents/string/wisdom/attributed" \  -H "Content-Type: application/json" \  -d '{    "category": "string",    "entity_id": "string",    "entity_type": "string",    "value": "string"  }'
{
  "$schema": "/api/v1/schemas/CreateWisdomAttributedOutputBody.json",
  "fact": {
    "category": "string",
    "confidence": 0.1,
    "entity_display_name": "string",
    "entity_id": "string",
    "entity_type": "string",
    "expires_at": "2019-08-24T14:15:22Z",
    "observed_at": "2019-08-24T14:15:22Z",
    "source": "string",
    "source_ref": "string",
    "value": "string"
  }
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Bulk import attributed wisdom facts (JSON or CSV)

POST
/agents/{agentId}/wisdom/attributed/import
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

agentId*string

Agent UUID or URL-encoded agent name

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/agents/string/wisdom/attributed/import" \  -H "Content-Type: application/json" \  -d '{    "data": "string",    "format": "json"  }'
{
  "$schema": "/api/v1/schemas/WisdomImportResponse.json",
  "accepted": 0,
  "rejected": [
    {
      "reason": "string",
      "row": 0
    }
  ],
  "total": 0
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

List attributed wisdom for one entity

GET
/agents/{agentId}/wisdom/attributed/{entityType}/{entityId}
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

agentId*string

Agent UUID or URL-encoded agent name

entityType*string

Attributed entity type (e.g. person, place, org)

entityId*string

Attributed entity ID

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/wisdom/attributed/string/string"
{
  "$schema": "/api/v1/schemas/ListWisdomAttributedOutputBody.json",
  "facts": [
    {
      "category": "string",
      "confidence": 0.1,
      "entity_display_name": "string",
      "entity_id": "string",
      "entity_type": "string",
      "expires_at": "2019-08-24T14:15:22Z",
      "observed_at": "2019-08-24T14:15:22Z",
      "source": "string",
      "source_ref": "string",
      "value": "string"
    }
  ]
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Delete an attributed wisdom fact (idempotent)

DELETE
/agents/{agentId}/wisdom/attributed/{entityType}/{entityId}/{category}
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

agentId*string
entityType*string
entityId*string
category*string

Response Body

application/problem+json

curl -X DELETE "https://loading/api/v1/agents/string/wisdom/attributed/string/string/string"
Empty
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Replace the value of an attributed wisdom fact

PUT
/agents/{agentId}/wisdom/attributed/{entityType}/{entityId}/{category}
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

agentId*string

Agent UUID or URL-encoded agent name

entityType*string
entityId*string
category*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X PUT "https://loading/api/v1/agents/string/wisdom/attributed/string/string/string" \  -H "Content-Type: application/json" \  -d '{    "value": "string"  }'
{
  "$schema": "/api/v1/schemas/ReplaceWisdomAttributedOutputBody.json",
  "fact": {
    "category": "string",
    "confidence": 0.1,
    "entity_display_name": "string",
    "entity_id": "string",
    "entity_type": "string",
    "expires_at": "2019-08-24T14:15:22Z",
    "observed_at": "2019-08-24T14:15:22Z",
    "source": "string",
    "source_ref": "string",
    "value": "string"
  }
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

List attributed wisdom disclosure audit entries

GET
/agents/{agentId}/wisdom/audit
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

agentId*string

Agent UUID or URL-encoded agent name

Query Parameters

from?string

RFC3339 start timestamp (inclusive). Defaults to 24h before 'to'.

to?string

RFC3339 end timestamp (inclusive). Defaults to now.

limit?integer

Maximum entries to return (default 100, max 500)

Formatint64

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/wisdom/audit"
{
  "$schema": "/api/v1/schemas/ListWisdomAuditOutputBody.json",
  "entries": [
    {
      "agent_id": "string",
      "category": "string",
      "decision": "string",
      "decision_why": "string",
      "entity_id": "string",
      "entity_type": "string",
      "fact": {
        "category": "string",
        "confidence": 0.1,
        "entity_display_name": "string",
        "entity_id": "string",
        "entity_type": "string",
        "expires_at": "2019-08-24T14:15:22Z",
        "observed_at": "2019-08-24T14:15:22Z",
        "source": "string",
        "source_ref": "string",
        "value": "string"
      },
      "recorded_at": "2019-08-24T14:15:22Z",
      "turn_id": "string",
      "user_id": "string"
    }
  ]
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

List attributed wisdom relations for an agent

GET
/agents/{agentId}/wisdom/relations
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

agentId*string

Agent UUID or URL-encoded agent name

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/wisdom/relations"
{
  "$schema": "/api/v1/schemas/ListWisdomRelationsOutputBody.json",
  "relations": [
    {
      "edge_type": "string",
      "from_id": "string",
      "from_type": "string",
      "id": "string",
      "metadata": {
        "property1": "string",
        "property2": "string"
      },
      "observed_at": "2019-08-24T14:15:22Z",
      "source": "string",
      "source_ref": "string",
      "to_id": "string",
      "to_type": "string"
    }
  ]
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Create an attributed wisdom relation

POST
/agents/{agentId}/wisdom/relations
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

agentId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/agents/string/wisdom/relations" \  -H "Content-Type: application/json" \  -d '{    "edge_type": "string",    "from_id": "string",    "from_type": "string",    "to_id": "string",    "to_type": "string"  }'
{
  "$schema": "/api/v1/schemas/CreateWisdomRelationOutputBody.json",
  "relation": {
    "edge_type": "string",
    "from_id": "string",
    "from_type": "string",
    "id": "string",
    "metadata": {
      "property1": "string",
      "property2": "string"
    },
    "observed_at": "2019-08-24T14:15:22Z",
    "source": "string",
    "source_ref": "string",
    "to_id": "string",
    "to_type": "string"
  }
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Delete an attributed wisdom relation (idempotent)

DELETE
/agents/{agentId}/wisdom/relations/{relationId}
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

agentId*string
relationId*string

Response Body

application/problem+json

curl -X DELETE "https://loading/api/v1/agents/string/wisdom/relations/string"
Empty
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}