Skip to main content
PUT
/
v1
/
projects
/
{project_id}
Update Project
const options = {
  method: 'PUT',
  headers: {
    'x-api-key': '<x-api-key>',
    'x-organization-id': '<x-organization-id>',
    'Content-Type': '<content-type>'
  },
  body: JSON.stringify({
    name: '<string>',
    description: '<string>',
    start_date: '<string>',
    end_date: '<string>',
    responsible_user_id: '<string>'
  })
};

fetch('https://api.dcycle.io/v1/projects/{project_id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "id": "<string>"
}

Update Project

Update an existing project’s information. You can modify any combination of the project’s fields.
Full Update: This endpoint uses PUT and expects all fields. Fields not included will be set to null. To perform a partial update, first retrieve the project with Get Project and include all existing values along with your changes.

Request

Headers

x-api-key
string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
x-organization-id
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa
Content-Type
string
required
Must be application/json
Accept-Language
string
default:"es"
Language for notifications and labelsAvailable values: es, en, fr, pt, de, it, ca

Path Parameters

project_id
string
required
The unique identifier (UUID) of the project to updateExample: 550e8400-e29b-41d4-a716-446655440000

Body Parameters

name
string
Updated project nameExample: "Carbon Footprint 2024 - Final"
description
string
Updated project descriptionExample: "Updated annual carbon footprint calculation"
start_date
string
Updated start date in YYYY-MM-DD formatExample: "2024-01-01"
end_date
string
Updated end date in YYYY-MM-DD format. Must be equal to or after start_date.Example: "2024-12-31"
responsible_user_id
string
UUID of the new responsible userExample: "user-uuid-002"

Response

Returns the updated project object.
id
string
Unique identifier (UUID)
See Get Project for the complete response schema.

Example

curl -X PUT "https://api.dcycle.io/v1/projects/550e8400-e29b-41d4-a716-446655440000" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Carbon Footprint 2024 - Final",
    "description": "Finalized annual carbon footprint",
    "start_date": "2024-01-01",
    "end_date": "2024-12-31",
    "responsible_user_id": "user-uuid-002"
  }'

Successful Response

Status Code: 200 OK
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "organization_id": "a8315ef3-dd50-43f8-b7ce-d839e68d51fa",
  "name": "Carbon Footprint 2024 - Final",
  "description": "Finalized annual carbon footprint",
  "start_date": "2024-01-01",
  "end_date": "2024-12-31",
  "due_date": "2025-03-31",
  "project_type": "carbon_footprint",
  "methodology": "gri",
  "responsible_user_id": "user-uuid-002",
  "responsible_user": {
    "id": "user-uuid-002",
    "email": "carlos@company.com",
    "first_name": "Carlos",
    "last_name": "Lopez"
  },
  "parent": null,
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-06-25T11:00:00Z"
}

Common Errors

401 Unauthorized

Cause: Missing or invalid API key
{
  "detail": "Invalid API key",
  "code": "INVALID_API_KEY"
}
Solution: Verify your API key is valid and active.

404 Not Found

Cause: Project not found or doesn’t belong to your organization
{
  "detail": "Project not found"
}
Solution: Verify the project ID exists and belongs to your organization.

422 Validation Error

Cause: Invalid field values
{
  "detail": [
    {
      "loc": ["body", "end_date"],
      "msg": "end_date must be equal to or after start_date",
      "type": "value_error"
    }
  ]
}
Solution: Check that end_date is equal to or after start_date.

Use Cases

Reassign Project Responsibility

Transfer a project to a different team member:
def reassign_project(project_id, new_user_id):
    """Reassign project to a different user"""
    # Get current project data
    response = requests.get(
        f"https://api.dcycle.io/v1/projects/{project_id}",
        headers=headers
    )
    project = response.json()

    # Update with new responsible user
    response = requests.put(
        f"https://api.dcycle.io/v1/projects/{project_id}",
        headers=headers,
        json={
            "name": project["name"],
            "description": project["description"],
            "start_date": project["start_date"],
            "end_date": project["end_date"],
            "responsible_user_id": new_user_id
        }
    )
    return response.json()

updated = reassign_project(
    "550e8400-e29b-41d4-a716-446655440000",
    "new-user-uuid"
)
print(f"New responsible: {updated['responsible_user']['email']}")

Extend Project Timeline

Update the project end date:
def extend_project(project_id, new_end_date):
    """Extend a project's end date"""
    response = requests.get(
        f"https://api.dcycle.io/v1/projects/{project_id}",
        headers=headers
    )
    project = response.json()

    response = requests.put(
        f"https://api.dcycle.io/v1/projects/{project_id}",
        headers=headers,
        json={
            "name": project["name"],
            "responsible_user_id": project["responsible_user_id"],
            "start_date": project["start_date"],
            "end_date": new_end_date
        }
    )
    return response.json()

updated = extend_project(
    "550e8400-e29b-41d4-a716-446655440000",
    "2025-06-30"
)
print(f"New end date: {updated['end_date']}")