Update an edge
Merges properties into an edge, or moves one of its ends, and returns it. A property you leave out stays. Sending null stores a null, so you can add properties but not remove them.
bearerAuthAuthorizationBearer <token>Authenticate with an API key (marfa_k1_…) or an OAuth access token (marfa_at_…).
id*stringThe ID of the edge.
Idempotency-Key?stringA unique key that makes the request safe to retry. If you send the same request with the same key again, Marfa returns the first response and doesn't write again. A key belongs to the credential that sends it.
length <= 255X-Marfa-Instance-Id?stringThe ID of the instance you expect, as GET / returns it. If another instance answers at this address, Marfa returns 409 instance_changed and doesn't write. Leave it out to send the request to whichever instance answers.
^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$application/json- body
properties?Properties to merge over the edge's. Required unless an end moves. A whole number whose digits a 64-bit float doesn't keep is refused: send it as a string.
from_id?stringThe ID of the item to move the edge's from end to. Only for an edge type where each item at the to end holds one edge (one-to-one, one-to-many). An update moves one end at a time.
to_id?stringThe ID of the item to move the edge's to end to. Only for an edge type where each item at the from end holds one edge (one-to-one, many-to-one). An update moves one end at a time.
version*integerThe version of the edge your change is based on, from a read. If the edge has moved on, the update fails with version_conflict.
0 <= valueReturns the updated edge. A move keeps the edge's ID and properties, and sends one edge.updated event.
application/json- response
One edge.
edge*The edge.
missing_required_field:versionis missing, orpropertiesis missing and no end moves.validation_error,invalid_properties: the body has an undeclared key, moves both ends or an end its type can't move, or a property breaks its schema.invalid_id:from_idorto_idisn't a valid ID.edge_constraint_violation,edge_cycle: the moved edge breaks its type's rules.
application/json- response
An error response.
error*What went wrong.
unauthorized: the request has no credential, or its credential is not valid. For a key that has expired, details.expired_at says when it expired.
application/json- response
An error response.
error*What went wrong.
edge_type_not_permitted: you can read the edge type but don't have write on it.details.grantnames the missing grant.type_not_permitted: you can read the type of the item the edge points from, or of the item you move it to, but don't have write on it, or your credential reaches no type.details.grantnames the missing grant.
application/json- response
An error response.
error*What went wrong.
edge_not_found: no edge has this ID, or its edge type or the type of the item it points from is one you can't read.item_not_found: the item you move the edge to doesn't exist or is of a type you can't read, or the end that stays is in the trash.edge_type_not_found: you move an end of an edge whose edge type is no longer registered.
application/json- response
An error response.
error*What went wrong.
request_timeout: the request body didn't arrive whole within 180 seconds. Nothing changed, and Marfa closed the connection. Send the request again. A body larger than about 21 MiB can't arrive in that time over a 1 Mbit/s link, so send it in smaller requests.
application/json- response
An error response.
error*What went wrong.
version_conflict: version is stale. current holds the edge as it stands.
application/json- response
A stale update's answer: the refusal and the current edge.
error*What went wrong.
current*The edge as it stands now. Merge your change over it and try again.
contract_mismatch: X-Marfa-Contract names another contract version than this instance speaks, or is not a whole number. Nothing was done.
application/json- response
An error response.
error*What went wrong.
request_too_large: the request body is larger than this instance accepts.
application/json- response
An error response.
error*What went wrong.
idempotency_contract_changed: the first response was made under another contract version, so Marfa can't replay it. The write isn't repeated.idempotency_key_reused: the key was first used for a different request. Nothing is written.idempotency_result_not_retained: the first response was too large to keep, so Marfa can't replay it. The write isn't repeated.
application/json- response
An error response.
error*What went wrong.
rate_limited: you sent too many requests. Wait for the number of seconds in Retry-After, then try again.
application/json- response
An error response.
error*What went wrong.
internal_error: Marfa failed in a way it didn't expect, and the request may not have completed. Read what you changed before you repeat a write.
application/json- response
An error response.
error*What went wrong.
write_contention: the database was busy, and Marfa couldn't complete the request in time. Nothing changed. Try the request again. While a restore runs, details.reason is restore_running.
application/json- response
An error response.
error*What went wrong.
insufficient_storage: the disk that holds the instance's data has no room for the request, or the request would leave less free than the instance keeps in reserve. Nothing changed, unless details.write_outcome is unknown, which means the write may have landed: read what you changed before you repeat it. Free space on the disk, then try the request again.
application/json- response
An error response.
error*What went wrong.
curl -X PATCH 'http://localhost:8600/edges/string' \ -H 'Content-Type: application/json' \ -d '{ "version": 0}'{ "edge": { "id": "01a1011e-1222-7633-b194-950271e759ed", "from_id": "01a1011a-4902-76cf-a4a9-88e99c038c8d", "to_id": "01a1011c-2f86-76b6-9594-050c109f4957", "edge_type": "acme.deal-contact", "version": 2, "created_at": "2026-10-03T09:41:50.646Z", "updated_at": "2026-10-03T09:42:50.325Z", "properties": {} }}