View-Based PUT

To change the data stored for a record which already exists, send a PUT request to the URL for an edit form, or a view with inline editing enabled, with the record key appended.

Note that you should only include fields in your payload that exist in the form itself, as no others will be used in creating the new record.

Also keep in mind that all relevant record rules on the form in question will be triggered by a PUT request to that form.

Views that can accept a PUT request to update a record include the following:

  • Edit Forms
  • Tables (with inline editing turned on)
  • Searches (with inline editing turned on)

URL
PUT https://api.knack.com/v1/pages/scene_xx/views/view_yy/records/record_ID

Parameters

Parameter

Explanation

Example

scene_xx

[scene key](You can think of an object like a spreadsheet or a database table.)

scene_3

view_yy

[view key](You can think of an object like a spreadsheet or a database table.)

view_5

view_yy

A record’s ID

575482d691e16d4235adcdb6

Headers

Key

Value

X-Knack-Application-Id

Your application ID

X-Knack-REST-API-KEY

knack

Authorization

A user tokenvalid for the view (if view is nested under a login)

content-type

application/json

Example Request

curl -X PUT "https://api.knack.com/v1/pages/scene_19/views/view_18/records/586504ff070097a1461db2aes" \
  -H "X-Knack-Application-Id: YOUR-APP-ID" \
  -H "X-Knack-REST-API-Key: knack" \
  -H "Content-Type: application/json" \
  --data '{
        "field_1": "New name of new company"
      }'

Example Response (200 OK)

{
  "record": {
    "id": "586504ff070097a1461db2ae",
    "field_1": "New name of new company",
    "field_1_raw": "New name of new company",
    "field_16": "",
    "field_17": "",
    "field_18": "Other",
    "field_18_raw": "Other",
    "field_31": ""
  },
  "submit_key": "submit_1"
}