Name:
interface
Value:
Extend your Amplify Gen 2 app with AWS Blocks — self-contained backend capabilities you compose into your existing backend.

Choose your framework/language

Gen1 DocsLegacy

Page updated Mar 25, 2026

Update data

PUT requests

To create or update a item via the API endpoint:

import { put } from 'aws-amplify/api';
async function updateItems() {
try {
const Item = { name: 'My first Item', message: 'Hello world!' };
const restOperation = put({
apiName: 'myRestApi',
path: 'items/1',
options: {
body: Item
},
});
const response = await restOperation.response;
console.log('PUT call succeeded: ', response);
} catch (error) {
console.log('PUT call failed: ', JSON.parse(error.response.body));
}
}