Memories

Create or update a durable JSON memory under an org or function scope. When no explicit scope is provided, function-authenticated requests use that function's id automatically; requests with x-primitive-function-id use that function id; all other requests default to org scope.

scope.type = function requires the function id UUID in scope.id. Function names are not accepted as scope identifiers. Values must be valid JSON and serialize to at most 65536 UTF-8 bytes. Keys must be at most 512 UTF-8 bytes. version, read_count, and write_count are bigint counters serialized as strings.

Passing if_absent turns the write into create-only. Passing if_version turns the write into compare-and-set. These options are mutually exclusive and return memory_conflict on a stale version or existing key.

put/memories

Request

  • Base URL: https://api.primitive.dev/v1
  • URL: https://api.primitive.dev/v1/memories
  • Auth: HTTP bearer

Headers

x-primitive-function-idstring uuid

Optional function id UUID used as the default scope when the body does not include scope. Ignored when scope is provided.

Request body

keystring required

Caller-defined key, at most 512 UTF-8 bytes.

ttl_secondsinteger

Set or replace the TTL in seconds. Mutually exclusive with expires_at and clear_ttl.

expires_atstring date-time

Set or replace the absolute expiration timestamp. Mutually exclusive with ttl_seconds and clear_ttl.

clear_ttlboolean

Clear any existing TTL. Mutually exclusive with ttl_seconds and expires_at.

if_absentboolean

Create only when the key is absent. Mutually exclusive with if_version.

if_versionstring

Bigint counter serialized as a base-10 string.

Response

Existing memory updated

successboolean required

Changes

    • info

      removed the invalid_signup_code enum value from the / response property for the response status

    • info

      removed the invalid_signup_code enum value from the / response property for the response status

    • info

      removed the invalid_signup_code enum value from the / response property for the response status

    • info

      removed the invalid_signup_code enum value from the / response property for the response status

    • info

      removed the invalid_signup_code enum value from the / response property for the response status

    • info

      removed the invalid_signup_code enum value from the / response property for the response status

    • warning

      added the new not_a_repeating_send enum value to the / response property for the response status

    • warning

      added the new not_a_repeating_send enum value to the / response property for the response status

    • warning

      added the new not_a_repeating_send enum value to the / response property for the response status

    • warning

      added the new not_a_repeating_send enum value to the / response property for the response status

    • warning

      added the new not_a_repeating_send enum value to the / response property for the response status

    • warning

      added the new not_a_repeating_send enum value to the / response property for the response status

    • warning

      added the new repeat_idle_requires_internal_recipient enum value to the / response property for the response status

    • warning

      added the new repeat_idle_requires_internal_recipient enum value to the / response property for the response status

    • warning

      added the new repeat_idle_requires_internal_recipient enum value to the / response property for the response status

    • warning

      added the new repeat_idle_requires_internal_recipient enum value to the / response property for the response status

    • warning

      added the new repeat_idle_requires_internal_recipient enum value to the / response property for the response status

    • warning

      added the new repeat_idle_requires_internal_recipient enum value to the / response property for the response status

    • warning

      added the new repeat_recipient_external enum value to the / response property for the response status

    • warning

      added the new repeat_recipient_external enum value to the / response property for the response status

    • warning

      added the new repeat_recipient_external enum value to the / response property for the response status

    • warning

      added the new repeat_recipient_external enum value to the / response property for the response status

    • warning

      added the new repeat_recipient_external enum value to the / response property for the response status

    • warning

      added the new repeat_recipient_external enum value to the / response property for the response status

    • warning

      added the new repeat_stop_not_allowed enum value to the / response property for the response status

    • warning

      added the new repeat_stop_not_allowed enum value to the / response property for the response status

    • warning

      added the new repeat_stop_not_allowed enum value to the / response property for the response status

    • warning

      added the new repeat_stop_not_allowed enum value to the / response property for the response status

    • warning

      added the new repeat_stop_not_allowed enum value to the / response property for the response status

    • warning

      added the new repeat_stop_not_allowed enum value to the / response property for the response status

    • warning

      added the new repeat_unsupported enum value to the / response property for the response status

    • warning

      added the new repeat_unsupported enum value to the / response property for the response status

    • warning

      added the new repeat_unsupported enum value to the / response property for the response status

    • warning

      added the new repeat_unsupported enum value to the / response property for the response status

    • warning

      added the new repeat_unsupported enum value to the / response property for the response status

    • warning

      added the new repeat_unsupported enum value to the / response property for the response status