API: Activities

Local Properties

Property Description Type Constraints Supported operations
id Activity id Integer x > 0 READ
version Activity version Integer x > 0 READ
comment Formattable READ / WRITE
details Array of Formattable READ
createdAt Time of creation DateTime READ
updatedAt Time of update DateTime READ

Activity can be either _type Activity or _type Activity::Comment.

Methods

Get an activity

Returns the requested activity resource identified by its unique id.

id
integer

required path

Activity id

Example:
1

200

OK

{
  "_type": "Activity::Comment",
  "id": 1478,
  "comment": {
    "format": "markdown",
    "raw": "I can give you a CR70 corvette, you have to make do, Leia...",
    "html": "<p class=\"op-uc-p\">I can give you a CR70 corvette, you have to make do, Leia...</p>"
  },
  "details": [],
  "version": 4,
  "internal": false,
  "createdAt": "2025-04-17T13:54:40.737Z",
  "updatedAt": "2025-04-17T13:54:40.737Z",
  "_embedded": {
    "attachments": {
      "_type": "Collection",
      "total": 1,
      "count": 1,
      "_hint": "Attachments resource shortened for brevity."
    },
    "workPackage": {
      "id": 207,
      "_type": "WorkPackage",
      "_hint": "Work package resource shortened for brevity."
    }
  },
  "_links": {
    "attachments": {
      "href": "/api/v3/activities/1478/attachments"
    },
    "addAttachment": {
      "href": "/api/v3/activities/1478/attachments",
      "method": "post"
    },
    "self": {
      "href": "/api/v3/activities/1478"
    },
    "workPackage": {
      "href": "/api/v3/work_packages/207",
      "title": "Recover Death Star blueprints"
    },
    "user": {
      "href": "/api/v3/users/33"
    },
    "update": {
      "href": "/api/v3/activities/1478",
      "method": "patch"
    }
  }
}
ActivityModel
{
  "type": "object",
  "properties": {
    "_type": {
      "type": "string",
      "enum": [
        "Activity::Comment"
      ]
    },
    "id": {
      "type": "integer",
      "description": "Activity id",
      "minimum": 1
    },
    "version": {
      "type": "integer",
      "description": "Activity version",
      "minimum": 1
    },
    "comment": {
      "$ref": "#/components/schemas/Formattable"
    },
    "details": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Formattable"
      }
    },
    "internal": {
      "type": "boolean",
      "description": "Whether this activity is internal (only visible to users with view_internal_comments permission)"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Time of creation"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Time of update"
    },
    "_embedded": {
      "type": "object",
      "properties": {
        "attachments": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Attachments_Model"
            },
            {
              "description": "Collection of attachments for this activity"
            }
          ]
        },
        "workPackage": {
          "allOf": [
            {
              "$ref": "#/components/schemas/WorkPackageModel"
            },
            {
              "description": "The work package this activity belongs to\n\n# Conditions\n\nOnly embedded when the `journable` of the activity is a work package"
            }
          ]
        }
      }
    },
    "_links": {
      "type": "object",
      "properties": {
        "self": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "This activity\n\n**Resource**: Activity"
            }
          ]
        },
        "workPackage": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "The work package this activity belongs to\n\n**Resource**: WorkPackage"
            }
          ]
        },
        "user": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "The user who created this activity\n\n**Resource**: Principal"
            }
          ]
        },
        "update": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "Update this activity"
            }
          ]
        },
        "attachments": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "The attachment collection of this activity\n\n**Resource**: Attachments"
            }
          ]
        },
        "addAttachment": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "Attach a file to the activity\n\n# Conditions\n\n**Permissions**:\n- `add_work_package_comments`\n- for internal comments: `add_internal_comments`"
            }
          ]
        }
      }
    }
  },
  "example": {
    "id": 1,
    "_type": "Activity::Comment",
    "_embedded": {
      "attachments": {
        "_type": "Collection",
        "total": 1,
        "count": 1,
        "_embedded": {
          "elements": [
            {
              "_type": "Attachment",
              "id": 30388,
              "fileName": "Task_Ensure_financing___4___OpenProject_DEV.jpeg",
              "fileSize": 540992,
              "description": {
                "format": "plain",
                "raw": "",
                "html": ""
              },
              "status": "uploaded",
              "contentType": "image/jpeg",
              "digest": {
                "algorithm": "md5",
                "hash": "d02d312b25383b595a9fa10f1a8999fe"
              },
              "createdAt": "2025-04-08T15:37:19.275Z",
              "_links": {
                "self": {
                  "href": "/api/v3/attachments/30388",
                  "title": "Task_Ensure_financing___4___OpenProject_DEV.jpeg"
                },
                "author": {
                  "href": "/api/v3/users/435",
                  "title": "Firstname"
                },
                "container": {
                  "href": "/api/v3/activities/79090"
                },
                "staticDownloadLocation": {
                  "href": "/api/v3/attachments/30388/content"
                },
                "downloadLocation": {
                  "href": "/api/v3/attachments/30388/content"
                },
                "delete": {
                  "href": "/api/v3/attachments/30388",
                  "method": "delete"
                }
              }
            }
          ]
        },
        "_links": {
          "self": {
            "href": "/api/v3/activities/79090/attachments"
          }
        }
      },
      "workPackage": {
        "_type": "WorkPackage",
        "id": 10403,
        "lockVersion": 2,
        "subject": "Ensure financing",
        "description": {
          "format": "markdown",
          "raw": "Lorem ipsum dolor sit amet.",
          "html": "<p>Lorem ipsum dolor sit amet.</p>"
        },
        "scheduleManually": true,
        "startDate": null,
        "dueDate": null,
        "derivedStartDate": null,
        "derivedDueDate": null,
        "estimatedTime": null,
        "derivedEstimatedTime": null,
        "derivedRemainingTime": null,
        "duration": null,
        "ignoreNonWorkingDays": false,
        "percentageDone": null,
        "derivedPercentageDone": null,
        "createdAt": "2025-03-24T13:11:09.480Z",
        "updatedAt": "2025-04-14T11:00:02.411Z",
        "_links": {
          "self": {
            "href": "/api/v3/work_packages/10403",
            "title": "Ensure financing"
          },
          "type": {
            "href": "/api/v3/types/1",
            "title": "Task"
          },
          "status": {
            "href": "/api/v3/statuses/1",
            "title": "New"
          },
          "project": {
            "href": "/api/v3/projects/918",
            "title": "RVC Test"
          }
        }
      }
    },
    "_links": {
      "self": {
        "href": "/api/v3/activity/1",
        "title": "Priority changed from High to Low"
      },
      "workPackage": {
        "href": "/api/v3/work_packages/1",
        "title": "quis numquam qui voluptatum quia praesentium blanditiis nisi"
      },
      "user": {
        "href": "/api/v3/users/1",
        "title": "John Sheppard - admin"
      },
      "attachments": {
        "href": "/api/v3/activities/1/attachments"
      },
      "addAttachment": {
        "href": "/api/v3/activities/1/attachments",
        "method": "post"
      },
      "update": {
        "href": "/api/v3/activities/1",
        "method": "patch"
      }
    },
    "details": [
      {
        "format": "markdown",
        "raw": "Lorem ipsum dolor sit amet.",
        "html": "<p>Lorem ipsum dolor sit amet.</p>"
      }
    ],
    "comment": {
      "format": "markdown",
      "raw": "Lorem ipsum dolor sit amet.",
      "html": "<p>Lorem ipsum dolor sit amet.</p>"
    },
    "createdAt": "2014-05-21T08:51:20.721Z",
    "updatedAt": "2014-05-21T09:14:02.929Z",
    "version": 31
  }
}

Update activity

Updates an activity’s comment and, on success, returns the updated activity.

id
integer

required path

Activity id

Example:
1

{
  "comment": {
    "type": "string"
  }
}

200

OK

{
  "_type": "Activity::Comment",
  "id": 1478,
  "comment": {
    "format": "markdown",
    "raw": "I can give you a CR70 corvette, you have to make do, Leia...",
    "html": "<p class=\"op-uc-p\">I can give you a CR70 corvette, you have to make do, Leia...</p>"
  },
  "details": [],
  "version": 4,
  "internal": false,
  "createdAt": "2025-04-17T13:54:40.737Z",
  "updatedAt": "2025-04-17T13:54:40.737Z",
  "_embedded": {
    "attachments": {
      "_type": "Collection",
      "total": 1,
      "count": 1,
      "_hint": "Attachments resource shortened for brevity."
    },
    "workPackage": {
      "id": 207,
      "_type": "WorkPackage",
      "_hint": "Work package resource shortened for brevity."
    }
  },
  "_links": {
    "attachments": {
      "href": "/api/v3/activities/1478/attachments"
    },
    "addAttachment": {
      "href": "/api/v3/activities/1478/attachments",
      "method": "post"
    },
    "self": {
      "href": "/api/v3/activities/1478"
    },
    "workPackage": {
      "href": "/api/v3/work_packages/207",
      "title": "Recover Death Star blueprints"
    },
    "user": {
      "href": "/api/v3/users/33"
    },
    "update": {
      "href": "/api/v3/activities/1478",
      "method": "patch"
    }
  }
}
ActivityModel
{
  "type": "object",
  "properties": {
    "_type": {
      "type": "string",
      "enum": [
        "Activity::Comment"
      ]
    },
    "id": {
      "type": "integer",
      "description": "Activity id",
      "minimum": 1
    },
    "version": {
      "type": "integer",
      "description": "Activity version",
      "minimum": 1
    },
    "comment": {
      "$ref": "#/components/schemas/Formattable"
    },
    "details": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Formattable"
      }
    },
    "internal": {
      "type": "boolean",
      "description": "Whether this activity is internal (only visible to users with view_internal_comments permission)"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Time of creation"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Time of update"
    },
    "_embedded": {
      "type": "object",
      "properties": {
        "attachments": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Attachments_Model"
            },
            {
              "description": "Collection of attachments for this activity"
            }
          ]
        },
        "workPackage": {
          "allOf": [
            {
              "$ref": "#/components/schemas/WorkPackageModel"
            },
            {
              "description": "The work package this activity belongs to\n\n# Conditions\n\nOnly embedded when the `journable` of the activity is a work package"
            }
          ]
        }
      }
    },
    "_links": {
      "type": "object",
      "properties": {
        "self": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "This activity\n\n**Resource**: Activity"
            }
          ]
        },
        "workPackage": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "The work package this activity belongs to\n\n**Resource**: WorkPackage"
            }
          ]
        },
        "user": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "The user who created this activity\n\n**Resource**: Principal"
            }
          ]
        },
        "update": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "Update this activity"
            }
          ]
        },
        "attachments": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "The attachment collection of this activity\n\n**Resource**: Attachments"
            }
          ]
        },
        "addAttachment": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "Attach a file to the activity\n\n# Conditions\n\n**Permissions**:\n- `add_work_package_comments`\n- for internal comments: `add_internal_comments`"
            }
          ]
        }
      }
    }
  },
  "example": {
    "id": 1,
    "_type": "Activity::Comment",
    "_embedded": {
      "attachments": {
        "_type": "Collection",
        "total": 1,
        "count": 1,
        "_embedded": {
          "elements": [
            {
              "_type": "Attachment",
              "id": 30388,
              "fileName": "Task_Ensure_financing___4___OpenProject_DEV.jpeg",
              "fileSize": 540992,
              "description": {
                "format": "plain",
                "raw": "",
                "html": ""
              },
              "status": "uploaded",
              "contentType": "image/jpeg",
              "digest": {
                "algorithm": "md5",
                "hash": "d02d312b25383b595a9fa10f1a8999fe"
              },
              "createdAt": "2025-04-08T15:37:19.275Z",
              "_links": {
                "self": {
                  "href": "/api/v3/attachments/30388",
                  "title": "Task_Ensure_financing___4___OpenProject_DEV.jpeg"
                },
                "author": {
                  "href": "/api/v3/users/435",
                  "title": "Firstname"
                },
                "container": {
                  "href": "/api/v3/activities/79090"
                },
                "staticDownloadLocation": {
                  "href": "/api/v3/attachments/30388/content"
                },
                "downloadLocation": {
                  "href": "/api/v3/attachments/30388/content"
                },
                "delete": {
                  "href": "/api/v3/attachments/30388",
                  "method": "delete"
                }
              }
            }
          ]
        },
        "_links": {
          "self": {
            "href": "/api/v3/activities/79090/attachments"
          }
        }
      },
      "workPackage": {
        "_type": "WorkPackage",
        "id": 10403,
        "lockVersion": 2,
        "subject": "Ensure financing",
        "description": {
          "format": "markdown",
          "raw": "Lorem ipsum dolor sit amet.",
          "html": "<p>Lorem ipsum dolor sit amet.</p>"
        },
        "scheduleManually": true,
        "startDate": null,
        "dueDate": null,
        "derivedStartDate": null,
        "derivedDueDate": null,
        "estimatedTime": null,
        "derivedEstimatedTime": null,
        "derivedRemainingTime": null,
        "duration": null,
        "ignoreNonWorkingDays": false,
        "percentageDone": null,
        "derivedPercentageDone": null,
        "createdAt": "2025-03-24T13:11:09.480Z",
        "updatedAt": "2025-04-14T11:00:02.411Z",
        "_links": {
          "self": {
            "href": "/api/v3/work_packages/10403",
            "title": "Ensure financing"
          },
          "type": {
            "href": "/api/v3/types/1",
            "title": "Task"
          },
          "status": {
            "href": "/api/v3/statuses/1",
            "title": "New"
          },
          "project": {
            "href": "/api/v3/projects/918",
            "title": "RVC Test"
          }
        }
      }
    },
    "_links": {
      "self": {
        "href": "/api/v3/activity/1",
        "title": "Priority changed from High to Low"
      },
      "workPackage": {
        "href": "/api/v3/work_packages/1",
        "title": "quis numquam qui voluptatum quia praesentium blanditiis nisi"
      },
      "user": {
        "href": "/api/v3/users/1",
        "title": "John Sheppard - admin"
      },
      "attachments": {
        "href": "/api/v3/activities/1/attachments"
      },
      "addAttachment": {
        "href": "/api/v3/activities/1/attachments",
        "method": "post"
      },
      "update": {
        "href": "/api/v3/activities/1",
        "method": "patch"
      }
    },
    "details": [
      {
        "format": "markdown",
        "raw": "Lorem ipsum dolor sit amet.",
        "html": "<p>Lorem ipsum dolor sit amet.</p>"
      }
    ],
    "comment": {
      "format": "markdown",
      "raw": "Lorem ipsum dolor sit amet.",
      "html": "<p>Lorem ipsum dolor sit amet.</p>"
    },
    "createdAt": "2014-05-21T08:51:20.721Z",
    "updatedAt": "2014-05-21T09:14:02.929Z",
    "version": 31
  }
}

400

Occurs when the client did not send a valid JSON object in the request body.

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:InvalidRequestBody",
  "message": "The request body was not a single JSON object."
}
ErrorResponse
{
  "type": "object",
  "required": [
    "_type",
    "errorIdentifier",
    "message"
  ],
  "properties": {
    "_embedded": {
      "type": "object",
      "properties": {
        "details": {
          "type": "object",
          "properties": {
            "attribute": {
              "type": "string",
              "example": "project"
            }
          }
        }
      }
    },
    "_type": {
      "type": "string",
      "enum": [
        "Error"
      ]
    },
    "errorIdentifier": {
      "type": "string",
      "example": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation"
    },
    "message": {
      "type": "string",
      "example": "Project can't be blank."
    }
  }
}

403

Returned if the client does not have sufficient permissions.

Required permission: edit journals

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:MissingPermission",
  "message": "You are not allowed to edit the comment of this journal entry."
}
ErrorResponse
{
  "type": "object",
  "required": [
    "_type",
    "errorIdentifier",
    "message"
  ],
  "properties": {
    "_embedded": {
      "type": "object",
      "properties": {
        "details": {
          "type": "object",
          "properties": {
            "attribute": {
              "type": "string",
              "example": "project"
            }
          }
        }
      }
    },
    "_type": {
      "type": "string",
      "enum": [
        "Error"
      ]
    },
    "errorIdentifier": {
      "type": "string",
      "example": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation"
    },
    "message": {
      "type": "string",
      "example": "Project can't be blank."
    }
  }
}

406

Occurs when the client did not send a Content-Type header

"Missing content-type header"
{
  "type": "string"
}

415

Occurs when the client sends an unsupported Content-Type header.

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:TypeNotSupported",
  "message": "Expected CONTENT-TYPE to be (expected value) but got (actual value)."
}
ErrorResponse
{
  "type": "object",
  "required": [
    "_type",
    "errorIdentifier",
    "message"
  ],
  "properties": {
    "_embedded": {
      "type": "object",
      "properties": {
        "details": {
          "type": "object",
          "properties": {
            "attribute": {
              "type": "string",
              "example": "project"
            }
          }
        }
      }
    },
    "_type": {
      "type": "string",
      "enum": [
        "Error"
      ]
    },
    "errorIdentifier": {
      "type": "string",
      "example": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation"
    },
    "message": {
      "type": "string",
      "example": "Project can't be blank."
    }
  }
}

422

Returned if the client tries to modify a read-only property.

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:PropertyIsReadOnly",
  "message": "The ID of an activity can't be changed."
}
ErrorResponse
{
  "type": "object",
  "required": [
    "_type",
    "errorIdentifier",
    "message"
  ],
  "properties": {
    "_embedded": {
      "type": "object",
      "properties": {
        "details": {
          "type": "object",
          "properties": {
            "attribute": {
              "type": "string",
              "example": "project"
            }
          }
        }
      }
    },
    "_type": {
      "type": "string",
      "enum": [
        "Error"
      ]
    },
    "errorIdentifier": {
      "type": "string",
      "example": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation"
    },
    "message": {
      "type": "string",
      "example": "Project can't be blank."
    }
  }
}

List attachments by activity

List all attachments of a single activity.

id
integer

required path

ID of the activity whose attachments will be listed

Example:
1

200

OK

Attachments_Model
{
  "allOf": [
    {
      "$ref": "#/components/schemas/CollectionModel"
    },
    {
      "type": "object",
      "required": [
        "_links",
        "_embedded"
      ],
      "properties": {
        "_links": {
          "type": "object",
          "required": [
            "self"
          ],
          "properties": {
            "self": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Link"
                },
                {
                  "description": "The attachments collection\n\n**Resource**: AttachmentsCollection",
                  "readOnly": true
                }
              ]
            }
          }
        },
        "_embedded": {
          "type": "object",
          "properties": {
            "elements": {
              "type": "array",
              "readOnly": true,
              "items": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/AttachmentModel"
                  },
                  {
                    "description": "Collection of Attachments"
                  }
                ]
              }
            }
          }
        }
      }
    }
  ]
}

404

Returned if the activity does not exist or the client does not have sufficient permissions to see it.

Required permission:

  • view_work_packages
  • for internal comments: view_internal_comments

Note: A client without sufficient permissions shall not be able to test for the existence of an activity. That’s why a 404 is returned here, even if a 403 might be more appropriate.

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:NotFound",
  "message": "The requested resource could not be found."
}
ErrorResponse
{
  "type": "object",
  "required": [
    "_type",
    "errorIdentifier",
    "message"
  ],
  "properties": {
    "_embedded": {
      "type": "object",
      "properties": {
        "details": {
          "type": "object",
          "properties": {
            "attribute": {
              "type": "string",
              "example": "project"
            }
          }
        }
      }
    },
    "_type": {
      "type": "string",
      "enum": [
        "Error"
      ]
    },
    "errorIdentifier": {
      "type": "string",
      "example": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation"
    },
    "message": {
      "type": "string",
      "example": "Project can't be blank."
    }
  }
}

Add attachment to activity

Adds an attachment to the specified activity.

id
integer

required path

ID of the activity to receive the attachment

Example:
1

{
  "metadata": {
    "type": "object",
    "properties": {
      "fileName": {
        "type": "string"
      }
    }
  },
  "file": {
    "type": "string",
    "format": "binary"
  }
}

200

OK

AttachmentModel
{
  "type": "object",
  "required": [
    "title",
    "fileName",
    "description",
    "contentType",
    "digest",
    "createdAt"
  ],
  "properties": {
    "id": {
      "type": "integer",
      "description": "Attachment's id",
      "minimum": 1
    },
    "title": {
      "type": "string",
      "description": "The name of the file"
    },
    "fileName": {
      "type": "string",
      "description": "The name of the uploaded file"
    },
    "fileSize": {
      "type": "integer",
      "description": "The size of the uploaded file in Bytes",
      "minimum": 0
    },
    "description": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Formattable"
        },
        {
          "description": "A user provided description of the file"
        }
      ]
    },
    "contentType": {
      "type": "string",
      "description": "The files MIME-Type as determined by the server"
    },
    "digest": {
      "type": "string",
      "description": "A checksum for the files content"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Time of creation"
    },
    "_links": {
      "type": "object",
      "required": [
        "self",
        "container",
        "author",
        "downloadLocation"
      ],
      "properties": {
        "delete": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "Deletes this attachment\n\n# Conditions\n\n**Permission**: edit on attachment container or being the author for attachments without container"
            }
          ]
        },
        "self": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "This attachment\n\n**Resource**: Attachment"
            }
          ]
        },
        "container": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "The object (e.g. WorkPackage) housing the attachment\n\n**Resource**: Anything"
            }
          ]
        },
        "author": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "The user who uploaded the attachment\n\n**Resource**: User"
            }
          ]
        },
        "downloadLocation": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "Direct download link to the attachment\n\n**Resource**: -"
            }
          ]
        }
      }
    }
  },
  "example": {
    "_type": "Attachment",
    "_links": {
      "self": {
        "href": "/api/v3/attachments/1"
      },
      "container": {
        "href": "/api/v3/work_packages/1"
      },
      "author": {
        "href": "/api/v3/users/1"
      },
      "staticDownloadLocation": {
        "href": "/api/v3/attachments/1/content"
      },
      "downloadLocation": {
        "href": "/some/remote/aws/url/image.png"
      }
    },
    "id": 1,
    "fileName": "cat.png",
    "filesize": 24,
    "description": {
      "format": "plain",
      "raw": "A picture of a cute cat",
      "html": "<p>A picture of a cute cat</p>"
    },
    "contentType": "image/png",
    "digest": {
      "algorithm": "md5",
      "hash": "64c26a8403cd796ea4cf913cda2ee4a9"
    },
    "createdAt": "2014-05-21T08:51:20.396Z"
  }
}

400

Returned if the client sends a not understandable request. Reasons include:

  • Omitting one of the required parts (metadata and file)

  • sending unparsable JSON in the metadata part

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:InvalidRequestBody",
  "message": "The request could not be parsed as JSON."
}
ErrorResponse
{
  "type": "object",
  "required": [
    "_type",
    "errorIdentifier",
    "message"
  ],
  "properties": {
    "_embedded": {
      "type": "object",
      "properties": {
        "details": {
          "type": "object",
          "properties": {
            "attribute": {
              "type": "string",
              "example": "project"
            }
          }
        }
      }
    },
    "_type": {
      "type": "string",
      "enum": [
        "Error"
      ]
    },
    "errorIdentifier": {
      "type": "string",
      "example": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation"
    },
    "message": {
      "type": "string",
      "example": "Project can't be blank."
    }
  }
}

403

Returned if the client does not have sufficient permissions.

Required permission: view_work_packages or view_internal_comments (for internal comments)

Note that you will only receive this error, if you are at least allowed to see the activity

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:MissingPermission",
  "message": "You are not allowed to add attachments to this activity."
}
ErrorResponse
{
  "type": "object",
  "required": [
    "_type",
    "errorIdentifier",
    "message"
  ],
  "properties": {
    "_embedded": {
      "type": "object",
      "properties": {
        "details": {
          "type": "object",
          "properties": {
            "attribute": {
              "type": "string",
              "example": "project"
            }
          }
        }
      }
    },
    "_type": {
      "type": "string",
      "enum": [
        "Error"
      ]
    },
    "errorIdentifier": {
      "type": "string",
      "example": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation"
    },
    "message": {
      "type": "string",
      "example": "Project can't be blank."
    }
  }
}

404

Returned if the activity does not exist or the client does not have sufficient permissions to see it.

Required permission: view_work_packages or view_internal_comments (for internal comments)

Note: A client without sufficient permissions shall not be able to test for the existence of an activity. That’s why a 404 is returned here, even if a 403 might be more appropriate.

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:NotFound",
  "message": "The requested resource could not be found."
}
ErrorResponse
{
  "type": "object",
  "required": [
    "_type",
    "errorIdentifier",
    "message"
  ],
  "properties": {
    "_embedded": {
      "type": "object",
      "properties": {
        "details": {
          "type": "object",
          "properties": {
            "attribute": {
              "type": "string",
              "example": "project"
            }
          }
        }
      }
    },
    "_type": {
      "type": "string",
      "enum": [
        "Error"
      ]
    },
    "errorIdentifier": {
      "type": "string",
      "example": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation"
    },
    "message": {
      "type": "string",
      "example": "Project can't be blank."
    }
  }
}

406

Occurs when the client did not send a Content-Type header

"Missing content-type header"
{
  "type": "string"
}

415

Occurs when the client sends an unsupported Content-Type header.

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:TypeNotSupported",
  "message": "Expected CONTENT-TYPE to be (expected value) but got (actual value)."
}
ErrorResponse
{
  "type": "object",
  "required": [
    "_type",
    "errorIdentifier",
    "message"
  ],
  "properties": {
    "_embedded": {
      "type": "object",
      "properties": {
        "details": {
          "type": "object",
          "properties": {
            "attribute": {
              "type": "string",
              "example": "project"
            }
          }
        }
      }
    },
    "_type": {
      "type": "string",
      "enum": [
        "Error"
      ]
    },
    "errorIdentifier": {
      "type": "string",
      "example": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation"
    },
    "message": {
      "type": "string",
      "example": "Project can't be blank."
    }
  }
}

422

Returned if the client tries to send an invalid attachment. Reasons are:

  • Omitting the file name (fileName property of metadata part)

  • Sending a file that is too large

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation",
  "message": "File is too large (maximum size is 5242880 Bytes)."
}
ErrorResponse
{
  "type": "object",
  "required": [
    "_type",
    "errorIdentifier",
    "message"
  ],
  "properties": {
    "_embedded": {
      "type": "object",
      "properties": {
        "details": {
          "type": "object",
          "properties": {
            "attribute": {
              "type": "string",
              "example": "project"
            }
          }
        }
      }
    },
    "_type": {
      "type": "string",
      "enum": [
        "Error"
      ]
    },
    "errorIdentifier": {
      "type": "string",
      "example": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation"
    },
    "message": {
      "type": "string",
      "example": "Project can't be blank."
    }
  }
}