pydo.projects.assign_resources()
Generated on 16 Feb 2026
from pydo version
v0.26.0
Description
To assign resources to a project, send a POST request to /v2/projects/$PROJECT_ID/resources.
You must have both project:update and <resource>:read scopes to assign new resources. For example, to assign a Droplet to a project, include both the project:update and droplet:read scopes.
Parameters
| Name | Type | Required | Description | Default Value |
|---|---|---|---|---|
project_id |
string | True | A unique identifier for a project. | |
body |
JSON or IO[bytes] | True |
Request Sample
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
req = {
"resources": [
"do:droplet:13457723",
"do:domain:example.com"
]
}
resp = client.projects.assign_resources(project_id="8dafda", body=req)More Information
See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.