# POST /query_content

Source: https://heyeveryone.ai/docs/api/query_content

> https://heyeveryone.ai/api/v1/query_content

## Operation

```json
{
  "post": {
    "description": "The workspace's content as a table: one row per content item with its board stage, owner (member or agent), campaign labels, channel versions (platform, account, state, times), next scheduled time, comment count and approval summary. Filters: `text` (title, original draft or channel text), `stages` (board columns), `buckets` (in_progress / scheduled / published versions), `platforms`, `channelAccountIds`, `campaigns` / `noCampaign`, owners (`ownerAccountIds`, `ownerAgentClientIds`, `unowned`; combined by OR), `attention`, and `from`/`to` (exclusive) on `dateField` (calendar = a version's scheduled/published time or the planning day). `not` takes the same fields and leaves out what each matches (`not: { channelAccountIds: [...] }` hides content with a version on those accounts; content without an owner is kept by `not: { ownerAccountIds }`); its dates use its own `dateField` (default calendar). Sort by `updated` (default), `scheduled`, `created`, `title` or `board` (column, then card order); page with `nextCursor`. `counts` gives stage and bucket sizes for the same filters. For one item use get_content or get_publish_plan.",
    "operationId": "query_content",
    "requestBody": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "text": {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              "stages": {
                "items": {
                  "enum": [
                    "idea",
                    "drafting",
                    "in_review",
                    "scheduled",
                    "published"
                  ],
                  "type": "string"
                },
                "maxItems": 5,
                "type": "array"
              },
              "buckets": {
                "items": {
                  "enum": [
                    "in_progress",
                    "scheduled",
                    "published"
                  ],
                  "type": "string"
                },
                "maxItems": 3,
                "type": "array"
              },
              "platforms": {
                "items": {
                  "enum": [
                    "x",
                    "linkedin",
                    "threads",
                    "bluesky",
                    "instagram",
                    "facebook",
                    "tiktok",
                    "youtube",
                    "sandbox"
                  ],
                  "type": "string"
                },
                "maxItems": 20,
                "type": "array"
              },
              "channelAccountIds": {
                "items": {
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                  "type": "string"
                },
                "maxItems": 50,
                "type": "array"
              },
              "campaigns": {
                "items": {
                  "maxLength": 100,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 20,
                "type": "array"
              },
              "noCampaign": {
                "type": "boolean"
              },
              "ownerAccountIds": {
                "items": {
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                  "type": "string"
                },
                "maxItems": 50,
                "type": "array"
              },
              "ownerAgentClientIds": {
                "items": {
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                  "type": "string"
                },
                "maxItems": 50,
                "type": "array"
              },
              "unowned": {
                "type": "boolean"
              },
              "attention": {
                "type": "boolean"
              },
              "dateField": {
                "default": "calendar",
                "enum": [
                  "scheduled",
                  "planned",
                  "calendar",
                  "created",
                  "updated"
                ],
                "type": "string"
              },
              "from": {
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                "type": "string"
              },
              "to": {
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                "type": "string"
              },
              "not": {
                "properties": {
                  "text": {
                    "maxLength": 200,
                    "minLength": 1,
                    "type": "string"
                  },
                  "stages": {
                    "items": {
                      "enum": [
                        "idea",
                        "drafting",
                        "in_review",
                        "scheduled",
                        "published"
                      ],
                      "type": "string"
                    },
                    "maxItems": 5,
                    "type": "array"
                  },
                  "buckets": {
                    "items": {
                      "enum": [
                        "in_progress",
                        "scheduled",
                        "published"
                      ],
                      "type": "string"
                    },
                    "maxItems": 3,
                    "type": "array"
                  },
                  "platforms": {
                    "items": {
                      "enum": [
                        "x",
                        "linkedin",
                        "threads",
                        "bluesky",
                        "instagram",
                        "facebook",
                        "tiktok",
                        "youtube",
                        "sandbox"
                      ],
                      "type": "string"
                    },
                    "maxItems": 20,
                    "type": "array"
                  },
                  "channelAccountIds": {
                    "items": {
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  "campaigns": {
                    "items": {
                      "maxLength": 100,
                      "minLength": 1,
                      "type": "string"
                    },
                    "maxItems": 20,
                    "type": "array"
                  },
                  "noCampaign": {
                    "type": "boolean"
                  },
                  "ownerAccountIds": {
                    "items": {
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  "ownerAgentClientIds": {
                    "items": {
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  "unowned": {
                    "type": "boolean"
                  },
                  "attention": {
                    "type": "boolean"
                  },
                  "dateField": {
                    "default": "calendar",
                    "enum": [
                      "scheduled",
                      "planned",
                      "calendar",
                      "created",
                      "updated"
                    ],
                    "type": "string"
                  },
                  "from": {
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                    "type": "string"
                  },
                  "to": {
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "includeArchived": {
                "default": false,
                "type": "boolean"
              },
              "workspaceId": {
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                "type": "string"
              },
              "sort": {
                "default": "updated",
                "enum": [
                  "updated",
                  "scheduled",
                  "created",
                  "title",
                  "board"
                ],
                "type": "string"
              },
              "direction": {
                "enum": [
                  "asc",
                  "desc"
                ],
                "type": "string"
              },
              "cursor": {
                "maxLength": 2000,
                "minLength": 1,
                "type": "string"
              },
              "limit": {
                "default": 50,
                "maximum": 200,
                "minimum": 1,
                "type": "integer"
              }
            },
            "required": [
              "workspaceId"
            ],
            "type": "object"
          }
        }
      },
      "required": true
    },
    "responses": {
      "200": {
        "content": {
          "application/json": {
            "schema": {
              "additionalProperties": false,
              "properties": {
                "items": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "pieceId": {
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                        "type": "string"
                      },
                      "workspaceId": {
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "excerpt": {
                        "type": "string"
                      },
                      "stage": {
                        "enum": [
                          "idea",
                          "drafting",
                          "in_review",
                          "scheduled",
                          "published"
                        ],
                        "type": "string"
                      },
                      "buckets": {
                        "items": {
                          "enum": [
                            "in_progress",
                            "scheduled",
                            "published"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "plannedFor": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "archived": {
                        "type": "boolean"
                      },
                      "owner": {
                        "anyOf": [
                          {
                            "additionalProperties": false,
                            "properties": {
                              "kind": {
                                "enum": [
                                  "member",
                                  "agent"
                                ],
                                "type": "string"
                              },
                              "accountId": {
                                "anyOf": [
                                  {
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "agentClientId": {
                                "anyOf": [
                                  {
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "initials": {
                                "type": "string"
                              },
                              "avatarUrl": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "kind",
                              "accountId",
                              "agentClientId",
                              "name",
                              "initials",
                              "avatarUrl"
                            ],
                            "type": "object"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "campaigns": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "campaign": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "channels": {
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "postId": {
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                              "type": "string"
                            },
                            "channelAccountId": {
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                              "type": "string"
                            },
                            "platform": {
                              "enum": [
                                "x",
                                "linkedin",
                                "threads",
                                "bluesky",
                                "instagram",
                                "facebook",
                                "tiktok",
                                "youtube",
                                "sandbox"
                              ],
                              "type": "string"
                            },
                            "emulates": {
                              "anyOf": [
                                {
                                  "enum": [
                                    "x",
                                    "linkedin",
                                    "threads",
                                    "bluesky",
                                    "instagram",
                                    "facebook",
                                    "tiktok",
                                    "youtube"
                                  ],
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "handle": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "displayName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "avatarUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "state": {
                              "enum": [
                                "draft",
                                "ready",
                                "awaiting_confirmation",
                                "scheduled",
                                "publishing",
                                "published",
                                "failed_retrying",
                                "needs_attention",
                                "failed",
                                "manual",
                                "removed"
                              ],
                              "type": "string"
                            },
                            "isSkipped": {
                              "type": "boolean"
                            },
                            "bucket": {
                              "anyOf": [
                                {
                                  "enum": [
                                    "in_progress",
                                    "scheduled",
                                    "published"
                                  ],
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "version": {
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991,
                              "type": "integer"
                            },
                            "scheduledAt": {
                              "anyOf": [
                                {
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "publishedAt": {
                              "anyOf": [
                                {
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "permalink": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "postId",
                            "channelAccountId",
                            "platform",
                            "emulates",
                            "handle",
                            "displayName",
                            "avatarUrl",
                            "state",
                            "isSkipped",
                            "bucket",
                            "version",
                            "scheduledAt",
                            "publishedAt",
                            "permalink"
                          ],
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "scheduledAt": {
                        "anyOf": [
                          {
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "publishedAt": {
                        "anyOf": [
                          {
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "commentCount": {
                        "additionalProperties": false,
                        "properties": {
                          "total": {
                            "maximum": 9007199254740991,
                            "minimum": 0,
                            "type": "integer"
                          },
                          "open": {
                            "maximum": 9007199254740991,
                            "minimum": 0,
                            "type": "integer"
                          }
                        },
                        "required": [
                          "total",
                          "open"
                        ],
                        "type": "object"
                      },
                      "approval": {
                        "additionalProperties": false,
                        "properties": {
                          "state": {
                            "enum": [
                              "none",
                              "in_review",
                              "changes_requested",
                              "approved"
                            ],
                            "type": "string"
                          },
                          "required": {
                            "type": "boolean"
                          },
                          "approvedVersions": {
                            "maximum": 9007199254740991,
                            "minimum": 0,
                            "type": "integer"
                          },
                          "totalVersions": {
                            "maximum": 9007199254740991,
                            "minimum": 0,
                            "type": "integer"
                          },
                          "latest": {
                            "anyOf": [
                              {
                                "additionalProperties": false,
                                "properties": {
                                  "reviewer": {
                                    "additionalProperties": false,
                                    "properties": {
                                      "kind": {
                                        "enum": [
                                          "member",
                                          "guest",
                                          "agent",
                                          "system"
                                        ],
                                        "type": "string"
                                      },
                                      "accountId": {
                                        "anyOf": [
                                          {
                                            "format": "uuid",
                                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "agentClientId": {
                                        "anyOf": [
                                          {
                                            "format": "uuid",
                                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "guestId": {
                                        "anyOf": [
                                          {
                                            "format": "uuid",
                                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "name": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "accountId",
                                      "agentClientId",
                                      "guestId",
                                      "name"
                                    ],
                                    "type": "object"
                                  },
                                  "decision": {
                                    "enum": [
                                      "approved",
                                      "changes_requested"
                                    ],
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "reviewer",
                                  "decision"
                                ],
                                "type": "object"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "state",
                          "required",
                          "approvedVersions",
                          "totalVersions",
                          "latest"
                        ],
                        "type": "object"
                      },
                      "attention": {
                        "type": "boolean"
                      },
                      "draftedByAgent": {
                        "anyOf": [
                          {
                            "additionalProperties": false,
                            "properties": {
                              "agentClientId": {
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "agentClientId",
                              "name"
                            ],
                            "type": "object"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                        "type": "string"
                      },
                      "updatedAt": {
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                        "type": "string"
                      }
                    },
                    "required": [
                      "pieceId",
                      "workspaceId",
                      "title",
                      "excerpt",
                      "stage",
                      "buckets",
                      "plannedFor",
                      "archived",
                      "owner",
                      "campaigns",
                      "campaign",
                      "channels",
                      "scheduledAt",
                      "publishedAt",
                      "commentCount",
                      "approval",
                      "attention",
                      "draftedByAgent",
                      "createdAt",
                      "updatedAt"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "nextCursor": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "total": {
                  "maximum": 9007199254740991,
                  "minimum": 0,
                  "type": "integer"
                },
                "counts": {
                  "additionalProperties": false,
                  "properties": {
                    "byStage": {
                      "additionalProperties": {
                        "maximum": 9007199254740991,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "propertyNames": {
                        "enum": [
                          "idea",
                          "drafting",
                          "in_review",
                          "scheduled",
                          "published"
                        ],
                        "type": "string"
                      },
                      "required": [
                        "idea",
                        "drafting",
                        "in_review",
                        "scheduled",
                        "published"
                      ],
                      "type": "object"
                    },
                    "byBucket": {
                      "additionalProperties": {
                        "maximum": 9007199254740991,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "propertyNames": {
                        "enum": [
                          "in_progress",
                          "scheduled",
                          "published"
                        ],
                        "type": "string"
                      },
                      "required": [
                        "in_progress",
                        "scheduled",
                        "published"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "byStage",
                    "byBucket"
                  ],
                  "type": "object"
                }
              },
              "required": [
                "items",
                "nextCursor",
                "total",
                "counts"
              ],
              "type": "object"
            }
          }
        },
        "description": "Success"
      },
      "400": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "invalid_input: the body does not match the schema"
      },
      "401": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "unauthenticated: missing, invalid, expired or revoked token"
      },
      "403": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "forbidden: the agent may not do this (for example, another workspace)"
      },
      "404": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "not_found"
      },
      "409": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "conflict"
      },
      "429": {
        "$ref": "#/components/responses/RateLimited"
      },
      "500": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "internal_error"
      }
    },
    "summary": "Query content",
    "tags": [
      "workspace"
    ],
    "x-heyeveryone-kind": "query"
  }
}
```

## Referenced definitions

```json
{
  "schemas": {
    "Error": {
      "properties": {
        "error": {
          "description": "A stable error code, for example forbidden.",
          "type": "string"
        },
        "message": {
          "description": "What went wrong, in plain words.",
          "type": "string"
        }
      },
      "required": [
        "error",
        "message"
      ],
      "type": "object"
    }
  },
  "responses": {
    "RateLimited": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "rate_limited: too many requests from this agent, account or address (docs/setup/agents.md, Rate limits); wait the Retry-After seconds, then retry",
      "headers": {
        "Retry-After": {
          "description": "Seconds to wait before retrying.",
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    }
  }
}
```

## Authentication

```json
{
  "bearer": {
    "description": "Personal access token (hey_pat_...)",
    "scheme": "bearer",
    "type": "http"
  },
  "oauth": {
    "flows": {
      "authorizationCode": {
        "authorizationUrl": "https://heyeveryone.ai/oauth/authorize",
        "refreshUrl": "https://heyeveryone.ai/oauth/token",
        "scopes": {
          "agent": "Act as your agent in the workspaces you choose"
        },
        "tokenUrl": "https://heyeveryone.ai/oauth/token"
      }
    },
    "type": "oauth2"
  }
}
```

## Security requirements

```json
[
  {
    "bearer": []
  },
  {
    "oauth": [
      "agent"
    ]
  }
]
```
