Duplicate a record

To duplicate a record, use an HTTP POST method with the records API endpoint specifying the database name, layout name, and record ID.

HTTP method

POST

URL

/fmi/data/version/databases/database-name/layouts/layout-name/records/record-id

version – the FileMaker Data API version requested can use v1, v2, or vLatest

database-name – the name of the hosted database

layout-name – the name of the layout to use as the context for editing the record

record-id – the record ID of the record to edit

HTTP header

Content-Type: application/json

Authorization: Bearer session-token, where session-token is the unique X-FM-Data-Access-Token value for the database session

Parameters

None

You can run FileMaker scripts as part of this request by including the script.prerequest, script.presort, and script parameters in the request body. See Run FileMaker scripts.

Response

The record ID of the new record, and a messages array showing an error code of 0.

For example:

Copy
{
  "response": {
    "recordId": "7"
    "modId": "0"
  },
  "messages": [
    {
      "code": "0",
      "message": "OK"
    }
  ]
}

See Error responses.