# Block API Reference

OpenAPI source: https://api.are.na/v3/openapi.json

## GET /v3/blocks/{id}/comments

- Label: Get block comments
- Docs: https://www.are.na/developers/explore/block/comments
- Markdown: https://www.are.na/developers/explore/block/comments.md
- Requires resource id: yes
- Response content type: application/json

Returns paginated list of comments on this block.
Comments are ordered by creation date (ascending by default, oldest first).

Path parameters:
- id: number (required) — Resource ID

Query parameters:
- page: number (optional) — Page number for pagination
- per: number (optional) — Number of items per page (max 100)
- sort: select (optional) options=created_at_desc|created_at_asc — Sort by the date the relationship was created.

Response schema:
```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "description": "Array of comments",
      "items": {
        "type": "object",
        "description": "A comment on a block",
        "required": [
          "id",
          "type",
          "created_at",
          "updated_at",
          "user",
          "_links"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "nullable": false,
            "description": "Unique identifier for the comment",
            "example": 12345
          },
          "type": {
            "type": "string",
            "nullable": false,
            "description": "Comment type",
            "enum": [
              "Comment"
            ],
            "example": "Comment"
          },
          "body": {
            "type": "oneOf",
            "description": "Comment body with markdown, HTML, and plain text renderings",
            "variants": [
              {
                "type": "object",
                "description": "Markdown content with multiple renderings",
                "…": "see OpenAPI spec for full schema"
              },
              {
                "type": "unknown",
                "nullable": true
              }
            ]
          },
          "created_at": {
            "type": "string",
            "nullable": false,
            "description": "When the comment was created",
            "format": "date-time",
            "example": "2023-01-15T10:30:00Z"
          },
          "updated_at": {
            "type": "string",
            "nullable": false,
            "description": "When the comment was last updated",
            "format": "date-time",
            "example": "2023-01-15T14:45:00Z"
          },
          "user": {
            "type": "object",
            "description": "Embedded user representation (used when user is nested in other resources)",
            "required": [
              "id",
              "type",
              "name",
              "slug",
              "avatar",
              "initials"
            ],
            "properties": {
              "id": {
                "type": "integer",
                "nullable": false,
                "description": "Unique identifier for the user",
                "example": 12345
              },
              "type": {
                "type": "string",
                "nullable": false,
                "description": "User type",
                "enum": [
                  "User"
                ],
                "example": "User"
              },
              "name": {
                "type": "string",
                "nullable": false,
                "description": "User's display name",
                "example": "John Doe"
              },
              "slug": {
                "type": "string",
                "nullable": false,
                "description": "URL-safe identifier (use this in API paths)",
                "example": "john-doe"
              },
              "avatar": {
                "type": "string",
                "nullable": true,
                "description": "URL to user's avatar image",
                "format": "uri",
                "example": "https://d2w9rnfcy7mm78.cloudfront.net/12345/avatar.jpg"
              },
              "initials": {
                "type": "string",
                "nullable": false,
                "description": "User's initials",
                "example": "JD"
              }
            },
            "refName": "EmbeddedUser"
          },
          "_links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "object",
                "description": "A hypermedia link containing the URL of a linked resource.\nThe relationship type is expressed by the key in the parent _links object.\n",
                "…": "see OpenAPI spec for full schema"
              }
            },
            "required": [
              "self"
            ],
            "description": "HATEOAS links for navigation and discovery.\nFollows HAL (Hypertext Application Language) format where link relationships \nare expressed as object keys (e.g., \"self\", \"user\", \"channels\").\n"
          }
        },
        "refName": "Comment"
      }
    },
    "meta": {
      "type": "object",
      "description": "Pagination metadata",
      "required": [
        "current_page",
        "per_page",
        "total_pages",
        "total_count",
        "has_more_pages"
      ],
      "properties": {
        "current_page": {
          "type": "integer",
          "nullable": false,
          "description": "Current page number",
          "example": 1
        },
        "next_page": {
          "type": "integer",
          "nullable": true,
          "description": "Next page number (null if last page)",
          "example": 2
        },
        "prev_page": {
          "type": "integer",
          "nullable": true,
          "description": "Previous page number (null if first page)"
        },
        "per_page": {
          "type": "integer",
          "nullable": false,
          "description": "Number of items per page",
          "example": 25
        },
        "total_pages": {
          "type": "integer",
          "nullable": false,
          "description": "Total number of pages available",
          "example": 5
        },
        "total_count": {
          "type": "integer",
          "nullable": false,
          "description": "Total number of items available",
          "example": 120
        },
        "has_more_pages": {
          "type": "boolean",
          "nullable": false,
          "description": "Whether there are more pages available",
          "example": true
        }
      },
      "refName": "PaginationMeta"
    }
  },
  "required": [
    "data",
    "data",
    "meta"
  ],
  "description": "Paginated list of comments with total count",
  "refName": "CommentListResponse"
}
```