Skip to main content
GET
/
v1
/
memories
/
jobs
/
{job_id}
TypeScript SDK
import { MemoryClient } from '@xtraceai/memory';

const client = new MemoryClient({
  apiKey: process.env.XTRACE_API_KEY!,
  orgId:  process.env.XTRACE_ORG_ID!,
});

// One-shot fetch
const job = await client.memories.jobs.get('job_a1b2c3d4e5f6...');

// Or poll with exponential backoff until terminal (succeeded | failed)
const done = await client.memories.jobs.pollUntilDone('job_a1b2c3d4e5f6...');
console.log(done.status, done.result?.memories_created);
{
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "object": "ingest_job",
  "updated_at": "2023-11-07T05:31:56Z",
  "result": {
    "object": "ingest_result",
    "memories_created": [
      {
        "id": "<string>",
        "text": "<string>"
      }
    ],
    "memories_updated": [
      {
        "id": "<string>",
        "text": "<string>"
      }
    ],
    "memories_superseded_by": {},
    "stage_timings": {}
  },
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.mem.xtrace.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Long-lived org API key. Alternative: Authorization: Bearer <key>.

X-Org-Id
string
header
required

Required alongside the API key (no key→org reverse index).

Headers

X-Service-Token
string | null

Path Parameters

job_id
string
required

Response

Successful Response

Returned by POST /v1/memories (with status 202 by default, 200 when ?wait=true succeeds inline) and by GET /v1/memories/jobs/{job_id}. Same wire shape across every read of a job's lifecycle.

id
string
required

Opaque job id of the form job_<32-hex-chars>.

Example:

"job_a1b2c3d4e5f6071829304a5b6c7d8e9f"

status
enum<string>
required

Lifecycle state. pending → enqueued. running → extraction in progress. succeededresult is set. failederror is set. Terminal jobs (succeeded / failed) are retained for 24h before TTL sweep returns 404 job_not_found.

Available options:
pending,
running,
succeeded,
failed
created_at
string<date-time>
required

ISO-8601 timestamp the job was created.

object
string
default:ingest_job

Constant discriminator for the resource type.

Allowed value: "ingest_job"
updated_at
string<date-time>

ISO-8601 timestamp of the most recent state transition.

result
IngestResult · object

Populated when status = succeeded; null otherwise.

error
IngestJobError · object

Populated when status = failed; null otherwise.