> For the complete documentation index, see [llms.txt](https://flapjax.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://flapjax.gitbook.io/docs/rest-api/reference/record-events/update-record-by-external-id.md).

# Update Record by External ID

## Update record by external ID (full replacement)

> Performs a \*\*full replacement\*\* update on a record identified by its external ID within the specified stack.\
> \
> All stack attributes not included in the request body are set to \`nil\` (cleared). This gives PUT true full-replacement semantics. If you only want to update specific fields, use the \`PATCH\` endpoint instead.\
> \
> Relationship attributes are normalized and auto-created as needed.\
> \
> {% hint style="warning" %}\
> \*\*Item stacks only.\*\* This endpoint returns an error for Event stacks — event records are immutable after creation.\
> {% endhint %}<br>

```json
{"openapi":"3.0.3","info":{"title":"Listener API","version":"1.0.0"},"tags":[{"name":"update-record-by-external-id"}],"servers":[{"url":"https://{domain}/v1","variables":{"domain":{"default":"your-domain","description":"Your deployment domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT token with the required scope for the endpoint. Pass via the `Authorization: Bearer <token>` header.\n"}},"parameters":{"StackKey":{"name":"stack_key","in":"path","required":true,"description":"The unique key identifying the stack.","schema":{"type":"string"}},"RecordExternalId":{"name":"external_id","in":"path","required":true,"description":"The external identifier of the record.","schema":{"type":"string"}}},"schemas":{"RecordData":{"type":"object","description":"A flat JSON object of key-value pairs matching the stack's attribute definitions. Keys correspond to attribute keys configured on the stack. Relationship attributes accept plain values which are automatically normalized.\n","additionalProperties":true},"SuccessResponse":{"type":"object","description":"Standard success response envelope.","properties":{"status":{"type":"string","enum":["Success"]},"data":{"type":"boolean"}}},"ErrorResponse":{"type":"object","description":"Standard error response envelope.","properties":{"error":{"type":"string","description":"Machine-readable error type. Use this for programmatic error handling.\n","enum":["operation_failed","failed_binding_json","invalid_json","invalid_parameter","not_found","duplicate_entry","rate_limit_exceeded"]},"errorstack":{"type":"object","nullable":true,"description":"Detailed error stack (only present for server errors)."}}}}},"paths":{"/stacks/{stack_key}/{external_id}":{"put":{"summary":"Update record by external ID (full replacement)","operationId":"updateRecordByExternalId","tags":["update-record-by-external-id"],"description":"Performs a **full replacement** update on a record identified by its external ID within the specified stack.\n\nAll stack attributes not included in the request body are set to `nil` (cleared). This gives PUT true full-replacement semantics. If you only want to update specific fields, use the `PATCH` endpoint instead.\n\nRelationship attributes are normalized and auto-created as needed.\n\n{% hint style=\"warning\" %}\n**Item stacks only.** This endpoint returns an error for Event stacks — event records are immutable after creation.\n{% endhint %}\n","parameters":[{"$ref":"#/components/parameters/StackKey"},{"$ref":"#/components/parameters/RecordExternalId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordData"}}}},"responses":{"200":{"description":"Record updated successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Invalid request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Record or stack not found, event stack not supported, or internal error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```
