Skip to main content
GET
/
v1
/
memory
/
context
Get Memory Context
curl --request GET \
  --url https://api.bland.ai/v1/memory/context \
  --header 'authorization: <authorization>'
{
  "data": {
    "contact_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
    "recentMessages": [
      {
        "role": "user",
        "content": "Has my order shipped yet?",
        "channel": "sms",
        "timestamp": "2025-07-23T09:10:00.000Z"
      },
      {
        "role": "assistant",
        "content": "Yes, order #8821 shipped this morning. Expected delivery is Friday July 25.",
        "channel": "sms",
        "timestamp": "2025-07-23T09:10:05.000Z"
      }
    ],
    "summary": "Customer called about order #8821 which was delayed. Follow-up confirmed the order shipped and is now in transit. Expected delivery July 25.",
    "contactFacts": {
      "name": "Sarah Chen",
      "phone": "+14155550192",
      "preferred_contact": "sms",
      "timezone": "America/Los_Angeles"
    },
    "entities": [
      {
        "entity_type": "order",
        "entity_id": "order-8821",
        "facts": {
          "order_number": "#8821",
          "status": "in_transit",
          "carrier": "UPS",
          "expected_delivery": "2025-07-25"
        },
        "status": "in_transit",
        "last_discussed_at": "2025-07-23T09:10:00.000Z",
        "notes": null
      }
    ],
    "openItems": [
      {
        "type": "follow_up",
        "description": "Confirm delivery of order #8821 on July 25",
        "created_at": "2025-07-23T09:10:00.000Z",
        "priority": "medium",
        "related_to": {
          "entity_type": "order",
          "entity_id": "order-8821"
        }
      }
    ]
  },
  "errors": null
}

Headers

authorization
string
required
Your API key for authentication.

Query Parameters

contact_id
string
required
The unique identifier of the contact.
persona_id
string
The persona ID for memory scoping. Either persona_id or agent_number is required.
agent_number
string
The agent phone number for memory scoping. Either persona_id or agent_number is required.

Response

data
object
The memory context object.
data.contact_id
string
The contact ID this memory belongs to.
data.recentMessages
array
Array of recent messages from the sliding window (cross-channel).
data.recentMessages[].role
string
Message role: “user” or “assistant”.
data.recentMessages[].content
string
Message content.
data.recentMessages[].channel
string
Channel the message came from: “call” or “sms”.
data.recentMessages[].timestamp
string
ISO timestamp when the message was recorded.
data.summary
string
Rolling summary of interactions with this contact.
data.contactFacts
object
Structured facts about the contact (key-value pairs).
data.entities
array
Array of extracted entities associated with this contact.
data.openItems
array
Array of open items or pending tasks for this contact.
errors
null
Error array (null on success).
{
  "data": {
    "contact_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
    "recentMessages": [
      {
        "role": "user",
        "content": "Has my order shipped yet?",
        "channel": "sms",
        "timestamp": "2025-07-23T09:10:00.000Z"
      },
      {
        "role": "assistant",
        "content": "Yes, order #8821 shipped this morning. Expected delivery is Friday July 25.",
        "channel": "sms",
        "timestamp": "2025-07-23T09:10:05.000Z"
      }
    ],
    "summary": "Customer called about order #8821 which was delayed. Follow-up confirmed the order shipped and is now in transit. Expected delivery July 25.",
    "contactFacts": {
      "name": "Sarah Chen",
      "phone": "+14155550192",
      "preferred_contact": "sms",
      "timezone": "America/Los_Angeles"
    },
    "entities": [
      {
        "entity_type": "order",
        "entity_id": "order-8821",
        "facts": {
          "order_number": "#8821",
          "status": "in_transit",
          "carrier": "UPS",
          "expected_delivery": "2025-07-25"
        },
        "status": "in_transit",
        "last_discussed_at": "2025-07-23T09:10:00.000Z",
        "notes": null
      }
    ],
    "openItems": [
      {
        "type": "follow_up",
        "description": "Confirm delivery of order #8821 on July 25",
        "created_at": "2025-07-23T09:10:00.000Z",
        "priority": "medium",
        "related_to": {
          "entity_type": "order",
          "entity_id": "order-8821"
        }
      }
    ]
  },
  "errors": null
}