[ Web Proxy ]
URL:
Viewing: https://docs.digitalocean.com/reference/pydo/reference/projects/assign_resources_default/ [Back]  [Original]

pydo.projects.assign_resources_default() | DigitalOcean Documentation

For AI agents: The documentation index is at https://docs.digitalocean.com/llms.txt. Markdown versions of pages use the same URL with index.html.md in place of the HTML page (for example, append index.html.md to the directory path instead of opening the HTML document).

pydo.projects.assign_resources_default()

Generated on 3 Aug 2026 from pydo version v0.40.0

Copy page as Markdown View page as Markdown

Usage

client.projects.assign_resources_default(
    body={
        "resources": [...],
    },
)
Returns JSONRaises HttpResponseError

Description

To assign resources to your default project, send a POST request to /v2/projects/default/resources.

You must have both project:assign_resource and <resource>:read scopes to assign new resources. For example, to assign a Droplet to the default project, include both the project:assign_resource and droplet:read scopes. The project:update scope also grants project:assign_resource.

Parameters

resources array of strings optional

Example: ['do:droplet:13457723']

A list of uniform resource names (URNs) to be added to a project. Only resources that you are authorized to see will be returned.

Request Sample

Show 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_default(body=req)

Response Example

Show Response Example
{
  "resources": [
    {
      "urn": "do:droplet:13457723",
      "assigned_at": "2018-09-28T19:26:37Z",
      "links": {
        "self": "https://api.digitalocean.com/v2/droplets/13457723"
      },
      "status": "ok"
    },
    {
      "urn": "do:domain:example.com",
      "assigned_at": "2019-03-31T16:24:14Z",
      "links": {
        "self": "https://api.digitalocean.com/v2/domains/example.com"
      },
      "status": "ok"
    }
  ]
}

More Information

See /v2/projects/default/resources in the API reference for additional detail on responses, headers, parameters, and more.

In this article...


We can't find any results for your search.

Try using different keywords or simplifying your search terms.


Web Proxy Viewer  |  New URL  |  Original Page