DigitalOcean Insights API Reference
Last verified 1 Oct 2026
The DigitalOcean Insights API provides observability resources for monitoring your infrastructure, including alert rules that evaluate metrics, notification channels that deliver alert events, read-only alert instances that record when alert rules fire, and PromQL and logs query interfaces.
https://api.digitalocean.com
Endpoints
GET List Alert Instances
/v2/insights/alert-instances
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To list alert instances for your account, send a GET request to
/v2/insights/alert-instances. Alert instances are read-only records of
alert rule firings against your resources.
Results can optionally be filtered by status, rule_id, or
resource_urn.
Results are ordered by triggered_at descending (newest first). Because
the list is append-only and continuously growing, offset-based pagination
is best-effort: newly triggered instances may shift older rows onto
subsequent pages between fetches. For stable pagination, filter by
rule_id or a fixed time window on the client side.
Query Parameters
per_page
1 – 200 optional
2Number of items returned per page
Default:20page
>= 1 optional
1Which 'page' of paginated results to return.
Default:1status
optional
activeOptional filter. When set, only alert instances with this status are returned.
rule_id
optional
8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5cOptional filter. When set, only alert instances fired by the alert rule with this ID are returned.
resource_urn
optional
do:droplet:12345Optional filter. When set, only resources associated with this resource URN are returned.
Request: /v2/insights/alert-instances
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/insights/alert-instances?status=active&page=1&per_page=20"Responses
200
The response will be a JSON object with a key called alert_instances. This will be set to an array of alert instance objects, each of which will contain the standard attributes associated with an alert instance.
alert_instances. This will be set to an array of alert instance objects, each of which will contain the standard attributes associated with an alert instance.ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
alert_instances
optional
Show child properties
id
required
a1b2c3d4-e5f6-7890-abcd-ef1234567890A unique identifier for the alert instance.
last_notified_at
optional
2026-09-03T10:15:00ZTime a notification was last sent for this alert instance.
last_triggered_at
required
2026-09-03T10:45:00ZTime the alert instance most recently fired.
resolved_at
optional
2026-09-03T11:00:00ZTime the alert instance resolved. Only present when status is
resolved.
resource_urn
optional
do:droplet:12345URN of the DigitalOcean resource the alert fired for. May be an empty string for alerts fired on non-resource-bound signals (for example, cluster/pod/namespace-scoped Kubernetes alerts).
rule_id
required
8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5cID of the alert rule that fired this alert instance.
severity
required
warningSeverity of the breached threshold.
status
required
activeCurrent status of the alert instance.
triggered_at
required
2026-09-03T10:15:00ZTime the alert instance first fired.
value
required
87.5The observed metric value that breached the threshold.
links
optional
Show child properties
pages
optional
Forward Links
last
optional
https://api.digitalocean.com/v2/images?page=2URI of the last page of the results.
next
optional
https://api.digitalocean.com/v2/images?page=2URI of the next page of the results.
Backward Links
first
optional
https://api.digitalocean.com/v2/images?page=1URI of the first page of the results.
prev
optional
https://api.digitalocean.com/v2/images?page=1URI of the previous page of the results.
meta
required
400
There was an error parsing the request body.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"alert_instances": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"last_notified_at": "2026-09-03T10:15:00Z",
"last_triggered_at": "2026-09-03T10:45:00Z",
"resource_urn": "do:droplet:12345",
"rule_id": "8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"severity": "warning",
"status": "active",
"triggered_at": "2026-09-03T10:15:00Z",
"value": 87.5
}
],
"links": {
"pages": {}
},
"meta": {
"total": 1
}
}{
"id": "bad_request",
"message": "error parsing request body",
"request_id": "4851a473-1621-42ea-b2f9-5071c0ea8414"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Retrieve an Alert Instance
/v2/insights/alert-instances/{id}
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To retrieve a single alert instance, send a GET request to
/v2/insights/alert-instances/{id}.
Path Parameters
id
required
a1b2c3d4-e5f6-7890-abcd-ef1234567890A unique identifier for an alert instance.
Request: /v2/insights/alert-instances/{id}
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/insights/alert-instances/a1b2c3d4-e5f6-7890-abcd-ef1234567890"Responses
200
The response will be a JSON object with a key called alert_instance containing the standard attributes associated with an alert instance.
alert_instance containing the standard attributes associated with an alert instance.ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
alert_instance
required
A read-only record of an alert rule firing against a resource.
Show child properties
id
required
a1b2c3d4-e5f6-7890-abcd-ef1234567890A unique identifier for the alert instance.
last_notified_at
optional
2026-09-03T10:15:00ZTime a notification was last sent for this alert instance.
last_triggered_at
required
2026-09-03T10:45:00ZTime the alert instance most recently fired.
resolved_at
optional
2026-09-03T11:00:00ZTime the alert instance resolved. Only present when status is
resolved.
resource_urn
optional
do:droplet:12345URN of the DigitalOcean resource the alert fired for. May be an empty string for alerts fired on non-resource-bound signals (for example, cluster/pod/namespace-scoped Kubernetes alerts).
rule_id
required
8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5cID of the alert rule that fired this alert instance.
severity
required
warningSeverity of the breached threshold.
status
required
activeCurrent status of the alert instance.
triggered_at
required
2026-09-03T10:15:00ZTime the alert instance first fired.
value
required
87.5The observed metric value that breached the threshold.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"alert_instance": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"last_notified_at": "2026-09-02T08:00:00Z",
"last_triggered_at": "2026-09-02T08:30:00Z",
"resolved_at": "2026-09-02T09:00:00Z",
"resource_urn": "do:droplet:12345",
"rule_id": "8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"severity": "critical",
"status": "resolved",
"triggered_at": "2026-09-02T08:00:00Z",
"value": 95.2
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET List Alert Rules
/v2/insights/alert-rules
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To list alert rules for your account, send a GET request to
/v2/insights/alert-rules. Results are paginated with page and per_page
(default 20, maximum 200). Optionally filter by resource_urn.
Query Parameters
page
>= 1 optional
1Which 'page' of paginated results to return.
Default:1per_page
1 – 200 optional
2Number of items returned per page
Default:20resource_urn
optional
do:droplet:12345Optional filter. When set, only resources associated with this resource URN are returned.
Request: /v2/insights/alert-rules
curl -X GET \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/insights/alert-rules?page=1&per_page=20"Responses
200
A list of alert rules.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
alert_rules
required
Show child properties
created_at
required read-only
2026-09-03T10:00:00ZTime the alert rule was created.
id
required read-only
a1b2c3d4-e5f6-7890-abcd-ef1234567890A unique identifier for the alert rule.
spec
required
Spec for an Insights alert rule. On create, name, query, thresholds,
and at least one notification_channels binding are required. On update,
omit notification_channels to keep existing bindings; an explicit empty
list is rejected.
Show child properties
condition
optional
Evaluation condition for the alert rule.
Show child properties
window
optional
EVALUATION_WINDOW_5MTime window over which the metric is evaluated. Allowed values:
EVALUATION_WINDOW_1M=1mEVALUATION_WINDOW_5M=5mEVALUATION_WINDOW_10M=10mEVALUATION_WINDOW_15M=15mEVALUATION_WINDOW_30M=30mEVALUATION_WINDOW_1H=1h
name
required
High CPUA human-readable name for the alert rule.
notification_channels
optional
Notification channels to notify when the rule fires.
Show child properties
notification_channel_id
required
550e8400-e29b-41d4-a716-446655440000ID of an existing notification channel owned by the account.
notify_on
optional
["SEVERITY_CRITICAL"]Severities that trigger this channel. Allowed values:
SEVERITY_WARNING= warningSEVERITY_CRITICAL= critical
query
required
Metrics query that the alert rule evaluates. metric must be a dotted
OpenTelemetry name (for example do.droplets.cpu_utilization). Underscored
Prometheus-style names are rejected. When resource_urns is omitted or empty,
the rule is not scoped to specific resources.
Show child properties
filters
optional
Optional label filters applied to the metric series.
metric
required
do.droplets.cpu_utilizationDotted OpenTelemetry metric name to evaluate
(for example do.droplets.cpu_utilization).
resource_urns
optional
["do:droplet:12345"]Optional list of DigitalOcean resource URNs the rule applies to. Empty or omitted means the rule is not scoped to specific resources.
tags
optional
["env:prod"]Optional resource tags used to select matching resources.
re_alert_duration
optional
RE_ALERT_DURATION_4HMinimum wait before re-notifying a still-firing alert. Defaults to
RE_ALERT_DURATION_4H on create when omitted. Allowed values:
RE_ALERT_DURATION_30M=30mRE_ALERT_DURATION_1H=1hRE_ALERT_DURATION_4H=4hRE_ALERT_DURATION_NEVER= never
thresholds
required
Threshold configuration for the alert rule. At least one of warning or
critical must be set.
status
required read-only
ALERT_RULE_STATUS_ACTIVECurrent alert rule status. Allowed values:
ALERT_RULE_STATUS_ACTIVE= activeALERT_RULE_STATUS_PAUSED= paused
updated_at
required read-only
2026-09-03T10:00:00ZTime the alert rule was last updated.
links
optional
Show child properties
pages
optional
Forward Links
last
optional
https://api.digitalocean.com/v2/images?page=2URI of the last page of the results.
next
optional
https://api.digitalocean.com/v2/images?page=2URI of the next page of the results.
Backward Links
first
optional
https://api.digitalocean.com/v2/images?page=1URI of the first page of the results.
prev
optional
https://api.digitalocean.com/v2/images?page=1URI of the previous page of the results.
meta
required
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"alert_rules": [
{
"created_at": "2026-09-03T10:00:00Z",
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"spec": {
"condition": {
"window": "EVALUATION_WINDOW_5M"
},
"name": "High CPU",
"notification_channels": [
{
"notification_channel_id": "550e8400-e29b-41d4-a716-446655440000",
"notify_on": [
"SEVERITY_CRITICAL"
]
}
],
"query": {
"metric": "do.droplets.cpu_utilization",
"resource_urns": [
"do:droplet:12345"
]
},
"re_alert_duration": "RE_ALERT_DURATION_4H",
"thresholds": {
"critical": 95,
"operator": "THRESHOLD_OPERATOR_GREATER_THAN",
"warning": 80
}
},
"status": "ALERT_RULE_STATUS_PAUSED",
"updated_at": "2026-09-03T10:30:00Z"
}
],
"links": {
"pages": {
"first": "https://api.digitalocean.com/v2/insights/alert-rules?page=1",
"last": "https://api.digitalocean.com/v2/insights/alert-rules?page=1"
}
},
"meta": {
"total": 1
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Create an Alert Rule
/v2/insights/alert-rules
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To create an alert rule, send a POST request to /v2/insights/alert-rules
with a spec containing name, query, thresholds, and at least one
notification_channels binding. status defaults to
ALERT_RULE_STATUS_ACTIVE when omitted. re_alert_duration defaults to
RE_ALERT_DURATION_4H when omitted.
query.metric must be a dotted OpenTelemetry name such as
do.droplets.cpu_utilization. Underscored Prometheus-style names are
rejected with 422 Unprocessable Entity.
Request Body: application/json
spec
optional
status
optional
ALERT_RULE_STATUS_ACTIVEDesired alert rule status. Allowed values:
ALERT_RULE_STATUS_ACTIVE= activeALERT_RULE_STATUS_PAUSED= paused
Request: /v2/insights/alert-rules
{
"spec": {
"condition": {
"window": "EVALUATION_WINDOW_5M"
},
"name": "High CPU",
"notification_channels": [
{
"notification_channel_id": "550e8400-e29b-41d4-a716-446655440000",
"notify_on": [
"SEVERITY_CRITICAL"
]
}
],
"query": {
"metric": "do.droplets.cpu_utilization",
"resource_urns": [
"do:droplet:12345"
],
"tags": [
"env:prod"
]
},
"re_alert_duration": "RE_ALERT_DURATION_4H",
"thresholds": {
"critical": 95,
"operator": "THRESHOLD_OPERATOR_GREATER_THAN",
"warning": 80
}
}
}curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"spec":{"name":"High CPU","query":{"metric":"do.droplets.cpu_utilization","resource_urns":["do:droplet:12345"],"tags":["env:prod"]},"condition":{"window":"EVALUATION_WINDOW_5M"},"thresholds":{"warning":80,"critical":95,"operator":"THRESHOLD_OPERATOR_GREATER_THAN"},"notification_channels":[{"notification_channel_id":"550e8400-e29b-41d4-a716-446655440000","notify_on":["SEVERITY_CRITICAL"]}],"re_alert_duration":"RE_ALERT_DURATION_4H"}}' \
"https://api.digitalocean.com/v2/insights/alert-rules"Responses
201
A single alert rule.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
alert_rule
required
An Insights alert rule.
Show child properties
created_at
required read-only
2026-09-03T10:00:00ZTime the alert rule was created.
id
required read-only
a1b2c3d4-e5f6-7890-abcd-ef1234567890A unique identifier for the alert rule.
spec
required
Spec for an Insights alert rule. On create, name, query, thresholds,
and at least one notification_channels binding are required. On update,
omit notification_channels to keep existing bindings; an explicit empty
list is rejected.
Show child properties
condition
optional
Evaluation condition for the alert rule.
Show child properties
window
optional
EVALUATION_WINDOW_5MTime window over which the metric is evaluated. Allowed values:
EVALUATION_WINDOW_1M=1mEVALUATION_WINDOW_5M=5mEVALUATION_WINDOW_10M=10mEVALUATION_WINDOW_15M=15mEVALUATION_WINDOW_30M=30mEVALUATION_WINDOW_1H=1h
name
required
High CPUA human-readable name for the alert rule.
notification_channels
optional
Notification channels to notify when the rule fires.
Show child properties
notification_channel_id
required
550e8400-e29b-41d4-a716-446655440000ID of an existing notification channel owned by the account.
notify_on
optional
["SEVERITY_CRITICAL"]Severities that trigger this channel. Allowed values:
SEVERITY_WARNING= warningSEVERITY_CRITICAL= critical
query
required
Metrics query that the alert rule evaluates. metric must be a dotted
OpenTelemetry name (for example do.droplets.cpu_utilization). Underscored
Prometheus-style names are rejected. When resource_urns is omitted or empty,
the rule is not scoped to specific resources.
Show child properties
filters
optional
Optional label filters applied to the metric series.
metric
required
do.droplets.cpu_utilizationDotted OpenTelemetry metric name to evaluate
(for example do.droplets.cpu_utilization).
resource_urns
optional
["do:droplet:12345"]Optional list of DigitalOcean resource URNs the rule applies to. Empty or omitted means the rule is not scoped to specific resources.
tags
optional
["env:prod"]Optional resource tags used to select matching resources.
re_alert_duration
optional
RE_ALERT_DURATION_4HMinimum wait before re-notifying a still-firing alert. Defaults to
RE_ALERT_DURATION_4H on create when omitted. Allowed values:
RE_ALERT_DURATION_30M=30mRE_ALERT_DURATION_1H=1hRE_ALERT_DURATION_4H=4hRE_ALERT_DURATION_NEVER= never
thresholds
required
Threshold configuration for the alert rule. At least one of warning or
critical must be set.
status
required read-only
ALERT_RULE_STATUS_ACTIVECurrent alert rule status. Allowed values:
ALERT_RULE_STATUS_ACTIVE= activeALERT_RULE_STATUS_PAUSED= paused
updated_at
required read-only
2026-09-03T10:00:00ZTime the alert rule was last updated.
400
There was an error parsing the request body.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
422
Unprocessable Entity
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"alert_rule": {
"created_at": "2026-09-03T10:00:00Z",
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"spec": {
"condition": {
"window": "EVALUATION_WINDOW_5M"
},
"name": "High CPU",
"notification_channels": [
{
"notification_channel_id": "550e8400-e29b-41d4-a716-446655440000",
"notify_on": [
"SEVERITY_CRITICAL"
]
}
],
"query": {
"metric": "do.droplets.cpu_utilization",
"resource_urns": [
"do:droplet:12345"
],
"tags": [
"env:prod"
]
},
"re_alert_duration": "RE_ALERT_DURATION_4H",
"thresholds": {
"critical": 95,
"operator": "THRESHOLD_OPERATOR_GREATER_THAN",
"warning": 80
}
},
"status": "ALERT_RULE_STATUS_ACTIVE",
"updated_at": "2026-09-03T10:00:00Z"
}
}{
"id": "bad_request",
"message": "error parsing request body",
"request_id": "4851a473-1621-42ea-b2f9-5071c0ea8414"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "unprocessable_entity",
"message": "request payload validation failed",
"request_id": "4851a473-1621-42ea-b2f9-5071c0ea8414"
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Retrieve an Alert Rule
/v2/insights/alert-rules/{id}
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To retrieve an alert rule, send a GET request to
/v2/insights/alert-rules/{id}.
Path Parameters
id
required
a1b2c3d4-e5f6-7890-abcd-ef1234567890A unique identifier for an alert rule.
Request: /v2/insights/alert-rules/{id}
curl -X GET \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/insights/alert-rules/a1b2c3d4-e5f6-7890-abcd-ef1234567890"Responses
200
A single alert rule.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
alert_rule
required
An Insights alert rule.
Show child properties
created_at
required read-only
2026-09-03T10:00:00ZTime the alert rule was created.
id
required read-only
a1b2c3d4-e5f6-7890-abcd-ef1234567890A unique identifier for the alert rule.
spec
required
Spec for an Insights alert rule. On create, name, query, thresholds,
and at least one notification_channels binding are required. On update,
omit notification_channels to keep existing bindings; an explicit empty
list is rejected.
Show child properties
condition
optional
Evaluation condition for the alert rule.
Show child properties
window
optional
EVALUATION_WINDOW_5MTime window over which the metric is evaluated. Allowed values:
EVALUATION_WINDOW_1M=1mEVALUATION_WINDOW_5M=5mEVALUATION_WINDOW_10M=10mEVALUATION_WINDOW_15M=15mEVALUATION_WINDOW_30M=30mEVALUATION_WINDOW_1H=1h
name
required
High CPUA human-readable name for the alert rule.
notification_channels
optional
Notification channels to notify when the rule fires.
Show child properties
notification_channel_id
required
550e8400-e29b-41d4-a716-446655440000ID of an existing notification channel owned by the account.
notify_on
optional
["SEVERITY_CRITICAL"]Severities that trigger this channel. Allowed values:
SEVERITY_WARNING= warningSEVERITY_CRITICAL= critical
query
required
Metrics query that the alert rule evaluates. metric must be a dotted
OpenTelemetry name (for example do.droplets.cpu_utilization). Underscored
Prometheus-style names are rejected. When resource_urns is omitted or empty,
the rule is not scoped to specific resources.
Show child properties
filters
optional
Optional label filters applied to the metric series.
metric
required
do.droplets.cpu_utilizationDotted OpenTelemetry metric name to evaluate
(for example do.droplets.cpu_utilization).
resource_urns
optional
["do:droplet:12345"]Optional list of DigitalOcean resource URNs the rule applies to. Empty or omitted means the rule is not scoped to specific resources.
tags
optional
["env:prod"]Optional resource tags used to select matching resources.
re_alert_duration
optional
RE_ALERT_DURATION_4HMinimum wait before re-notifying a still-firing alert. Defaults to
RE_ALERT_DURATION_4H on create when omitted. Allowed values:
RE_ALERT_DURATION_30M=30mRE_ALERT_DURATION_1H=1hRE_ALERT_DURATION_4H=4hRE_ALERT_DURATION_NEVER= never
thresholds
required
Threshold configuration for the alert rule. At least one of warning or
critical must be set.
status
required read-only
ALERT_RULE_STATUS_ACTIVECurrent alert rule status. Allowed values:
ALERT_RULE_STATUS_ACTIVE= activeALERT_RULE_STATUS_PAUSED= paused
updated_at
required read-only
2026-09-03T10:00:00ZTime the alert rule was last updated.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"alert_rule": {
"created_at": "2026-09-03T10:00:00Z",
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"spec": {
"condition": {
"window": "EVALUATION_WINDOW_5M"
},
"name": "High CPU",
"notification_channels": [
{
"notification_channel_id": "550e8400-e29b-41d4-a716-446655440000",
"notify_on": [
"SEVERITY_CRITICAL"
]
}
],
"query": {
"metric": "do.droplets.cpu_utilization",
"resource_urns": [
"do:droplet:12345"
],
"tags": [
"env:prod"
]
},
"re_alert_duration": "RE_ALERT_DURATION_4H",
"thresholds": {
"critical": 95,
"operator": "THRESHOLD_OPERATOR_GREATER_THAN",
"warning": 80
}
},
"status": "ALERT_RULE_STATUS_ACTIVE",
"updated_at": "2026-09-03T10:00:00Z"
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}PUT Update an Alert Rule
/v2/insights/alert-rules/{id}
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
This PUT endpoint uses merge semantics. To update an alert rule, send a
request to /v2/insights/alert-rules/{id} with a full spec. Omit
notification_channels to keep existing bindings. Omit status or
re_alert_duration to keep those existing values.
Path Parameters
id
required
a1b2c3d4-e5f6-7890-abcd-ef1234567890A unique identifier for an alert rule.
Request Body: application/json
spec
required
Spec for an Insights alert rule. On create, name, query, thresholds,
and at least one notification_channels binding are required. On update,
omit notification_channels to keep existing bindings; an explicit empty
list is rejected.
Show child properties
condition
optional
Evaluation condition for the alert rule.
Show child properties
window
optional
EVALUATION_WINDOW_5MTime window over which the metric is evaluated. Allowed values:
EVALUATION_WINDOW_1M=1mEVALUATION_WINDOW_5M=5mEVALUATION_WINDOW_10M=10mEVALUATION_WINDOW_15M=15mEVALUATION_WINDOW_30M=30mEVALUATION_WINDOW_1H=1h
name
required
High CPUA human-readable name for the alert rule.
notification_channels
optional
Notification channels to notify when the rule fires.
Show child properties
notification_channel_id
required
550e8400-e29b-41d4-a716-446655440000ID of an existing notification channel owned by the account.
notify_on
optional
["SEVERITY_CRITICAL"]Severities that trigger this channel. Allowed values:
SEVERITY_WARNING= warningSEVERITY_CRITICAL= critical
query
required
Metrics query that the alert rule evaluates. metric must be a dotted
OpenTelemetry name (for example do.droplets.cpu_utilization). Underscored
Prometheus-style names are rejected. When resource_urns is omitted or empty,
the rule is not scoped to specific resources.
Show child properties
filters
optional
Optional label filters applied to the metric series.
Show child properties
field
required
host_idThe metric label or field to filter on.
operator
required
FILTER_OPERATOR_EQUALComparison operator for the filter. Allowed values:
FILTER_OPERATOR_EQUAL= equalFILTER_OPERATOR_NOT_EQUAL=not_equalFILTER_OPERATOR_LESS_THAN=less_thanFILTER_OPERATOR_LESS_THAN_OR_EQUAL=less_than_or_equalFILTER_OPERATOR_GREATER_THAN=greater_thanFILTER_OPERATOR_GREATER_THAN_OR_EQUAL=greater_than_or_equal
value
required
12345678Value compared against the field.
metric
required
do.droplets.cpu_utilizationDotted OpenTelemetry metric name to evaluate
(for example do.droplets.cpu_utilization).
resource_urns
optional
["do:droplet:12345"]Optional list of DigitalOcean resource URNs the rule applies to. Empty or omitted means the rule is not scoped to specific resources.
tags
optional
["env:prod"]Optional resource tags used to select matching resources.
re_alert_duration
optional
RE_ALERT_DURATION_4HMinimum wait before re-notifying a still-firing alert. Defaults to
RE_ALERT_DURATION_4H on create when omitted. Allowed values:
RE_ALERT_DURATION_30M=30mRE_ALERT_DURATION_1H=1hRE_ALERT_DURATION_4H=4hRE_ALERT_DURATION_NEVER= never
thresholds
required
Threshold configuration for the alert rule. At least one of warning or
critical must be set.
status
optional
ALERT_RULE_STATUS_ACTIVEDesired alert rule status. Allowed values:
ALERT_RULE_STATUS_ACTIVE= activeALERT_RULE_STATUS_PAUSED= paused
Request: /v2/insights/alert-rules/{id}
{
"spec": {
"condition": {
"window": "EVALUATION_WINDOW_15M"
},
"name": "High CPU (renamed)",
"notification_channels": [
{
"notification_channel_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"query": {
"metric": "do.droplets.cpu_utilization",
"resource_urns": [
"do:droplet:12345",
"do:droplet:67890"
]
},
"thresholds": {
"critical": 90,
"operator": "THRESHOLD_OPERATOR_GREATER_THAN_OR_EQUAL"
}
},
"status": "ALERT_RULE_STATUS_PAUSED"
}curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"spec":{"name":"High CPU (renamed)","query":{"metric":"do.droplets.cpu_utilization","resource_urns":["do:droplet:12345","do:droplet:67890"]},"condition":{"window":"EVALUATION_WINDOW_15M"},"thresholds":{"critical":90,"operator":"THRESHOLD_OPERATOR_GREATER_THAN_OR_EQUAL"},"notification_channels":[{"notification_channel_id":"550e8400-e29b-41d4-a716-446655440000"}]},"status":"ALERT_RULE_STATUS_PAUSED"}' \
"https://api.digitalocean.com/v2/insights/alert-rules/a1b2c3d4-e5f6-7890-abcd-ef1234567890"Responses
200
A single alert rule.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
alert_rule
required
An Insights alert rule.
Show child properties
created_at
required read-only
2026-09-03T10:00:00ZTime the alert rule was created.
id
required read-only
a1b2c3d4-e5f6-7890-abcd-ef1234567890A unique identifier for the alert rule.
spec
required
Spec for an Insights alert rule. On create, name, query, thresholds,
and at least one notification_channels binding are required. On update,
omit notification_channels to keep existing bindings; an explicit empty
list is rejected.
Show child properties
condition
optional
Evaluation condition for the alert rule.
Show child properties
window
optional
EVALUATION_WINDOW_5MTime window over which the metric is evaluated. Allowed values:
EVALUATION_WINDOW_1M=1mEVALUATION_WINDOW_5M=5mEVALUATION_WINDOW_10M=10mEVALUATION_WINDOW_15M=15mEVALUATION_WINDOW_30M=30mEVALUATION_WINDOW_1H=1h
name
required
High CPUA human-readable name for the alert rule.
notification_channels
optional
Notification channels to notify when the rule fires.
Show child properties
notification_channel_id
required
550e8400-e29b-41d4-a716-446655440000ID of an existing notification channel owned by the account.
notify_on
optional
["SEVERITY_CRITICAL"]Severities that trigger this channel. Allowed values:
SEVERITY_WARNING= warningSEVERITY_CRITICAL= critical
query
required
Metrics query that the alert rule evaluates. metric must be a dotted
OpenTelemetry name (for example do.droplets.cpu_utilization). Underscored
Prometheus-style names are rejected. When resource_urns is omitted or empty,
the rule is not scoped to specific resources.
Show child properties
filters
optional
Optional label filters applied to the metric series.
metric
required
do.droplets.cpu_utilizationDotted OpenTelemetry metric name to evaluate
(for example do.droplets.cpu_utilization).
resource_urns
optional
["do:droplet:12345"]Optional list of DigitalOcean resource URNs the rule applies to. Empty or omitted means the rule is not scoped to specific resources.
tags
optional
["env:prod"]Optional resource tags used to select matching resources.
re_alert_duration
optional
RE_ALERT_DURATION_4HMinimum wait before re-notifying a still-firing alert. Defaults to
RE_ALERT_DURATION_4H on create when omitted. Allowed values:
RE_ALERT_DURATION_30M=30mRE_ALERT_DURATION_1H=1hRE_ALERT_DURATION_4H=4hRE_ALERT_DURATION_NEVER= never
thresholds
required
Threshold configuration for the alert rule. At least one of warning or
critical must be set.
status
required read-only
ALERT_RULE_STATUS_ACTIVECurrent alert rule status. Allowed values:
ALERT_RULE_STATUS_ACTIVE= activeALERT_RULE_STATUS_PAUSED= paused
updated_at
required read-only
2026-09-03T10:00:00ZTime the alert rule was last updated.
400
There was an error parsing the request body.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
422
Unprocessable Entity
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"alert_rule": {
"created_at": "2026-09-03T10:00:00Z",
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"spec": {
"condition": {
"window": "EVALUATION_WINDOW_5M"
},
"name": "High CPU",
"notification_channels": [
{
"notification_channel_id": "550e8400-e29b-41d4-a716-446655440000",
"notify_on": [
"SEVERITY_CRITICAL"
]
}
],
"query": {
"metric": "do.droplets.cpu_utilization",
"resource_urns": [
"do:droplet:12345"
],
"tags": [
"env:prod"
]
},
"re_alert_duration": "RE_ALERT_DURATION_4H",
"thresholds": {
"critical": 95,
"operator": "THRESHOLD_OPERATOR_GREATER_THAN",
"warning": 80
}
},
"status": "ALERT_RULE_STATUS_ACTIVE",
"updated_at": "2026-09-03T10:00:00Z"
}
}{
"id": "bad_request",
"message": "error parsing request body",
"request_id": "4851a473-1621-42ea-b2f9-5071c0ea8414"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "unprocessable_entity",
"message": "request payload validation failed",
"request_id": "4851a473-1621-42ea-b2f9-5071c0ea8414"
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}DELETE Delete an Alert Rule
/v2/insights/alert-rules/{id}
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To delete an alert rule, send a DELETE request to
/v2/insights/alert-rules/{id}.
Path Parameters
id
required
a1b2c3d4-e5f6-7890-abcd-ef1234567890A unique identifier for an alert rule.
Request: /v2/insights/alert-rules/{id}
curl -X DELETE \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/insights/alert-rules/a1b2c3d4-e5f6-7890-abcd-ef1234567890"Responses
204
The action was successful and the response body is empty.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET List Notification Channels
/v2/insights/notification-channels
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To list all notification channels for your account, send a GET request to
/v2/insights/notification-channels. Results are paginated with page and
per_page (default 20, maximum 200).
Query Parameters
page
>= 1 optional
1Which 'page' of paginated results to return.
Default:1per_page
1 – 200 optional
2Number of items returned per page
Default:20Request: /v2/insights/notification-channels
curl -X GET \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/insights/notification-channels?page=1&per_page=20"Responses
200
A list of notification channels.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
notification_channels
required
Show child properties
channel_type
required read-only
CHANNEL_TYPE_EMAILThe configured channel type. Allowed values:
CHANNEL_TYPE_EMAIL= emailCHANNEL_TYPE_SLACK= slackCHANNEL_TYPE_WEBHOOK= webhook
created_at
required read-only
2026-09-03T10:15:00ZTime the notification channel was created.
email
optional
Email notification channel configuration. Recipients must be verified team member email addresses.
Show child properties
to
required
[email protected], [email protected]One or more recipient email addresses, separated by commas, semicolons, or spaces.
id
required read-only
550e8400-e29b-41d4-a716-446655440000A unique identifier for the notification channel.
name
required
On-call emailA human-readable name for the notification channel.
slack
optional
Slack notification channel configuration. webhook_url is write-only: send
the full value on create/update; reads return a masked value (********).
Omit webhook_url on update to keep the existing secret.
Show child properties
channel
required
#platform-alertsThe Slack channel name to notify.
webhook_url
optional
https://hooks.slack.com/services/T000/B000/XXXXXXXXSlack incoming webhook URL. Write-only secret — full value on
create/update; masked as ******** on read. Omit on update to retain the
existing value.
updated_at
required read-only
2026-09-03T10:15:00ZTime the notification channel was last updated.
usage
optional read-only
webhook
optional
Generic HTTPS webhook notification channel configuration. The URL must use
HTTPS and must not include userinfo. Optionally configure either
basic_auth or bearer_token (not both), custom headers, and a signing
secret.
url is not a secret and is returned in full on read. Credential fields
(basic_auth.password, bearer_token.token, signature.secret) are
write-only: full value on create/update; masked as ******** on read. Omit
a secret field on update to keep the existing value.
Show child properties
basic_auth
optional
HTTP basic authentication credentials for a webhook. password is
write-only: full value on create/update; masked (********) on read. Omit on
update to keep the existing password.
Show child properties
password
optional
secret-passwordBasic auth password. Write-only secret — full value on create/update;
masked as ******** on read.
username
required
webhook-userBasic auth username.
bearer_token
optional
Bearer token authentication for a webhook. token is write-only: full value
on create/update; masked (********) on read. Omit on update to keep the
existing token.
Show child properties
token
optional
secret-tokenBearer token value sent in the Authorization header. Write-only secret —
full value on create/update; masked as ******** on read.
headers
optional
{"X-Custom":"1"}Optional custom HTTP headers to include on webhook deliveries. At most
20 headers are allowed. Reserved header names such as host,
content-type, and proxy-* are rejected.
signature
optional
Optional HMAC signature configuration. secret is write-only: full value on
create/update; masked (********) on read. Omit on update to keep the
existing secret.
Show child properties
secret
optional
whsecShared secret used to sign webhook payloads. Write-only secret — full
value on create/update; masked as ******** on read.
url
required
https://example.com/hookHTTPS URL that receives webhook deliveries. Returned in full on read.
links
optional
Show child properties
pages
optional
Forward Links
last
optional
https://api.digitalocean.com/v2/images?page=2URI of the last page of the results.
next
optional
https://api.digitalocean.com/v2/images?page=2URI of the next page of the results.
Backward Links
first
optional
https://api.digitalocean.com/v2/images?page=1URI of the first page of the results.
prev
optional
https://api.digitalocean.com/v2/images?page=1URI of the previous page of the results.
meta
required
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"links": {
"pages": {
"first": "https://api.digitalocean.com/v2/insights/notification-channels?page=1",
"last": "https://api.digitalocean.com/v2/insights/notification-channels?page=1"
}
},
"meta": {
"total": 1
},
"notification_channels": [
{
"channel_type": "CHANNEL_TYPE_EMAIL",
"created_at": "2026-09-03T10:15:00Z",
"email": {
"to": "[email protected]"
},
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "On-call email",
"updated_at": "2026-09-03T10:15:00Z",
"usage": {
"rule_count": 2
}
}
]
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Create a Notification Channel
/v2/insights/notification-channels
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To create a notification channel, send a POST request to
/v2/insights/notification-channels with a name and exactly one of
email, slack, or webhook.
Email recipients must be verified team member addresses. Webhook URLs must
use HTTPS. Secret fields (slack.webhook_url, webhook credentials) are
write-only and returned masked on subsequent reads.
Request Body: application/json
Request: /v2/insights/notification-channels
{
"email": {
"to": "[email protected], [email protected]"
},
"name": "On-call email"
}curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"name":"Platform alerts","slack":{"webhook_url":"https://hooks.slack.com/services/T000/B000/XXXXXXXX","channel":"#platform-alerts"}}' \
"https://api.digitalocean.com/v2/insights/notification-channels"Responses
201
A single notification channel.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
notification_channel
required
A reusable Insights notification channel.
Show child properties
channel_type
required read-only
CHANNEL_TYPE_EMAILThe configured channel type. Allowed values:
CHANNEL_TYPE_EMAIL= emailCHANNEL_TYPE_SLACK= slackCHANNEL_TYPE_WEBHOOK= webhook
created_at
required read-only
2026-09-03T10:15:00ZTime the notification channel was created.
email
optional
Email notification channel configuration. Recipients must be verified team member email addresses.
Show child properties
to
required
[email protected], [email protected]One or more recipient email addresses, separated by commas, semicolons, or spaces.
id
required read-only
550e8400-e29b-41d4-a716-446655440000A unique identifier for the notification channel.
name
required
On-call emailA human-readable name for the notification channel.
slack
optional
Slack notification channel configuration. webhook_url is write-only: send
the full value on create/update; reads return a masked value (********).
Omit webhook_url on update to keep the existing secret.
Show child properties
channel
required
#platform-alertsThe Slack channel name to notify.
webhook_url
optional
https://hooks.slack.com/services/T000/B000/XXXXXXXXSlack incoming webhook URL. Write-only secret — full value on
create/update; masked as ******** on read. Omit on update to retain the
existing value.
updated_at
required read-only
2026-09-03T10:15:00ZTime the notification channel was last updated.
usage
optional read-only
webhook
optional
Generic HTTPS webhook notification channel configuration. The URL must use
HTTPS and must not include userinfo. Optionally configure either
basic_auth or bearer_token (not both), custom headers, and a signing
secret.
url is not a secret and is returned in full on read. Credential fields
(basic_auth.password, bearer_token.token, signature.secret) are
write-only: full value on create/update; masked as ******** on read. Omit
a secret field on update to keep the existing value.
Show child properties
basic_auth
optional
HTTP basic authentication credentials for a webhook. password is
write-only: full value on create/update; masked (********) on read. Omit on
update to keep the existing password.
Show child properties
password
optional
secret-passwordBasic auth password. Write-only secret — full value on create/update;
masked as ******** on read.
username
required
webhook-userBasic auth username.
bearer_token
optional
Bearer token authentication for a webhook. token is write-only: full value
on create/update; masked (********) on read. Omit on update to keep the
existing token.
Show child properties
token
optional
secret-tokenBearer token value sent in the Authorization header. Write-only secret —
full value on create/update; masked as ******** on read.
headers
optional
{"X-Custom":"1"}Optional custom HTTP headers to include on webhook deliveries. At most
20 headers are allowed. Reserved header names such as host,
content-type, and proxy-* are rejected.
signature
optional
Optional HMAC signature configuration. secret is write-only: full value on
create/update; masked (********) on read. Omit on update to keep the
existing secret.
Show child properties
secret
optional
whsecShared secret used to sign webhook payloads. Write-only secret — full
value on create/update; masked as ******** on read.
url
required
https://example.com/hookHTTPS URL that receives webhook deliveries. Returned in full on read.
400
There was an error parsing the request body.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"notification_channel": {
"channel_type": "CHANNEL_TYPE_EMAIL",
"created_at": "2026-09-03T10:15:00Z",
"email": {
"to": "[email protected], [email protected]"
},
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "On-call email",
"updated_at": "2026-09-03T10:15:00Z",
"usage": {
"rule_count": 0
}
}
}{
"id": "bad_request",
"message": "error parsing request body",
"request_id": "4851a473-1621-42ea-b2f9-5071c0ea8414"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Retrieve a Notification Channel
/v2/insights/notification-channels/{id}
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To retrieve a notification channel, send a GET request to
/v2/insights/notification-channels/{id}. Secret fields are returned masked
as ********.
Path Parameters
id
required
550e8400-e29b-41d4-a716-446655440000A unique identifier for a notification channel.
Request: /v2/insights/notification-channels/{id}
curl -X GET \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/insights/notification-channels/550e8400-e29b-41d4-a716-446655440000"Responses
200
A single notification channel.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
notification_channel
required
A reusable Insights notification channel.
Show child properties
channel_type
required read-only
CHANNEL_TYPE_EMAILThe configured channel type. Allowed values:
CHANNEL_TYPE_EMAIL= emailCHANNEL_TYPE_SLACK= slackCHANNEL_TYPE_WEBHOOK= webhook
created_at
required read-only
2026-09-03T10:15:00ZTime the notification channel was created.
email
optional
Email notification channel configuration. Recipients must be verified team member email addresses.
Show child properties
to
required
[email protected], [email protected]One or more recipient email addresses, separated by commas, semicolons, or spaces.
id
required read-only
550e8400-e29b-41d4-a716-446655440000A unique identifier for the notification channel.
name
required
On-call emailA human-readable name for the notification channel.
slack
optional
Slack notification channel configuration. webhook_url is write-only: send
the full value on create/update; reads return a masked value (********).
Omit webhook_url on update to keep the existing secret.
Show child properties
channel
required
#platform-alertsThe Slack channel name to notify.
webhook_url
optional
https://hooks.slack.com/services/T000/B000/XXXXXXXXSlack incoming webhook URL. Write-only secret — full value on
create/update; masked as ******** on read. Omit on update to retain the
existing value.
updated_at
required read-only
2026-09-03T10:15:00ZTime the notification channel was last updated.
usage
optional read-only
webhook
optional
Generic HTTPS webhook notification channel configuration. The URL must use
HTTPS and must not include userinfo. Optionally configure either
basic_auth or bearer_token (not both), custom headers, and a signing
secret.
url is not a secret and is returned in full on read. Credential fields
(basic_auth.password, bearer_token.token, signature.secret) are
write-only: full value on create/update; masked as ******** on read. Omit
a secret field on update to keep the existing value.
Show child properties
basic_auth
optional
HTTP basic authentication credentials for a webhook. password is
write-only: full value on create/update; masked (********) on read. Omit on
update to keep the existing password.
Show child properties
password
optional
secret-passwordBasic auth password. Write-only secret — full value on create/update;
masked as ******** on read.
username
required
webhook-userBasic auth username.
bearer_token
optional
Bearer token authentication for a webhook. token is write-only: full value
on create/update; masked (********) on read. Omit on update to keep the
existing token.
Show child properties
token
optional
secret-tokenBearer token value sent in the Authorization header. Write-only secret —
full value on create/update; masked as ******** on read.
headers
optional
{"X-Custom":"1"}Optional custom HTTP headers to include on webhook deliveries. At most
20 headers are allowed. Reserved header names such as host,
content-type, and proxy-* are rejected.
signature
optional
Optional HMAC signature configuration. secret is write-only: full value on
create/update; masked (********) on read. Omit on update to keep the
existing secret.
Show child properties
secret
optional
whsecShared secret used to sign webhook payloads. Write-only secret — full
value on create/update; masked as ******** on read.
url
required
https://example.com/hookHTTPS URL that receives webhook deliveries. Returned in full on read.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"notification_channel": {
"channel_type": "CHANNEL_TYPE_EMAIL",
"created_at": "2026-09-03T10:15:00Z",
"email": {
"to": "[email protected], [email protected]"
},
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "On-call email",
"updated_at": "2026-09-03T10:15:00Z",
"usage": {
"rule_count": 0
}
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}PUT Update a Notification Channel
/v2/insights/notification-channels/{id}
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To update a notification channel, send a PUT request to
/v2/insights/notification-channels/{id} with a name and exactly one of
email, slack, or webhook.
Sending a secret field rotates it; omitting the secret field keeps the existing value.
Path Parameters
id
required
550e8400-e29b-41d4-a716-446655440000A unique identifier for a notification channel.
Request Body: application/json
Request: /v2/insights/notification-channels/{id}
{
"name": "Platform alerts (updated)",
"slack": {
"channel": "#platform-alerts-prod",
"webhook_url": "https://hooks.slack.com/services/T000/B000/NEWTOKEN"
}
}curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"name":"Platform alerts (updated)","slack":{"webhook_url":"https://hooks.slack.com/services/T000/B000/NEWTOKEN","channel":"#platform-alerts-prod"}}' \
"https://api.digitalocean.com/v2/insights/notification-channels/550e8400-e29b-41d4-a716-446655440000"Responses
200
A single notification channel.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
notification_channel
required
A reusable Insights notification channel.
Show child properties
channel_type
required read-only
CHANNEL_TYPE_EMAILThe configured channel type. Allowed values:
CHANNEL_TYPE_EMAIL= emailCHANNEL_TYPE_SLACK= slackCHANNEL_TYPE_WEBHOOK= webhook
created_at
required read-only
2026-09-03T10:15:00ZTime the notification channel was created.
email
optional
Email notification channel configuration. Recipients must be verified team member email addresses.
Show child properties
to
required
[email protected], [email protected]One or more recipient email addresses, separated by commas, semicolons, or spaces.
id
required read-only
550e8400-e29b-41d4-a716-446655440000A unique identifier for the notification channel.
name
required
On-call emailA human-readable name for the notification channel.
slack
optional
Slack notification channel configuration. webhook_url is write-only: send
the full value on create/update; reads return a masked value (********).
Omit webhook_url on update to keep the existing secret.
Show child properties
channel
required
#platform-alertsThe Slack channel name to notify.
webhook_url
optional
https://hooks.slack.com/services/T000/B000/XXXXXXXXSlack incoming webhook URL. Write-only secret — full value on
create/update; masked as ******** on read. Omit on update to retain the
existing value.
updated_at
required read-only
2026-09-03T10:15:00ZTime the notification channel was last updated.
usage
optional read-only
webhook
optional
Generic HTTPS webhook notification channel configuration. The URL must use
HTTPS and must not include userinfo. Optionally configure either
basic_auth or bearer_token (not both), custom headers, and a signing
secret.
url is not a secret and is returned in full on read. Credential fields
(basic_auth.password, bearer_token.token, signature.secret) are
write-only: full value on create/update; masked as ******** on read. Omit
a secret field on update to keep the existing value.
Show child properties
basic_auth
optional
HTTP basic authentication credentials for a webhook. password is
write-only: full value on create/update; masked (********) on read. Omit on
update to keep the existing password.
Show child properties
password
optional
secret-passwordBasic auth password. Write-only secret — full value on create/update;
masked as ******** on read.
username
required
webhook-userBasic auth username.
bearer_token
optional
Bearer token authentication for a webhook. token is write-only: full value
on create/update; masked (********) on read. Omit on update to keep the
existing token.
Show child properties
token
optional
secret-tokenBearer token value sent in the Authorization header. Write-only secret —
full value on create/update; masked as ******** on read.
headers
optional
{"X-Custom":"1"}Optional custom HTTP headers to include on webhook deliveries. At most
20 headers are allowed. Reserved header names such as host,
content-type, and proxy-* are rejected.
signature
optional
Optional HMAC signature configuration. secret is write-only: full value on
create/update; masked (********) on read. Omit on update to keep the
existing secret.
Show child properties
secret
optional
whsecShared secret used to sign webhook payloads. Write-only secret — full
value on create/update; masked as ******** on read.
url
required
https://example.com/hookHTTPS URL that receives webhook deliveries. Returned in full on read.
400
There was an error parsing the request body.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"notification_channel": {
"channel_type": "CHANNEL_TYPE_EMAIL",
"created_at": "2026-09-03T10:15:00Z",
"email": {
"to": "[email protected], [email protected]"
},
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "On-call email",
"updated_at": "2026-09-03T10:15:00Z",
"usage": {
"rule_count": 0
}
}
}{
"id": "bad_request",
"message": "error parsing request body",
"request_id": "4851a473-1621-42ea-b2f9-5071c0ea8414"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}DELETE Delete a Notification Channel
/v2/insights/notification-channels/{id}
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To delete a notification channel, send a DELETE request to
/v2/insights/notification-channels/{id}.
Deleting a channel that is still referenced by one or more alert rules
returns 409 Conflict.
Path Parameters
id
required
550e8400-e29b-41d4-a716-446655440000A unique identifier for a notification channel.
Request: /v2/insights/notification-channels/{id}
curl -X DELETE \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/insights/notification-channels/550e8400-e29b-41d4-a716-446655440000"Responses
204
The action was successful and the response body is empty.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
409
The request could not be completed due to a conflict.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "conflict",
"message": "The request could not be completed due to a conflict."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Execute an instant PromQL query
/v2/insights/query/{region}/prom/api/v1/query
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To evaluate a PromQL expression at a single point in time, send a GET request to /v2/insights/query/{region}/prom/api/v1/query.
Path Parameters
region
required
nyc3The datacenter region slug for the query.
Query Parameters
query
required
do.droplets.cpu_timeA PromQL expression. This may be a metric selector (for example do.droplets.cpu_time) or a fuller expression (for example rate(do.droplets.cpu_time[5m])).
time
optional
1620683817Evaluation timestamp for an instant query. Accepts a RFC3339 string or a UNIX timestamp. Defaults to now when omitted.
timeout
optional
30sOptional evaluation timeout as a Prometheus duration string.
Request: /v2/insights/query/{region}/prom/api/v1/query
curl -X GET \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
--get "https://api.digitalocean.com/v2/insights/query/nyc3/prom/api/v1/query" \
--data-urlencode "query=do.droplets.cpu_time"Responses
200
Instant query result.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
data
required
Show child properties
result
required
[{"metric":{"__name__":"do_droplets_cpu_time"},"value":[1620683817,"1"]}]Result payload shape depends on resultType. vector and matrix are series arrays. scalar and string both use a [timestamp, value] sample pair.
resultType
required
vectorstatus
required
success
400
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
403
The authenticated principal does not have permission to perform this action on the requested resource.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
422
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
503
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"data": {
"result": [
{
"metric": {
"__name__": "do_droplets_cpu_time"
},
"value": [
1620683817,
"1"
]
}
],
"resultType": "vector"
},
"status": "success"
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "forbidden",
"message": "You do not have permission to perform this action."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"id": "example_error",
"message": "some error message"
}GET Execute a range PromQL query
/v2/insights/query/{region}/prom/api/v1/query_range
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To evaluate a PromQL expression over a time range, send a GET request to /v2/insights/query/{region}/prom/api/v1/query_range.
Path Parameters
region
required
nyc3The datacenter region slug for the query.
Query Parameters
query
required
do.droplets.cpu_timeA PromQL expression. This may be a metric selector (for example do.droplets.cpu_time) or a fuller expression (for example rate(do.droplets.cpu_time[5m])).
start
required
1620683817Start timestamp (inclusive). Accepts a RFC3339 string or a UNIX timestamp.
end
required
1620705417End timestamp (inclusive). Accepts a RFC3339 string or a UNIX timestamp.
step
required
15sQuery resolution step width as a Prometheus duration string (for example 15s, 1m, 1h).
timeout
optional
30sOptional evaluation timeout as a Prometheus duration string.
Request: /v2/insights/query/{region}/prom/api/v1/query_range
curl -X GET \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
--get "https://api.digitalocean.com/v2/insights/query/nyc3/prom/api/v1/query_range" \
--data-urlencode "query=do.droplets.cpu_time" \
--data-urlencode "start=1620683817" \
--data-urlencode "end=1620705417" \
--data-urlencode "step=15s"Responses
200
Range query result.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
data
required
Show child properties
result
required
[{"metric":{"__name__":"do_droplets_cpu_time"},"values":[[1620683817,"1"],[1620683832,"1"]]}]One entry per matching series, each carrying the samples evaluated at every step across the requested range.
Show child properties
metric
required
{"__name__":"do_droplets_cpu_time"}Metric labels as key/value pairs. By default, metric names in responses use Prometheus underscored spelling (for example do_droplets_cpu_time), even when the request used a dotted selector (for example do.droplets.cpu_time).
values
required
resultType
required
matrixstatus
required
success
400
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
403
The authenticated principal does not have permission to perform this action on the requested resource.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
422
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
503
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"data": {
"result": [
{
"metric": {
"__name__": "do_droplets_cpu_time"
},
"values": [
[
1620683817,
"1"
],
[
1620683832,
"1"
]
]
}
],
"resultType": "matrix"
},
"status": "success"
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "forbidden",
"message": "You do not have permission to perform this action."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"id": "example_error",
"message": "some error message"
}GET List label names
/v2/insights/query/{region}/prom/api/v1/labels
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To list label names, send a GET request to /v2/insights/query/{region}/prom/api/v1/labels.
Path Parameters
region
required
nyc3The datacenter region slug for the query.
Query Parameters
start
optional
1620683817Optional start timestamp (inclusive). Accepts a RFC3339 string or a UNIX timestamp.
end
optional
1620705417Optional end timestamp (inclusive). Accepts a RFC3339 string or a UNIX timestamp.
match[]
optional
["{__name__=~\".+\"}"]One or more series selectors. Repeat the parameter for multiple matchers.
Request: /v2/insights/query/{region}/prom/api/v1/labels
curl -X GET \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/insights/query/nyc3/prom/api/v1/labels"Responses
200
Label names.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
data
required
["__name__","job","instance"]status
required
success
400
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
403
The authenticated principal does not have permission to perform this action on the requested resource.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
422
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
503
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"data": [
"__name__",
"job",
"instance"
],
"status": "success"
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "forbidden",
"message": "You do not have permission to perform this action."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"id": "example_error",
"message": "some error message"
}GET List values for a label
/v2/insights/query/{region}/prom/api/v1/label/{name}/values
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To list values for a label name, send a GET request to /v2/insights/query/{region}/prom/api/v1/label/{name}/values.
Path Parameters
region
required
nyc3The datacenter region slug for the query.
name
required
__name__The label name whose values should be listed.
Query Parameters
start
optional
1620683817Optional start timestamp (inclusive). Accepts a RFC3339 string or a UNIX timestamp.
end
optional
1620705417Optional end timestamp (inclusive). Accepts a RFC3339 string or a UNIX timestamp.
match[]
optional
["{__name__=~\".+\"}"]One or more series selectors. Repeat the parameter for multiple matchers.
Request: /v2/insights/query/{region}/prom/api/v1/label/{name}/values
curl -X GET \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/insights/query/nyc3/prom/api/v1/label/__name__/values"Responses
200
Label values.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
data
required
["__name__","job","instance"]status
required
success
400
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
403
The authenticated principal does not have permission to perform this action on the requested resource.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
422
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
503
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"data": [
"do_droplets_cpu_time",
"do_droplets_memory_free"
],
"status": "success"
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "forbidden",
"message": "You do not have permission to perform this action."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"id": "example_error",
"message": "some error message"
}GET Find series by label selectors
/v2/insights/query/{region}/prom/api/v1/series
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To find series matching one or more selectors, send a GET request to /v2/insights/query/{region}/prom/api/v1/series.
Path Parameters
region
required
nyc3The datacenter region slug for the query.
Query Parameters
match[]
required
["{__name__=\"do.droplets.cpu_time\"}"]One or more series selectors. At least one matcher is required. Repeat the parameter for multiple matchers.
start
optional
1620683817Optional start timestamp (inclusive). Accepts a RFC3339 string or a UNIX timestamp.
end
optional
1620705417Optional end timestamp (inclusive). Accepts a RFC3339 string or a UNIX timestamp.
Request: /v2/insights/query/{region}/prom/api/v1/series
curl -X GET \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
--get "https://api.digitalocean.com/v2/insights/query/nyc3/prom/api/v1/series" \
--data-urlencode 'match[]={__name__="do.droplets.cpu_time"}'Responses
200
Matching series label sets.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
data
required
status
required
success
400
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
403
The authenticated principal does not have permission to perform this action on the requested resource.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
422
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
503
Prometheus-style query error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
required
missing query parameterHuman-readable error message.
errorType
required
bad_dataPrometheus error category.
status
required
error
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"data": [
{
"__name__": "do_droplets_cpu_time"
}
],
"status": "success"
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "forbidden",
"message": "You do not have permission to perform this action."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"error": "missing query parameter",
"errorType": "bad_data",
"status": "error"
}{
"id": "example_error",
"message": "some error message"
}POST Search logs
/v2/insights/query/{region}/logs/search
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To search log records in a region, send a POST request to /v2/insights/query/{region}/logs/search with a JSON body describing the time range, optional filter, ordering, and pagination.
The time range must not exceed 7 days. pagination.limit defaults to 100 and is clamped to 1000. Cursor pagination requires ordering by timestamp alone; other sort orders return has_more: false and cannot be paged.
Path Parameters
region
required
nyc3The datacenter region slug for the query.
Request Body: application/json
filter
optional
A boolean filter tree for logs queries. Exactly one node is set per message.
Show child properties
and
optional
Show child properties
expressions
required
condition
optional
A single field comparison in a logs filter expression.
Show child properties
field
required
A reference to a logical field for filters, ordering, grouping, or facets.
Show child properties
name
required
service.nameThe field name. Intrinsic columns include timestamp, severity_text, severity_number, body, trace_id, span_id, and trace_flags. The dotted shorthands service.name, resource.type, and resource.urn are also supported. Arbitrary resource or log attributes can be accessed with ResourceAttributes['key'] or LogAttributes['key'].
scope
optional
FIELD_SCOPE_RESOURCEThe attribute scope to resolve the field against. Omit to let the server apply its default mapping for the field name.
operator
required
FILTER_OPERATOR_EQThe comparison operator.
value
optional
A typed literal or list value for a filter condition. Exactly one kind is set per message.
Show child properties
bool_value
optional
truenumber_array_value
optional
number_value
optional
42string_array_value
optional
string_value
optional
droplet-123not
optional
A boolean filter tree for logs queries. Exactly one node is set per message.
or
optional
Show child properties
expressions
required
text_search
optional
A substring search across the log body, service name, and resource URN.
Show child properties
query
required
errorThe search string.
order_by
optional
Sort clauses applied to the result set.
Show child properties
direction
optional
SORT_DIRECTION_DESCThe sort direction. Omit to use the server default.
field
required
A reference to a logical field for filters, ordering, grouping, or facets.
Show child properties
name
required
service.nameThe field name. Intrinsic columns include timestamp, severity_text, severity_number, body, trace_id, span_id, and trace_flags. The dotted shorthands service.name, resource.type, and resource.urn are also supported. Arbitrary resource or log attributes can be accessed with ResourceAttributes['key'] or LogAttributes['key'].
scope
optional
FIELD_SCOPE_RESOURCEThe attribute scope to resolve the field against. Omit to let the server apply its default mapping for the field name.
pagination
optional
Opaque keyset pagination request. Cursors are only valid when ordering by timestamp alone.
Show child properties
cursor
optional
eyJ0cyI6MTc1NjY4NDgwMDAwMDAwMDAwfQOpaque cursor from a previous response.
limit
optional
100Maximum number of results to return. Defaults to 100 and is clamped to 1000.
time_range
required
An inclusive query time window.
Show child properties
from
required
A single point in time. Exactly one value form is set per message.
Show child properties
absolute
optional
2026-09-01T00:00:00ZAn absolute timestamp. Accepts RFC3339/RFC3339Nano strings or Unix seconds/nanoseconds as decimal strings.
relative
optional
1hA relative time. Use now for the current time, a bare duration such as 1h or 7d to look back from now, or an offset such as now-1h or now+30m. Supported units are s, m, h, d, and w.
unix_nano
optional
1756684800000000000A Unix nanosecond timestamp, encoded as a string to preserve 64-bit precision.
to
required
A single point in time. Exactly one value form is set per message.
Show child properties
absolute
optional
2026-09-01T00:00:00ZAn absolute timestamp. Accepts RFC3339/RFC3339Nano strings or Unix seconds/nanoseconds as decimal strings.
relative
optional
1hA relative time. Use now for the current time, a bare duration such as 1h or 7d to look back from now, or an offset such as now-1h or now+30m. Supported units are s, m, h, d, and w.
unix_nano
optional
1756684800000000000A Unix nanosecond timestamp, encoded as a string to preserve 64-bit precision.
Request: /v2/insights/query/{region}/logs/search
{
"filter": {
"and": {
"expressions": []
},
"condition": {
"operator": "FILTER_OPERATOR_EQ"
},
"or": {
"expressions": []
},
"text_search": {
"query": "error"
}
},
"order_by": [
{
"direction": "SORT_DIRECTION_DESC"
}
],
"pagination": {
"cursor": "eyJ0cyI6MTc1NjY4NDgwMDAwMDAwMDAwfQ",
"limit": 100
},
"time_range": {
"from": {
"absolute": "2026-09-01T00:00:00Z",
"relative": "1h",
"unix_nano": "1756684800000000000"
},
"to": {
"absolute": "2026-09-01T00:00:00Z",
"relative": "1h",
"unix_nano": "1756684800000000000"
}
}
}curl -X POST \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"time_range": {
"from": {"absolute": "2026-09-30T00:00:00Z"},
"to": {"absolute": "2026-09-30T01:00:00Z"}
},
"filter": {
"condition": {
"field": {"name": "severity_text"},
"operator": "FILTER_OPERATOR_EQ",
"value": {"string_value": "Error"}
}
},
"order_by": [
{"field": {"name": "timestamp"}, "direction": "SORT_DIRECTION_DESC"}
],
"pagination": {"limit": 100}
}' \
"https://api.digitalocean.com/v2/insights/query/nyc3/logs/search"Responses
200
Logs search result.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
data
optional
Matching log records. Omitted when no records match.
Show child properties
attributes
optional
{"http.method":"GET","http.status_code":"504"}Log attributes.
body
optional
Connection timeoutThe log message body. Omitted when empty.
resource
optional
{"do.component":"droplet","do.droplet.id":"12345678"}Resource attributes associated with the log.
service_name
optional
api-gatewayThe service name that emitted the log.
severity_number
optional
17The numeric severity level.
severity_text
optional
ErrorThe textual severity level.
span_id
optional
def456The span ID if present.
timestamp
required
2026-09-01T00:00:00ZThe log record timestamp.
trace_id
optional
abc123The trace ID if present.
pagination
optional
Pagination response.
Show child properties
has_more
optional
trueWhether more results are available.
next_cursor
optional
eyJ0cyI6MTc1NjY4NDgwMDAwMDAwMDAwfQOpaque cursor to fetch the next page.
400
There was an error parsing the request body.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
403
The authenticated principal does not have permission to perform this action on the requested resource.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"data": [
{
"attributes": {
"http.method": "GET",
"http.status_code": "504"
},
"body": "Connection timeout",
"resource": {
"do.component": "droplet",
"do.droplet.id": "12345678"
},
"service_name": "api-gateway",
"severity_number": 17,
"severity_text": "Error",
"span_id": "def456",
"timestamp": "2026-09-01T00:00:00Z",
"trace_id": "abc123"
}
],
"pagination": {
"has_more": true,
"next_cursor": "eyJ0cyI6MTc1NjY4NDgwMDAwMDAwMDAwfQ"
}
}{
"id": "bad_request",
"message": "error parsing request body",
"request_id": "4851a473-1621-42ea-b2f9-5071c0ea8414"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "forbidden",
"message": "You do not have permission to perform this action."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}