You are reading the documentation for an outdated Corteza release. 2024.9 is the latest stable Corteza release.

Updating a record

To update a specific record for a specific module, use the POST $ComposeAPI/namespace/$NAMESPACE_ID/module/$MODULE_ID/record/$RECORD_ID endpoint.

The new record values will be as provided in the update request. The values that are omitted in the update request will be removed from the given record.

Example request

curl "$ComposeAPI/namespace/$NAMESPACE_ID/module/$MODULE_ID/record/$RECORD_ID" \
  -H "Authorization: Bearer $JWT" \
  -H 'Content-Type: application/json' \
  --data-binary "{
    \"values\": [
      { \"name\": \"$FIELD1\", \"value\": \"$VALUE1\" },
      { \"name\": \"$FIELD2\", \"value\": \"$VALUE2\" }
    ]
  }";

Example response

{
  "response": {
    "recordID": "$RECORD_ID",
    "moduleID": "$MODULE_ID",
    "namespaceID": "$NAMESPACE_ID",
    "values": [
      { "name": "$FIELD1", "value": "$$VALUE1" },
      { "name": "$FIELD2", "value": "$$VALUE2" },
    ]
  }
}