Use cases for the Integration API
Netlify’s Integration API allows you to make integrations with Netlify. This page explains some common use cases for the Integration API.
Enable or disable integrations
Using the Integration API is the only way to enable or disable integrations. For every integration, we automatically generate enable and disable logic that provides the necessary authentication from the integration user.
Beyond this basic logic, you can customize the flow for enabling or disabling an integration with additional logic.
Use a custom integration context
The Integration API allows you to set a custom integration context. This context is a JSON object that can be used to store any data you want on either a site or team level.
Set a custom integration context for a site
To set a custom integration context for a site, take the following steps:
- Add an API handler.
- Call the
client.updateSiteIntegration
method. This method takes thesiteId
and thecontext
as arguments. Thecontext
is a JSON object that can contain any data you want.
Set a custom integration context for a team
To set a custom integration context for a team, take the following steps:
- Add an API handler.
- Call the
client.updateTeamIntegration
method. This method takes theteamId
and thecontext
as arguments. Thecontext
is a JSON object that can contain any data you want.
Retrieve a custom integration context for a site or team
After setting a custom integration context for a site or a team, you can retrieve it by taking the following steps:
- Add an API handler.
- Call the
client.getSiteIntegration
method to retrieve the custom integration context for a site. - Call the
client.getTeamIntegration
method to retrieve the custom integration context for a team.
Documentation
Visit our API reference docs for more information about the methods and properties available to you: