Skip to main content
SONZAI
Api

Priming

Batch import users

POST
/agents/{agentId}/users/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/users/import" \  -H "Content-Type: application/json" \  -d '{    "users": [      {        "user_id": "string"      }    ]  }'
{
  "$schema": "/api/v1/schemas/BatchImportUsersHumaOutputBody.json",
  "facts_created": 0,
  "job_id": "string",
  "status": "string",
  "total_users": 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"
}

Get batch import job status

GET
/agents/{agentId}/users/import/{jobId}
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

jobId*string

Import job UUID

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/users/import/string"
{
  "$schema": "/api/v1/schemas/ImportJob.json",
  "agent_id": "string",
  "completed_at": "2019-08-24T14:15:22Z",
  "constellation_nodes": 0,
  "created_at": "2019-08-24T14:15:22Z",
  "error_details": null,
  "errors": 0,
  "facts_deduped": 0,
  "facts_extracted": 0,
  "facts_stored": 0,
  "job_id": "string",
  "job_type": "string",
  "payload": null,
  "processed_users": 0,
  "source_id": "string",
  "source_type": "string",
  "started_at": "2019-08-24T14:15:22Z",
  "status": "string",
  "tenant_id": "string",
  "total_users": 0,
  "updated_at": "2019-08-24T14:15:22Z",
  "user_id": "string",
  "warmth_score": 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 per-user progress for a batch import job

GET
/agents/{agentId}/users/import/{jobId}/users
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

jobId*string

Import job UUID

Query Parameters

limit?integer

Max user rows to return

Default100
Formatint64

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/users/import/string/users"
{
  "$schema": "/api/v1/schemas/ListImportJobUsersOutputBody.json",
  "count": 0,
  "users": [
    {
      "completed_at": "2019-08-24T14:15:22Z",
      "error_message": "string",
      "facts_deduped": 0,
      "facts_stored": 0,
      "job_id": "string",
      "started_at": "2019-08-24T14:15:22Z",
      "status": "string",
      "updated_at": "2019-08-24T14:15:22Z",
      "user_id": "string",
      "warmth_score": 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 import jobs for an agent

GET
/agents/{agentId}/users/imports
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

limit?integer

Max jobs to return

Default20
Formatint64

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/users/imports"
{
  "$schema": "/api/v1/schemas/ListImportJobsOutputBody.json",
  "count": 0,
  "jobs": [
    {
      "$schema": "/api/v1/schemas/ImportJob.json",
      "agent_id": "string",
      "completed_at": "2019-08-24T14:15:22Z",
      "constellation_nodes": 0,
      "created_at": "2019-08-24T14:15:22Z",
      "error_details": null,
      "errors": 0,
      "facts_deduped": 0,
      "facts_extracted": 0,
      "facts_stored": 0,
      "job_id": "string",
      "job_type": "string",
      "payload": null,
      "processed_users": 0,
      "source_id": "string",
      "source_type": "string",
      "started_at": "2019-08-24T14:15:22Z",
      "status": "string",
      "tenant_id": "string",
      "total_users": 0,
      "updated_at": "2019-08-24T14:15:22Z",
      "user_id": "string",
      "warmth_score": 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"
}

Add content for a user

POST
/agents/{agentId}/users/{userId}/content
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

userId*string

User ID to add content for

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/users/string/content" \  -H "Content-Type: application/json" \  -d '{    "content": [      {        "body": "string",        "type": "string"      }    ]  }'
{
  "$schema": "/api/v1/schemas/AddUserContentHumaOutputBody.json",
  "job_id": "string",
  "status": "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"
}

Get user priming metadata

GET
/agents/{agentId}/users/{userId}/metadata
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

userId*string

User ID

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/users/string/metadata"
{
  "$schema": "/api/v1/schemas/UserPrimingMetadata.json",
  "AgentID": "string",
  "Company": "string",
  "CreatedAt": "2019-08-24T14:15:22Z",
  "CustomFields": {
    "property1": "string",
    "property2": "string"
  },
  "DisplayName": "string",
  "Email": "string",
  "FactsCount": 0,
  "FirstMetAt": "2019-08-24T14:15:22Z",
  "LinkedinURL": "string",
  "Phone": "string",
  "PrimedAt": "2019-08-24T14:15:22Z",
  "SourceID": "string",
  "SourceType": "string",
  "Timezone": "string",
  "Title": "string",
  "UpdatedAt": "2019-08-24T14:15:22Z",
  "UserID": "string",
  "WarmthScore": 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"
}

Update user priming metadata

PATCH
/agents/{agentId}/users/{userId}/metadata
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

userId*string

User ID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X PATCH "https://loading/api/v1/agents/string/users/string/metadata" \  -H "Content-Type: application/json" \  -d '{}'
{
  "$schema": "/api/v1/schemas/UpdateUserMetadataHumaOutputBody.json",
  "facts_created": 0,
  "metadata": {
    "$schema": "/api/v1/schemas/UserPrimingMetadata.json",
    "AgentID": "string",
    "Company": "string",
    "CreatedAt": "2019-08-24T14:15:22Z",
    "CustomFields": {
      "property1": "string",
      "property2": "string"
    },
    "DisplayName": "string",
    "Email": "string",
    "FactsCount": 0,
    "FirstMetAt": "2019-08-24T14:15:22Z",
    "LinkedinURL": "string",
    "Phone": "string",
    "PrimedAt": "2019-08-24T14:15:22Z",
    "SourceID": "string",
    "SourceType": "string",
    "Timezone": "string",
    "Title": "string",
    "UpdatedAt": "2019-08-24T14:15:22Z",
    "UserID": "string",
    "WarmthScore": 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"
}

Prime a user with external data

POST
/agents/{agentId}/users/{userId}/prime
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

userId*string

User ID to prime

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/users/string/prime" \  -H "Content-Type: application/json" \  -d '{    "display_name": "string"  }'
{
  "property1": null,
  "property2": null
}
{
  "$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"
}

Get priming job status

GET
/agents/{agentId}/users/{userId}/prime/{jobId}
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

userId*string

User ID

jobId*string

Import job UUID

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/users/string/prime/string"
{
  "$schema": "/api/v1/schemas/ImportJob.json",
  "agent_id": "string",
  "completed_at": "2019-08-24T14:15:22Z",
  "constellation_nodes": 0,
  "created_at": "2019-08-24T14:15:22Z",
  "error_details": null,
  "errors": 0,
  "facts_deduped": 0,
  "facts_extracted": 0,
  "facts_stored": 0,
  "job_id": "string",
  "job_type": "string",
  "payload": null,
  "processed_users": 0,
  "source_id": "string",
  "source_type": "string",
  "started_at": "2019-08-24T14:15:22Z",
  "status": "string",
  "tenant_id": "string",
  "total_users": 0,
  "updated_at": "2019-08-24T14:15:22Z",
  "user_id": "string",
  "warmth_score": 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"
}