Update site access settings for an authorized application
Please note that the Dashboard API is an experimental, prerelease API. This API method is considered unstable, and should be avoided in production environments and automations. Changes may occur at any time without warning.
Body parameters
Whether the application can access all projects or only selected ones
"selected"
The application can access all projects
The application can only access selected projects
Projects to grant access to (required when site_access_mode is 'selected')
Returns
Returns a resource object of type oauth_application
Examples
import { buildClient } from "@datocms/dashboard-client";
async function run() { const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const oauthApplicationId = "312";
const oauthApplication = await client.oauthApplications.update( oauthApplicationId, { id: "312", site_access_mode: "selected" }, );
// Check the 'Returned output' tab for the result ☝️ console.log(oauthApplication);}
run();{ id: "312", name: "Netlify OAuth application", created_at: "2018-11-20 12:06:49.803166", site_access_mode: "all", read_sites_permission_cap: "unrestricted", mcp_client: null, granted_sites: [{ type: "site", id: "155" }],}