Reference for Using the DigitalOcean API with App Platform

The DigitalOcean API allows you to manage your app in a programmatic way using conventional HTTP requests. All of the functionality that you see in the DigitalOcean control panel is also available through the API, allowing you to script the complex actions that your situation requires.

The DigitalOcean API is useful for automating configuration and resourcing changes to your app from within the application code itself.

Connect to the API

Use of the API requires an API token, which you can generate for your account by visiting the control panel’s token generator.

The endpoint for the App Platform API is https://api.digitalocean.com/v2/apps; you can consult the API documentation for details on how to send native HTTP requests that are properly formed to make API calls.

Get familiar with the structure and behavior of the DigitalOcean API.
See examples of how to format requests to interact with the DigitalOcean API.
Create a personal access token for use with the DigitalOcean API.
Programmatically manage Droplets and other DigitalOcean resources using conventional HTTP requests. All of the functionality in the DigitalOcean Control Panel is also available through the API.
The metadata API allows a Droplet to access information about itself including user data, Droplet ID, datacenter region, and IP addresses.
The OAuth API is a secure method for authenticating users and allowing third-party applications limited access to your servers or DigitalOcean user accounts.
Programmatically manage your data with Spaces’ AWS S3-compatible object storage API

Connect to the API with a Wrapper Library

Alternatively, you can use an API wrapper for your desired programming language to integrate access to the API in your application’s codebase. This makes calls to the DigitalOcean API similar to calling functions from locally-installed libraries that your code is importing. You will still need to create an API token with the control panel’s token generator and reference the token string in your code.

Official and community-created client libraries that let you use the DigitalOcean API in a variety of programming languages.

Consult the Reference Documentation

The reference documentation for the DigitalOcean API is viewable at developers.digitalocean.com. It should be noted that the API includes functionality for all of DigitalOcean’s products, including App Platform. As an App Platform user you will want to click the Apps link to see the API methods that apply to App Platform events.

That said, because you can also manage databases, domains, and account details through the API, it could be worth exploring other areas outside of Apps, depending on what you’d like to automate.

Programmatically manage Droplets and other DigitalOcean resources using conventional HTTP requests. All of the functionality in the DigitalOcean Control Panel is also available through the API.