Write Actions
A write action writes data to your customer’s SaaS whenever you make an API request to us.
Defining writes
To define a write action, add write
as a key in your integration defined in amp.yaml
, and add a list of standard and custom objects you want to write to.
Sharing mappings with read actions
If you are using Read Actions and have already defined field mappings, your Write Actions can automatically use the same mappings if you add inheritMapping
to your manifest file. When you call our Write API, we will ensure that we are writing back to the appropriate field that the customer has mapped.
On the roadmap
The ability to programmatically create custom objects when a user installs your integration.
Writing records
Once your users install an integration with a write action, your app can write data to their SaaS by making a POST call to Ampersand, the URL is in the format of:
https://write.withampersand.com/v1/projects/:projectIdOrName/integrations/:integrationId/objects/:objectName
You can find your project ID and integration ID in the Ampersand Dashboard (look in the address bar).
objectName
refers to the objectName
key within the amp.yaml
file that defines your integration. This must match the name of an object that exists within the SaaS instance.
Create a new record
To create a new record, make a request to the Write endpoint with type
being create
. For example:
Update an existing record
To update an existing record, you need to know the ID of the record, which is the ID that the SaaS provider uses to uniquely identify this record. If you created the record using Ampersand, this ID is available in the API response. If you are reading the record first using Ampersand’s Read Actions, make sure you add the ID as a required field in the read action. Here is an example request:
Was this page helpful?