# POST /get_calendar

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

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

## Operation

```json
{
  "post": {
    "description": "See what's going out between `from` and `to` (at most 62 days), across all the workspaces you can use or only `workspaceIds`: every post that isn't skipped, at its published or scheduled time, with its content, channel and state (awaiting_confirmation, scheduled, published, failed...), plus free queue slots in that range (`includeEmptySlots`). Each workspace comes with its time zone; times are UTC ISO strings. `planned` lists unscheduled content with a planning day (`plannedFor`, and `plannedTime` for a time of day) in the range, in its workspace's zone: planning entries, never schedules. Each post carries its `version` for reschedule_post's `expectedVersion`. Use it to find gaps before add_to_queue or request_schedule.",
    "operationId": "get_calendar",
    "requestBody": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "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"
              },
              "workspaceIds": {
                "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"
              },
              "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": 200,
                "type": "array"
              },
              "includeEmptySlots": {
                "default": true,
                "type": "boolean"
              },
              "includePlanned": {
                "default": true,
                "type": "boolean"
              }
            },
            "required": [
              "from",
              "to"
            ],
            "type": "object"
          }
        }
      },
      "required": true
    },
    "responses": {
      "200": {
        "content": {
          "application/json": {
            "schema": {
              "additionalProperties": false,
              "properties": {
                "workspaces": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "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"
                      },
                      "timeZone": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "timeZone"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "posts": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "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"
                      },
                      "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"
                      },
                      "pieceTitle": {
                        "type": "string"
                      },
                      "channel": {
                        "additionalProperties": false,
                        "properties": {
                          "id": {
                            "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"
                          },
                          "handle": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "avatarUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "enum": [
                              "active",
                              "reconnect_required",
                              "disconnected"
                            ],
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "platform",
                          "handle",
                          "displayName",
                          "avatarUrl",
                          "status"
                        ],
                        "type": "object"
                      },
                      "format": {
                        "type": "string"
                      },
                      "state": {
                        "enum": [
                          "draft",
                          "ready",
                          "awaiting_confirmation",
                          "scheduled",
                          "publishing",
                          "published",
                          "failed_retrying",
                          "needs_attention",
                          "failed",
                          "manual",
                          "removed"
                        ],
                        "type": "string"
                      },
                      "version": {
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991,
                        "type": "integer"
                      },
                      "at": {
                        "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"
                      },
                      "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"
                        ]
                      },
                      "preview": {
                        "type": "string"
                      },
                      "requestedByAgent": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "workspaceId",
                      "pieceId",
                      "pieceTitle",
                      "channel",
                      "format",
                      "state",
                      "version",
                      "at",
                      "scheduledAt",
                      "publishedAt",
                      "permalink",
                      "preview",
                      "requestedByAgent"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "emptySlots": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "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"
                      },
                      "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"
                      },
                      "at": {
                        "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": [
                      "workspaceId",
                      "channelAccountId",
                      "at"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "planned": {
                  "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"
                      },
                      "plannedFor": {
                        "type": "string"
                      },
                      "plannedTime": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "status": {
                        "enum": [
                          "idea",
                          "drafting",
                          "in_review",
                          "scheduled",
                          "published"
                        ],
                        "type": "string"
                      },
                      "platforms": {
                        "items": {
                          "enum": [
                            "x",
                            "linkedin",
                            "threads",
                            "bluesky",
                            "instagram",
                            "facebook",
                            "tiktok",
                            "youtube",
                            "sandbox"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "channels": {
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "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"
                                }
                              ]
                            }
                          },
                          "required": [
                            "platform",
                            "emulates"
                          ],
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "hasUnscheduledWork": {
                        "type": "boolean"
                      },
                      "preview": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "pieceId",
                      "workspaceId",
                      "title",
                      "plannedFor",
                      "plannedTime",
                      "status",
                      "platforms",
                      "channels",
                      "hasUnscheduledWork",
                      "preview"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                }
              },
              "required": [
                "workspaces",
                "posts",
                "emptySlots",
                "planned"
              ],
              "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": "Get the calendar",
    "tags": [
      "account"
    ],
    "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"
    ]
  }
]
```
