Netlify is a hosting service for the programmable web. It understands your documents and provides an API to handle atomic deploys of websites, manage form submissions, inject JavaScript snippets, and much more. This is a REST-style API that uses JSON for serialization and OAuth 2 for authentication.
This document is an OpenAPI reference for the Netlify API that you can explore. For more detailed instructions for common uses, please visit the online documentation. Visit our Community forum to join the conversation about understanding and using Netlify’s API.
Additionally, we have two API clients for your convenience:
This Symfony bundle is automatically generated by the OpenAPI Generator project:
- API version: 2.16.0
- Generator version: 7.14.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.PhpSymfonyServerCodegen
PHP 8.0 and later
To install the dependencies via Composer, add the following repository to composer.json of your Symfony project:
{
"repositories": [{
"type": "path",
"url": "//Path to your generated openapi bundle"
}],
}Then run:
composer require GIT_USER_ID/GIT_REPO_ID:dev-master
to add the generated openapi bundle as a dependency.
To run the unit tests for the generated bundle, first navigate to the directory containing the code, then run the following commands:
composer install
./vendor/bin/phpunit
Step 1: Please follow the installation procedure first.
Step 2: Enable the bundle in the bundle configuration:
// app/config/bundles.php
return [
// ...
OpenAPI\Server\OpenAPIServerBundle::class => ['all' => true],
];Step 3: Register the routes:
# app/config/routes.yaml
open_api_server:
resource: "@OpenAPIServerBundle/Resources/config/routing.yaml"Step 4: Implement the API calls:
<?php
// src/Acme/MyBundle/Api/AccessTokenApi.php
namespace Acme\MyBundle\Api;
use OpenAPI\Server\Api\AccessTokenApiInterface;
class AccessTokenApi implements AccessTokenApiInterface // An interface is autogenerated
{
/**
* Configure OAuth2 access token for authorization: netlifyAuth
*/
public function setnetlifyAuth($oauthToken)
{
// Retrieve logged in user from $oauthToken ...
}
/**
* Implementation of AccessTokenApiInterface#exchangeTicket
*/
public function exchangeTicket(string $ticketId, int &$responseCode, array &$responseHeaders): array|object|null
{
// Implement the operation ...
}
// Other operation methods ...
}Step 5: Tag your API implementation:
# config/services.yaml
services:
# ...
Acme\MyBundle\Api\AccessTokenApi:
tags:
- { name: "open_api_server.api", api: "accessToken" }
# ...Now you can start using the bundle!
All URIs are relative to https://api.netlify.com/api/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AccessTokenApiInterface | exchangeTicket | POST /oauth/tickets/{ticket_id}/exchange | |
| AccountMembershipApiInterface | cancelAccount | DELETE /accounts/{account_id} | |
| AccountMembershipApiInterface | createAccount | POST /accounts | |
| AccountMembershipApiInterface | getAccount | GET /accounts/{account_id} | |
| AccountMembershipApiInterface | listAccountsForUser | GET /accounts | |
| AccountMembershipApiInterface | updateAccount | PUT /accounts/{account_id} | |
| AccountTypeApiInterface | listAccountTypesForUser | GET /accounts/types | |
| AssetApiInterface | createSiteAsset | POST /sites/{site_id}/assets | |
| AssetApiInterface | deleteSiteAsset | DELETE /sites/{site_id}/assets/{asset_id} | |
| AssetApiInterface | getSiteAssetInfo | GET /sites/{site_id}/assets/{asset_id} | |
| AssetApiInterface | listSiteAssets | GET /sites/{site_id}/assets | |
| AssetApiInterface | updateSiteAsset | PUT /sites/{site_id}/assets/{asset_id} | |
| AssetPublicSignatureApiInterface | getSiteAssetPublicSignature | GET /sites/{site_id}/assets/{asset_id}/public_signature | |
| AuditLogApiInterface | listAccountAuditEvents | GET /accounts/{account_id}/audit | |
| BuildApiInterface | createSiteBuild | POST /sites/{site_id}/builds | |
| BuildApiInterface | getAccountBuildStatus | GET /{account_id}/builds/status | |
| BuildApiInterface | getSiteBuild | GET /builds/{build_id} | |
| BuildApiInterface | listSiteBuilds | GET /sites/{site_id}/builds | |
| BuildApiInterface | notifyBuildStart | POST /builds/{build_id}/start | |
| BuildHookApiInterface | createSiteBuildHook | POST /sites/{site_id}/build_hooks | |
| BuildHookApiInterface | deleteSiteBuildHook | DELETE /sites/{site_id}/build_hooks/{id} | |
| BuildHookApiInterface | getSiteBuildHook | GET /sites/{site_id}/build_hooks/{id} | |
| BuildHookApiInterface | listSiteBuildHooks | GET /sites/{site_id}/build_hooks | |
| BuildHookApiInterface | updateSiteBuildHook | PUT /sites/{site_id}/build_hooks/{id} | |
| BuildLogMsgApiInterface | updateSiteBuildLog | POST /builds/{build_id}/log | |
| DeployApiInterface | cancelSiteDeploy | POST /deploys/{deploy_id}/cancel | |
| DeployApiInterface | createSiteDeploy | POST /sites/{site_id}/deploys | |
| DeployApiInterface | deleteDeploy | DELETE /deploys/{deploy_id} | |
| DeployApiInterface | deleteSiteDeploy | DELETE /sites/{site_id}/deploys/{deploy_id} | |
| DeployApiInterface | getDeploy | GET /deploys/{deploy_id} | |
| DeployApiInterface | getSiteDeploy | GET /sites/{site_id}/deploys/{deploy_id} | |
| DeployApiInterface | listSiteDeploys | GET /sites/{site_id}/deploys | |
| DeployApiInterface | lockDeploy | POST /deploys/{deploy_id}/lock | |
| DeployApiInterface | restoreSiteDeploy | POST /sites/{site_id}/deploys/{deploy_id}/restore | |
| DeployApiInterface | rollbackSiteDeploy | PUT /sites/{site_id}/rollback | |
| DeployApiInterface | unlockDeploy | POST /deploys/{deploy_id}/unlock | |
| DeployApiInterface | updateSiteDeploy | PUT /sites/{site_id}/deploys/{deploy_id} | |
| DeployKeyApiInterface | createDeployKey | POST /deploy_keys | |
| DeployKeyApiInterface | deleteDeployKey | DELETE /deploy_keys/{key_id} | |
| DeployKeyApiInterface | getDeployKey | GET /deploy_keys/{key_id} | |
| DeployKeyApiInterface | listDeployKeys | GET /deploy_keys | |
| DeployedBranchApiInterface | listSiteDeployedBranches | GET /sites/{site_id}/deployed-branches | |
| DnsZoneApiInterface | configureDNSForSite | PUT /sites/{site_id}/dns | |
| DnsZoneApiInterface | createDnsRecord | POST /dns_zones/{zone_id}/dns_records | |
| DnsZoneApiInterface | createDnsZone | POST /dns_zones | |
| DnsZoneApiInterface | deleteDnsRecord | DELETE /dns_zones/{zone_id}/dns_records/{dns_record_id} | |
| DnsZoneApiInterface | deleteDnsZone | DELETE /dns_zones/{zone_id} | |
| DnsZoneApiInterface | getDNSForSite | GET /sites/{site_id}/dns | |
| DnsZoneApiInterface | getDnsRecords | GET /dns_zones/{zone_id}/dns_records | |
| DnsZoneApiInterface | getDnsZone | GET /dns_zones/{zone_id} | |
| DnsZoneApiInterface | getDnsZones | GET /dns_zones | |
| DnsZoneApiInterface | getIndividualDnsRecord | GET /dns_zones/{zone_id}/dns_records/{dns_record_id} | |
| DnsZoneApiInterface | transferDnsZone | PUT /dns_zones/{zone_id}/transfer | |
| EnvironmentVariablesApiInterface | createEnvVars | POST /accounts/{account_id}/env | |
| EnvironmentVariablesApiInterface | deleteEnvVar | DELETE /accounts/{account_id}/env/{key} | |
| EnvironmentVariablesApiInterface | deleteEnvVarValue | DELETE /accounts/{account_id}/env/{key}/value/{id} | |
| EnvironmentVariablesApiInterface | getEnvVar | GET /accounts/{account_id}/env/{key} | |
| EnvironmentVariablesApiInterface | getEnvVars | GET /accounts/{account_id}/env | |
| EnvironmentVariablesApiInterface | setEnvVarValue | PATCH /accounts/{account_id}/env/{key} | |
| EnvironmentVariablesApiInterface | updateEnvVar | PUT /accounts/{account_id}/env/{key} | |
| FileApiInterface | getSiteFileByPathName | GET /sites/{site_id}/files/{file_path} | |
| FileApiInterface | listSiteFiles | GET /sites/{site_id}/files | |
| FileApiInterface | uploadDeployFile | PUT /deploys/{deploy_id}/files/{path} | |
| FormApiInterface | deleteSiteForm | DELETE /sites/{site_id}/forms/{form_id} | |
| FormApiInterface | listSiteForms | GET /sites/{site_id}/forms | |
| FunctionApiInterface | uploadDeployFunction | PUT /deploys/{deploy_id}/functions/{name} | |
| HookApiInterface | createHookBySiteId | POST /hooks | |
| HookApiInterface | deleteHook | DELETE /hooks/{hook_id} | |
| HookApiInterface | enableHook | POST /hooks/{hook_id}/enable | |
| HookApiInterface | getHook | GET /hooks/{hook_id} | |
| HookApiInterface | listHooksBySiteId | GET /hooks | |
| HookApiInterface | updateHook | PUT /hooks/{hook_id} | |
| HookTypeApiInterface | listHookTypes | GET /hooks/types | |
| MemberApiInterface | addMemberToAccount | POST /{account_slug}/members | |
| MemberApiInterface | getAccountMember | GET /{account_slug}/members/{member_id} | |
| MemberApiInterface | listMembersForAccount | GET /{account_slug}/members | |
| MemberApiInterface | removeAccountMember | DELETE /{account_slug}/members/{member_id} | |
| MemberApiInterface | updateAccountMember | PUT /{account_slug}/members/{member_id} | |
| MetadataApiInterface | getSiteMetadata | GET /sites/{site_id}/metadata | |
| MetadataApiInterface | updateSiteMetadata | PUT /sites/{site_id}/metadata | |
| PaymentMethodApiInterface | listPaymentMethodsForUser | GET /billing/payment_methods | |
| ServiceApiInterface | getServices | GET /services/ | |
| ServiceApiInterface | showService | GET /services/{addonName} | |
| ServiceApiInterface | showServiceManifest | GET /services/{addonName}/manifest | |
| ServiceInstanceApiInterface | createServiceInstance | POST /sites/{site_id}/services/{addon}/instances | |
| ServiceInstanceApiInterface | deleteServiceInstance | DELETE /sites/{site_id}/services/{addon}/instances/{instance_id} | |
| ServiceInstanceApiInterface | listServiceInstancesForSite | GET /sites/{site_id}/service-instances | |
| ServiceInstanceApiInterface | showServiceInstance | GET /sites/{site_id}/services/{addon}/instances/{instance_id} | |
| ServiceInstanceApiInterface | updateServiceInstance | PUT /sites/{site_id}/services/{addon}/instances/{instance_id} | |
| SiteApiInterface | createSite | POST /sites | |
| SiteApiInterface | createSiteInTeam | POST /{account_slug}/sites | |
| SiteApiInterface | deleteSite | DELETE /sites/{site_id} | |
| SiteApiInterface | getSite | GET /sites/{site_id} | |
| SiteApiInterface | listSites | GET /sites | |
| SiteApiInterface | listSitesForAccount | GET /{account_slug}/sites | |
| SiteApiInterface | unlinkSiteRepo | PUT /sites/{site_id}/unlink_repo | |
| SiteApiInterface | updateSite | PATCH /sites/{site_id} | |
| SniCertificateApiInterface | provisionSiteTLSCertificate | POST /sites/{site_id}/ssl | |
| SniCertificateApiInterface | showSiteTLSCertificate | GET /sites/{site_id}/ssl | |
| SnippetApiInterface | createSiteSnippet | POST /sites/{site_id}/snippets | |
| SnippetApiInterface | deleteSiteSnippet | DELETE /sites/{site_id}/snippets/{snippet_id} | |
| SnippetApiInterface | getSiteSnippet | GET /sites/{site_id}/snippets/{snippet_id} | |
| SnippetApiInterface | listSiteSnippets | GET /sites/{site_id}/snippets | |
| SnippetApiInterface | updateSiteSnippet | PUT /sites/{site_id}/snippets/{snippet_id} | |
| SplitTestApiInterface | createSplitTest | POST /sites/{site_id}/traffic_splits | |
| SplitTestApiInterface | disableSplitTest | POST /sites/{site_id}/traffic_splits/{split_test_id}/unpublish | |
| SplitTestApiInterface | enableSplitTest | POST /sites/{site_id}/traffic_splits/{split_test_id}/publish | |
| SplitTestApiInterface | getSplitTest | GET /sites/{site_id}/traffic_splits/{split_test_id} | |
| SplitTestApiInterface | getSplitTests | GET /sites/{site_id}/traffic_splits | |
| SplitTestApiInterface | updateSplitTest | PUT /sites/{site_id}/traffic_splits/{split_test_id} | |
| SubmissionApiInterface | deleteSubmission | DELETE /submissions/{submission_id} | |
| SubmissionApiInterface | listFormSubmission | GET /submissions/{submission_id} | |
| SubmissionApiInterface | listFormSubmissions | GET /forms/{form_id}/submissions | |
| SubmissionApiInterface | listSiteSubmissions | GET /sites/{site_id}/submissions | |
| TicketApiInterface | createTicket | POST /oauth/tickets | |
| TicketApiInterface | showTicket | GET /oauth/tickets/{ticket_id} | |
| UserApiInterface | getCurrentUser | GET /user | |
| XInternalApiInterface | createPluginRun | POST /deploys/{deploy_id}/plugin_runs | |
| XInternalApiInterface | getLatestPluginRuns | GET /sites/{site_id}/plugin_runs/latest | |
| XInternalApiInterface | updatePlugin | PUT /sites/{site_id}/plugins/{package} |
- AccessToken
- AccountAddMemberSetup
- AccountMembership
- AccountMembershipCapabilities
- AccountSetup
- AccountType
- AccountUpdateMemberSetup
- AccountUpdateSetup
- AccountUsageCapability
- Asset
- AssetForm
- AssetPublicSignature
- AssetSignature
- AuditLog
- Build
- BuildHook
- BuildHookSetup
- BuildLogMsg
- BuildSetup
- BuildStatus
- BuildStatusMinutes
- CreateEnvVarsRequestInner
- Deploy
- DeployFiles
- DeployKey
- DeploySiteCapabilities
- DeployedBranch
- DnsRecord
- DnsRecordCreate
- DnsZone
- DnsZoneSetup
- EnvVar
- EnvVarUser
- EnvVarValue
- Error
- File
- Form
- FunctionConfig
- FunctionSchedule
- Hook
- HookType
- Member
- MinifyOptions
- ModelFunction
- PaymentMethod
- PaymentMethodData
- Plugin
- PluginParams
- PluginRun
- PluginRunData
- RepoInfo
- Service
- ServiceInstance
- SetEnvVarValueRequest
- Site
- SiteDefaultHooksData
- SiteProcessingSettings
- SiteProcessingSettingsHtml
- SiteProcessingSettingsImages
- SiteSetup
- SniCertificate
- Snippet
- SplitTest
- SplitTestSetup
- Submission
- Ticket
- User
- UserOnboardingProgress
Authentication schemes defined for the API:
- Type: OAuth
- Flow: implicit
- Authorization URL: https://app.netlify.com/authorize
- Scopes: N/A