Data Item

Update Data Items By Key

Find any data items whose fields match specified values and update those items using a patch. If the value of a field in a patch is null, that value will be deleted from the item. If the provided field name does not exist in the collection schema, that value is ignored. Attempts to update the Collection field will be ignored as a data item cannot be moved to a different collection.

patch/collections/{collectionId}/itemsByKey

Request

  • Base URL
    https://data.lucid.app
  • URL
    https://data.lucid.app/collections/{collectionId}/itemsByKey
  • Auth
    OAuth 2
    Authorization code: https://lucid.app/oauth2/authorize
    Token URL: https://api.lucid.co/oauth2/token scopes: data-service.admin

Path parameters

collectionIdinteger required

ID of collection to update data items for

Request body

keySchemaFieldsstring[]

Fields used to search for items in the collection. If it is not provided, primary keys from the schema are used.

Example request

{
  "patches": [
    {
      "fieldValues": [
        "Ontario"
      ],
      "patch": {
        "Co1B": "new column 1b value",
        "Co2B": "new column 2b value"
      }
    }
  ],
  "keySchemaFields": [
    "Province"
  ]
}

Response

OK with message indicating the number of items updated.

messagestring

Message indicating the number of items updated

Example response

{
  "message": "Updated 5 item(s)"
}

Changes

No recorded changes to this operation across all 1 revision of this API.