VPC Peerings
Validated on 7 Apr 2020 • Last edited on 23 Mar 2026
VPC Peerings join two VPC networks with a secure, private connection. This allows resources in those networks to connect to each other's private IP addresses as if they were in the same network.
https://api.digitalocean.com
Endpoints
GET List All VPC Peerings
/v2/vpc_peerings
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 of the VPC peerings on your account, send a GET request to /v2/vpc_peerings.
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:1region
optional
nyc3The slug identifier for the region where the resource is available.
Request: /v2/vpc_peerings
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/vpc_peerings?region=sfo3&page=1&per_page=20"Responses
200
The response will be a JSON object with a key called vpc_peerings. This will be set to an array of objects, each of which will contain the standard attributes associated with a VPC peering.
vpc_peerings. This will be set to an array of objects, each of which will contain the standard attributes associated with a VPC peering.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
vpc_peerings
optional
Show child properties
created_at
optional read-only
2020-03-13T19:20:47.442049222ZA time value given in ISO8601 combined date and time format.
id
optional read-only
5a4981aa-9653-4bd1-bef5-d6bff52042e4A unique ID that can be used to identify and reference the VPC peering.
status
optional read-only
ACTIVEThe current status of the VPC peering.
vpc_ids
optional
["c140286f-e6ce-4131-8b7b-df4590ce8d6a","994a2735-dc84-11e8-80bc-3cfdfea9fba1"]An array of the two peered VPCs IDs.
name
optional
nyc1-blr1-peeringThe name of the VPC peering. Must be unique within the team and may only contain alphanumeric characters and dashes.
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.
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
{
"links": {},
"meta": {
"total": 2
},
"vpc_peerings": [
{
"created_at": "2024-01-09T20:44:32Z",
"id": "6b5c619c-359c-44ca-87e2-47e98170c01d",
"name": "example-vpc-peering",
"status": "ACTIVE",
"vpc_ids": [
"997615ce-132d-4bae-9270-9ee21b395e5d",
"e51aed59-3bb1-4a6a-8de0-9d1329e9c997"
]
},
{
"created_at": "2024-01-10T13:29:58Z",
"id": "c212b274-911c-44cc-a117-23b7da4a2922",
"name": "another-vpc-peering",
"status": "ACTIVE",
"vpc_ids": [
"5a100736-b085-4f69-81fd-feee325784bb",
"c140286f-e6ce-4131-8b7b-df4590ce8d6a"
]
}
]
}{
"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"
}POST Create a New VPC Peering
/v2/vpc_peerings
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 new VPC Peering, send a POST request to /v2/vpc_peerings
specifying a name and a list of two VPC IDs to peer. The response code, 202
Accepted, does not indicate the success or failure of the operation, just
that the request has been accepted for processing.
Request Body: application/json
name
optional
nyc1-blr1-peeringThe name of the VPC peering. Must be unique within the team and may only contain alphanumeric characters and dashes.
vpc_ids
optional
["c140286f-e6ce-4131-8b7b-df4590ce8d6a","994a2735-dc84-11e8-80bc-3cfdfea9fba1"]An array of the two peered VPCs IDs.
Request: /v2/vpc_peerings
{
"name": "nyc1-blr1-peering",
"vpc_ids": [
"c140286f-e6ce-4131-8b7b-df4590ce8d6a",
"994a2735-dc84-11e8-80bc-3cfdfea9fba1"
]
}curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"name": "my-first-vpc-peering", "vpc_ids": [ "997615ce-132d-4bae-9270-9ee21b395e5d", "e51aed59-3bb1-4a6a-8de0-9d1329e9c997"]}' \
"https://api.digitalocean.com/v2/vpc_peerings"Responses
202
The response will be a JSON object with a key called vpc_peering. The value of this will be an object that contains the standard attributes associated with a VPC peering.
vpc_peering. The value of this will be an object that contains the standard attributes associated with a VPC peering.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
vpc_peering
optional
Show child properties
created_at
optional read-only
2020-03-13T19:20:47.442049222ZA time value given in ISO8601 combined date and time format.
id
optional read-only
5a4981aa-9653-4bd1-bef5-d6bff52042e4A unique ID that can be used to identify and reference the VPC peering.
status
optional read-only
ACTIVEThe current status of the VPC peering.
vpc_ids
optional
["c140286f-e6ce-4131-8b7b-df4590ce8d6a","994a2735-dc84-11e8-80bc-3cfdfea9fba1"]An array of the two peered VPCs IDs.
name
optional
nyc1-blr1-peeringThe name of the VPC peering. Must be unique within the team and may only contain alphanumeric characters and dashes.
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
{
"vpc_peering": {
"created_at": "2024-01-09T20:44:32Z",
"id": "5a4981aa-9653-4bd1-bef5-d6bff52042e4",
"name": "example-vpc-peering",
"status": "PROVISIONING",
"vpc_ids": [
"997615ce-132d-4bae-9270-9ee21b395e5d",
"e51aed59-3bb1-4a6a-8de0-9d1329e9c997"
]
}
}{
"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 Existing VPC Peering
/v2/vpc_peerings/{vpc_peering_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 show information about an existing VPC Peering, send a GET request to /v2/vpc_peerings/$VPC_PEERING_ID.
Path Parameters
vpc_peering_id
required
5a4981aa-9653-4bd1-bef5-d6bff52042e4A unique identifier for a VPC peering.
Request: /v2/vpc_peerings/{vpc_peering_id}
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/vpc_peerings/5a4981aa-9653-4bd1-bef5-d6bff52042e4"Responses
200
The response will be a JSON object with a key called vpc_peering. The value of this will be an object that contains the standard attributes associated with a VPC peering.
vpc_peering. The value of this will be an object that contains the standard attributes associated with a VPC peering.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
vpc_peering
optional
Show child properties
created_at
optional read-only
2020-03-13T19:20:47.442049222ZA time value given in ISO8601 combined date and time format.
id
optional read-only
5a4981aa-9653-4bd1-bef5-d6bff52042e4A unique ID that can be used to identify and reference the VPC peering.
status
optional read-only
ACTIVEThe current status of the VPC peering.
vpc_ids
optional
["c140286f-e6ce-4131-8b7b-df4590ce8d6a","994a2735-dc84-11e8-80bc-3cfdfea9fba1"]An array of the two peered VPCs IDs.
name
optional
nyc1-blr1-peeringThe name of the VPC peering. Must be unique within the team and may only contain alphanumeric characters and dashes.
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
{
"vpc_peering": {
"created_at": "2024-01-09T20:44:32Z",
"id": "5a4981aa-9653-4bd1-bef5-d6bff52042e4",
"name": "example-vpc-peering",
"status": "ACTIVE",
"vpc_ids": [
"997615ce-132d-4bae-9270-9ee21b395e5d",
"e51aed59-3bb1-4a6a-8de0-9d1329e9c997"
]
}
}{
"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"
}PATCH Update a VPC peering
/v2/vpc_peerings/{vpc_peering_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 the name of a VPC peering, send a PATCH request to /v2/vpc_peerings/$VPC_PEERING_ID with the new name in the request body.
Path Parameters
vpc_peering_id
required
5a4981aa-9653-4bd1-bef5-d6bff52042e4A unique identifier for a VPC peering.
Request Body: application/json
name
optional
nyc1-blr1-peeringThe name of the VPC peering. Must be unique within the team and may only contain alphanumeric characters and dashes.
Request: /v2/vpc_peerings/{vpc_peering_id}
{
"name": "nyc1-blr1-peering"
}curl -X PATCH \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"name":"renamed-vpc-peering"}' \
"https://api.digitalocean.com/v2/vpc_peerings/5a4981aa-9653-4bd1-bef5-d6bff52042e4"Responses
200
The response will be a JSON object with a key called vpc_peering. The value of this will be an object that contains the standard attributes associated with a VPC peering.
vpc_peering. The value of this will be an object that contains the standard attributes associated with a VPC peering.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
vpc_peering
optional
Show child properties
created_at
optional read-only
2020-03-13T19:20:47.442049222ZA time value given in ISO8601 combined date and time format.
id
optional read-only
5a4981aa-9653-4bd1-bef5-d6bff52042e4A unique ID that can be used to identify and reference the VPC peering.
status
optional read-only
ACTIVEThe current status of the VPC peering.
vpc_ids
optional
["c140286f-e6ce-4131-8b7b-df4590ce8d6a","994a2735-dc84-11e8-80bc-3cfdfea9fba1"]An array of the two peered VPCs IDs.
name
optional
nyc1-blr1-peeringThe name of the VPC peering. Must be unique within the team and may only contain alphanumeric characters and dashes.
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
{
"vpc_peering": {
"created_at": "2024-01-09T20:44:32Z",
"id": "5a4981aa-9653-4bd1-bef5-d6bff52042e4",
"name": "example-vpc-peering",
"status": "ACTIVE",
"vpc_ids": [
"997615ce-132d-4bae-9270-9ee21b395e5d",
"e51aed59-3bb1-4a6a-8de0-9d1329e9c997"
]
}
}{
"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 VPC peering
/v2/vpc_peerings/{vpc_peering_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 VPC peering, send a DELETE request to /v2/vpc_peerings/$VPC_PEERING_ID.
Path Parameters
vpc_peering_id
required
5a4981aa-9653-4bd1-bef5-d6bff52042e4A unique identifier for a VPC peering.
Request: /v2/vpc_peerings/{vpc_peering_id}
curl -X DELETE \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/vpc_peerings/6b5c619c-359c-44ca-87e2-47e98170c01d"Responses
202
The response will be a JSON object with a key called vpc_peering. The value of this will be an object that contains the standard attributes associated with a VPC peering.
vpc_peering. The value of this will be an object that contains the standard attributes associated with a VPC peering.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
vpc_peering
optional
Show child properties
created_at
optional read-only
2020-03-13T19:20:47.442049222ZA time value given in ISO8601 combined date and time format.
id
optional read-only
5a4981aa-9653-4bd1-bef5-d6bff52042e4A unique ID that can be used to identify and reference the VPC peering.
status
optional read-only
ACTIVEThe current status of the VPC peering.
vpc_ids
optional
["c140286f-e6ce-4131-8b7b-df4590ce8d6a","994a2735-dc84-11e8-80bc-3cfdfea9fba1"]An array of the two peered VPCs IDs.
name
optional
nyc1-blr1-peeringThe name of the VPC peering. Must be unique within the team and may only contain alphanumeric characters and dashes.
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
{
"vpc_peering": {
"created_at": "2024-01-09T20:44:32Z",
"id": "5a4981aa-9653-4bd1-bef5-d6bff52042e4",
"name": "example-vpc-peering",
"status": "DELETING",
"vpc_ids": [
"997615ce-132d-4bae-9270-9ee21b395e5d",
"e51aed59-3bb1-4a6a-8de0-9d1329e9c997"
]
}
}{
"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"
}