delete_project_comment¶
- ArtificialIntelligenceApi.delete_project_comment(project_id, comment_id, role_id, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Delete a comment from an AI project
Permanently removes one comment from an AI project. You can delete a comment if you wrote it, or if you are an owner or editor of the project. Deletion cannot be undone, and deleting a comment that no longer exists is rejected rather than treated as a no-op.
- Parameters:
project_id (str) – Identifier of the AI project the comment belongs to. This is the ProjectId returned when the project was created. (required)
comment_id (str) – Identifier of the comment to delete, as returned by the add-comment call or in the comment listing. (required)
role_id (str) – Amorphic role used to authorize this request. (required)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: DELETE /ai/projects/{project_id}/comments/{comment_id}
Success (HTTP 200)¶
The comment was deleted.
Request / response example
{
"Message": "Comment deleted successfully."
}
Errors¶
Documented error codes: AUTH-1001, AUTH-1030, IPV-1002, AUTH-1012, GE-1008.
HTTP 400
The request was invalid or you do not have permission. The body is {“Message”: “<CODE> - <text>”}. Common cases include a missing role_id header (AUTH-1001), a role without the ai.view permission (AUTH-1030), no comment with that identifier on the project (IPV-1002), and a caller who is neither the author nor an owner or editor of the project (AUTH-1012). A missing comment returns 400 rather than 404, and permission failures return 400, not 403.
No such comment on the project
{
"Message": "IPV-1002 - Invalid CommentId - 01JMB7YQ4K9V2XZ3T5R8W6N0AC, resource not found."
}
Caller is neither the author nor an owner or editor
{
"Message": "AUTH-1012 - Failed to delete comment as user john.doe is not the author of the specified comment"
}
HTTP 500
An unexpected server error, including a failure to remove the comment. The body is {“Message”: “<CODE> - <text>”}, normally GE-1008.
Request / response example
{
"Message": "GE-1008 - Could not complete the request. Please try again."
}