Skip to content
Go to Micro

Upsert by property value

PUT/v2/prism/{teamId}/identity/by/{slug}/{value}

Idempotent create-or-update keyed on {slug}={value}. If exactly one record matches, it is patched and 200 is returned. If none match, a new record is created (with the lookup property set if absent) and 201 is returned. If multiple records match, 409 is returned and you should patch by id instead.

Path ParametersExpand Collapse
teamId: optional string
formatuuid
slug: string
value: string
Header ParametersExpand Collapse
"Idempotency-Key": optional string
minLength1
maxLength255
Body ParametersJSONExpand Collapse
default: optional map[unknown]

Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read.

list: optional unknown
ReturnsExpand Collapse
id: string
formatuuid
default: optional map[unknown]

Properties keyed by property slug.

list: optional unknown

Upsert by property value

curl https://developers.micro.so/v2/prism/$TEAM_ID/identity/by/$SLUG/$VALUE \
    -X PUT \
    -H 'Content-Type: application/json' \
    -H "x-api-key: $MICRO_API_KEY" \
    -d '{}'
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "default": {
    "foo": "bar"
  },
  "list": {}
}
Returns Examples
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "default": {
    "foo": "bar"
  },
  "list": {}
}