> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://docs.agentmail.to/llms.txt.

# Get Calendar

GET https://api.agentmail.to/v0/inboxes/{inbox_id}/calendar

Gets the inbox's calendar. Every inbox has one calendar, so this works before any event is
created. Its `etag` (also the `ETag` response header) is the value to send in `If-Match` to
make an update conditional.

Requires the `calendar_read` permission. Calendar is in private beta in US production
(`api.agentmail.to`) and is unavailable in EU production (`api.agentmail.eu`).
Organizations without access receive a `403`.

Reference: https://docs.agentmail.to/api-reference/inboxes/calendar/get

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.agentmail.to` (prod, default)
- `https://x402.api.agentmail.to` (prod-x402)
- `https://mpp.api.agentmail.to` (prod-mpp)
- `https://api.agentmail.eu` (eu-prod)

## Request

### Path parameters

- `inbox_id` (string, required) — The ID of the inbox.

### Query parameters

- `consistency` (enum, optional) — Read consistency. `eventual` (default) reads from the region that serves your request and may lag a write made moments earlier by up to a few seconds. `primary` reads from the primary region and always reflects every completed write.
  - Allowed values: `eventual`, `primary`

## Response

### 200

- `inbox_id` (string, required) — The ID of the inbox.
- `timezone` (string, required) — Default time zone for events created without a `timezone`. Defaults to `UTC`. Changing it does not move existing events.
- `event_count` (integer, required) — Number of one-off and recurring events on the calendar. Each recurring event counts once.
- `created_at` (datetime, required) — Time at which the calendar was created. The calendar exists from the moment the inbox does, so this is the inbox's creation time.
- `updated_at` (datetime, required) — Time at which the calendar was last updated.
- `etag` (string, required) — The calendar's current version, also sent as the `ETag` response header. Send it in `If-Match` to make an update conditional.

## Errors

### 400 Validation Error

- `name` (string, required) — Name of error.
- `errors` (any, required) — Validation errors. Each entry has a path and a message identifying the invalid field.
- `code` (string, optional) — Stable, machine-readable error code in snake_case (for example, not_found or missing_permission). Branch on this rather than the message text.
- `message` (string, optional) — Error message.
- `fix` (string, optional) — The concrete next action that resolves the error.
- `docs` (string, optional) — Link to the error reference entry for this code.

### 403 Forbidden Error

The organization does not have calendar access (calendar is in private beta), or the API key lacks the required calendar permission.

- `name` (string, required) — Name of error.
- `message` (string, required) — Error message.
- `code` (string, optional) — Stable, machine-readable error code in snake_case (for example, not_found or missing_permission). Branch on this rather than the message text.
- `fix` (string, optional) — The concrete next action that resolves the error.
- `docs` (string, optional) — Link to the error reference entry for this code.

### 404 Not Found Error

- `name` (string, required) — Name of error.
- `message` (string, required) — Error message.
- `code` (string, optional) — Stable, machine-readable error code in snake_case (for example, not_found or missing_permission). Branch on this rather than the message text.
- `fix` (string, optional) — The concrete next action that resolves the error.
- `docs` (string, optional) — Link to the error reference entry for this code.

## Examples

**Response**

```json
{
  "inbox_id": "scheduler@agentmail.to",
  "timezone": "America/New_York",
  "event_count": 2,
  "created_at": "2026-10-01T16:20:00Z",
  "updated_at": "2026-10-01T16:25:00Z",
  "etag": "\"rv-1\""
}
```

**SDK Code**

```python
import requests

url = "https://api.agentmail.to/v0/inboxes/scheduler%40agentmail.to/calendar"

headers = {"Authorization": "Bearer <api_key>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.agentmail.to/v0/inboxes/scheduler%40agentmail.to/calendar';
const options = {method: 'GET', headers: {Authorization: 'Bearer <api_key>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.agentmail.to/v0/inboxes/scheduler%40agentmail.to/calendar"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <api_key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.agentmail.to/v0/inboxes/scheduler%40agentmail.to/calendar")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <api_key>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/inboxes/scheduler%40agentmail.to/calendar")
  .header("Authorization", "Bearer <api_key>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.agentmail.to/v0/inboxes/scheduler%40agentmail.to/calendar', [
  'headers' => [
    'Authorization' => 'Bearer <api_key>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.agentmail.to/v0/inboxes/scheduler%40agentmail.to/calendar");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <api_key>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <api_key>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/scheduler%40agentmail.to/calendar")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```