Skip to main content

Matching analysis

Matching analysis follows the same job lifecycle as reports and can stream progress via jobs SSE.

Generated from contracts in packages/contracts/src/v1. Do not hand-edit this page.

POST /v1/matching-analysis/jobs

Create a matching analysis job.

Request schema

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"entityA": {
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "entity_id"
},
"entityId": {
"type": "string",
"minLength": 1,
"maxLength": 256
}
},
"required": [
"type",
"entityId"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "media_target"
},
"mediaId": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"target": {
"type": "object",
"properties": {
"strategy": {
"type": "string",
"enum": [
"dominant",
"timerange",
"entity_id",
"magic_hint"
]
},
"on_miss": {
"default": "error",
"type": "string",
"enum": [
"fallback_dominant",
"error"
]
},
"timerange": {
"anyOf": [
{
"type": "object",
"properties": {
"start_seconds": {
"anyOf": [
{
"type": "number",
"minimum": 0
},
{
"type": "null"
}
]
},
"end_seconds": {
"anyOf": [
{
"type": "number",
"minimum": 0
},
{
"type": "null"
}
]
}
},
"additionalProperties": false
},
{
"type": "null"
}
]
},
"hint": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 1024
},
{
"type": "null"
}
]
},
"entity_id": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 256
},
{
"type": "null"
}
]
}
},
"required": [
"strategy",
"on_miss"
],
"additionalProperties": false
}
},
"required": [
"type",
"mediaId",
"target"
],
"additionalProperties": false
}
]
},
"entityB": {
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "entity_id"
},
"entityId": {
"type": "string",
"minLength": 1,
"maxLength": 256
}
},
"required": [
"type",
"entityId"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "media_target"
},
"mediaId": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"target": {
"type": "object",
"properties": {
"strategy": {
"type": "string",
"enum": [
"dominant",
"timerange",
"entity_id",
"magic_hint"
]
},
"on_miss": {
"default": "error",
"type": "string",
"enum": [
"fallback_dominant",
"error"
]
},
"timerange": {
"anyOf": [
{
"type": "object",
"properties": {
"start_seconds": {
"anyOf": [
{
"type": "number",
"minimum": 0
},
{
"type": "null"
}
]
},
"end_seconds": {
"anyOf": [
{
"type": "number",
"minimum": 0
},
{
"type": "null"
}
]
}
},
"additionalProperties": false
},
{
"type": "null"
}
]
},
"hint": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 1024
},
{
"type": "null"
}
]
},
"entity_id": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 256
},
{
"type": "null"
}
]
}
},
"required": [
"strategy",
"on_miss"
],
"additionalProperties": false
}
},
"required": [
"type",
"mediaId",
"target"
],
"additionalProperties": false
}
]
},
"context": {
"type": "string",
"minLength": 1,
"maxLength": 2048
},
"output": {
"type": "object",
"properties": {
"template": {
"type": "string",
"const": "matching_analysis"
},
"templateParams": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"required": [
"template"
],
"additionalProperties": false
},
"label": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"entityALabel": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"entityBLabel": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"webhook": {
"type": "object",
"properties": {
"url": {
"type": "string",
"format": "uri"
},
"headers": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "string"
}
}
},
"required": [
"url"
],
"additionalProperties": false
},
"idempotencyKey": {
"type": "string"
}
},
"required": [
"entityA",
"entityB",
"context",
"output"
],
"additionalProperties": false
}

Response schema

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"jobId": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"queued",
"running"
]
},
"stage": {
"type": "string"
},
"estimatedWaitSec": {
"type": "number"
}
},
"required": [
"jobId",
"status"
],
"additionalProperties": false
}

GET /v1/matching-analysis/:matchingAnalysisId

Fetch a matching analysis payload by id.

Response schema

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"jobId": {
"type": "string"
},
"label": {
"type": "string"
},
"context": {
"type": "string"
},
"output": {
"type": "object",
"properties": {
"template": {
"type": "string",
"const": "matching_analysis"
}
},
"required": [
"template"
],
"additionalProperties": false
},
"entityA": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"label"
],
"additionalProperties": false
},
"entityB": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"label"
],
"additionalProperties": false
},
"markdown": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"sections": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"properties": {
"section_title": {
"type": "string"
},
"section_content": {
"anyOf": [
{
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "card"
},
"icon": {
"type": "string"
},
"title": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"type",
"icon",
"title",
"content"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "text"
},
"title": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"type",
"content"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "grid"
},
"columns": {
"anyOf": [
{
"type": "number",
"const": 2
},
{
"type": "number",
"const": 3
},
{
"type": "number",
"const": 4
}
]
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "card"
},
"icon": {
"type": "string"
},
"title": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"type",
"icon",
"title",
"content"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"columns",
"items"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "illustration"
},
"variant": {
"type": "string",
"enum": [
"conversation",
"growth",
"connection",
"analysis"
]
}
},
"required": [
"type",
"variant"
],
"additionalProperties": false
}
]
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "card"
},
"icon": {
"type": "string"
},
"title": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"type",
"icon",
"title",
"content"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "text"
},
"title": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"type",
"content"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "grid"
},
"columns": {
"anyOf": [
{
"type": "number",
"const": 2
},
{
"type": "number",
"const": 3
},
{
"type": "number",
"const": 4
}
]
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "card"
},
"icon": {
"type": "string"
},
"title": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"type",
"icon",
"title",
"content"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"columns",
"items"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "illustration"
},
"variant": {
"type": "string",
"enum": [
"conversation",
"growth",
"connection",
"analysis"
]
}
},
"required": [
"type",
"variant"
],
"additionalProperties": false
}
]
}
},
{}
]
}
},
"required": [
"section_title",
"section_content"
],
"additionalProperties": false
}
},
{
"type": "null"
}
]
},
"metrics": {
"anyOf": [
{
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
{
"type": "null"
}
]
},
"raw": {
"anyOf": [
{},
{
"type": "null"
}
]
},
"pdfUrl": {
"type": "string",
"format": "uri"
},
"reportUrl": {
"type": "string",
"format": "uri"
}
},
"required": [
"id",
"createdAt",
"context",
"output"
],
"additionalProperties": false
}

GET /v1/matching-analysis/by-job/:jobId

Fetch matching analysis payload by job id.

  • Returns null until job reaches terminal success.

Response schema

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"jobId": {
"type": "string"
},
"label": {
"type": "string"
},
"context": {
"type": "string"
},
"output": {
"type": "object",
"properties": {
"template": {
"type": "string",
"const": "matching_analysis"
}
},
"required": [
"template"
],
"additionalProperties": false
},
"entityA": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"label"
],
"additionalProperties": false
},
"entityB": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"label"
],
"additionalProperties": false
},
"markdown": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"sections": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"properties": {
"section_title": {
"type": "string"
},
"section_content": {
"anyOf": [
{
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "card"
},
"icon": {
"type": "string"
},
"title": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"type",
"icon",
"title",
"content"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "text"
},
"title": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"type",
"content"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "grid"
},
"columns": {
"anyOf": [
{
"type": "number",
"const": 2
},
{
"type": "number",
"const": 3
},
{
"type": "number",
"const": 4
}
]
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "card"
},
"icon": {
"type": "string"
},
"title": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"type",
"icon",
"title",
"content"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"columns",
"items"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "illustration"
},
"variant": {
"type": "string",
"enum": [
"conversation",
"growth",
"connection",
"analysis"
]
}
},
"required": [
"type",
"variant"
],
"additionalProperties": false
}
]
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "card"
},
"icon": {
"type": "string"
},
"title": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"type",
"icon",
"title",
"content"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "text"
},
"title": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"type",
"content"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "grid"
},
"columns": {
"anyOf": [
{
"type": "number",
"const": 2
},
{
"type": "number",
"const": 3
},
{
"type": "number",
"const": 4
}
]
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "card"
},
"icon": {
"type": "string"
},
"title": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"type",
"icon",
"title",
"content"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"columns",
"items"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "illustration"
},
"variant": {
"type": "string",
"enum": [
"conversation",
"growth",
"connection",
"analysis"
]
}
},
"required": [
"type",
"variant"
],
"additionalProperties": false
}
]
}
},
{}
]
}
},
"required": [
"section_title",
"section_content"
],
"additionalProperties": false
}
},
{
"type": "null"
}
]
},
"metrics": {
"anyOf": [
{
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
{
"type": "null"
}
]
},
"raw": {
"anyOf": [
{},
{
"type": "null"
}
]
},
"pdfUrl": {
"type": "string",
"format": "uri"
},
"reportUrl": {
"type": "string",
"format": "uri"
}
},
"required": [
"id",
"createdAt",
"context",
"output"
],
"additionalProperties": false
}