Using API v1? See what changes in v2, or the v1 docs
Calendars
Manage calendars, calendar sharing, categories, feeds and calendar groups.
The examples use IDs from a sample sandbox. Your sandbox has the same people, calendars and events with its own IDs, which GET /v2/sandbox returns. When you're signed in to the dashboard, Try it fills in your IDs and sends the request to your sandbox, never to live data.
List calendar groups
Calendar groups are Outlook folders that contain calendars. Google Calendar doesn't have calendar groups, so requests for Google accounts are rejected.
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. Required here or in the request body of a write.
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.CONNECTION_NOT_FOUND(404): No connected account was found for this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.
Request
curl 'https://api.pyas.io/v2/calendar-groups?accountId=sbx_fda58c5980_outlook' \ -H "x-api-key: $PYAS_API_KEY"Response
{ "success": true, "data": [ { "id": "AAMkAPtDnBoVMLgLIu-5ZykUH3m3F8jh-vhqP8YlJhgiZLHEAAA=", "name": "My Calendars", "calendarIds": [ "AAMkAU662pGNAu0JgQ5Fpjf1wipv7j82pYQuBvDbbTPOq8h4AAA=" ] }, { "id": "AAMkAyCWrTohk9tAZoyL6-kuuLYadpDmD-3sFfQAb6CXpof0AAA=", "name": "Other calendars", "calendarIds": [ "AAMkAPZCx8r3fRaim7oP6DyRH-4h12pnbtU0iizh-r7n7VpQAAA=" ] }, { "id": "AAMkAFDoRdCjiMqrQ0gUzJhGn7fWP7a-kYNGIymOmCmTrT7cAAA=", "name": "Clients", "calendarIds": [ "AAMkA-M9ePPI-lDjuHutrLL7ee-FjiW4n60cpd6GPnyDTv84AAA=" ] }, { "id": "AAMkAYE1Kc3zrnSLkXx5fXHBEPOfQSybhu8nRccpNiIpXWVwAAA=", "name": "Projects", "calendarIds": [] } ], "provider": "microsoft", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Create a calendar group
Calendar groups are Outlook folders that contain calendars. Google Calendar doesn't have calendar groups, so requests for Google accounts are rejected.
In the sandbox: Calendar groups are an Outlook feature. For Google accounts, the API returns an error explaining that Google doesn't support them.
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. Required here or in the request body of a write.
Headers
- Name
Idempotency-Key- Type
- string
- Description
A unique key that makes the request safe to retry. A retry with the same key returns the original response and does not make the change twice. Keys are kept for 24 hours.
Body
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. You can send it here or in the query.
- Name
name- Type
- string
- Required
- required
- Description
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.VALIDATION_INVALID_BODY(400): The request body is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.CONNECTION_NOT_FOUND(404): No connected account was found for this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.
Request
curl -X POST 'https://api.pyas.io/v2/calendar-groups?accountId=sbx_fda58c5980_outlook' \ -H "x-api-key: $PYAS_API_KEY" \ -H "content-type: application/json" \ -d '{ "name": "Partners"}'Response
{ "success": true, "data": { "id": "AAMkAkhQyt3s2NcmZzvgLwdE68IZ07bC7gBnR6Qr6TyKO3qYAAA=", "name": "Partners", "calendarIds": [] }, "provider": "microsoft", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}List calendars
Returns the calendars of one connected account, one page at a time. With accountIds or subjectId, returns every calendar of each account in one response, grouped by account.
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. Required here or in the request body of a write.
- Name
limit- Type
- integer
- Description
The maximum number of results in one page. From 1 to 250.
- Name
cursor- Type
- string
- Description
The
nextCursorfrom the previous page.
- Name
accountIds- Type
- string
- Description
The Pyas
accountIdvalues of up to 20 connected accounts. Send a comma-separated list or repeat the parameter.
- Name
subjectId- Type
- string
- Description
Selects every connected account labeled with this
subjectId.
- Name
provider- Type
- string
- Description
Limits
accountIdsorsubjectIdto accounts on this provider. One ofgoogle,microsoft,pyas.
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.CONNECTION_NOT_FOUND(404): No connected account was found for this request.CONNECTION_REVOKED(422): The user revoked access, or the provider no longer accepts the stored credentials.CONNECTION_TOKEN_EXPIRED(422): The provider's access token expired and could not be refreshed.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.PROVIDER_TIMEOUT(504): The calendar provider did not respond in time.
Request
curl 'https://api.pyas.io/v2/calendars?accountId=sbx_fda58c5980_1' \ -H "x-api-key: $PYAS_API_KEY"Response
{ "success": true, "data": [ { "id": "calfda58c59801p", "name": "Avery Brooks", "description": null, "timezone": "America/New_York", "isPrimary": true, "color": null, "accessRole": "owner", "location": null, "conferencing": { "default": null, "allowed": [ "zoom" ] }, "tallyResponses": null, "hidden": false, "provider": "pyas", "providerRefs": { "calendarId": "calfda58c59801p", "accountId": "sbx_fda58c5980_1" }, "metadata": null }, { "id": "calfda58c59801w", "name": "Work", "description": null, "timezone": "America/New_York", "isPrimary": false, "color": "#039be5", "accessRole": "owner", "location": null, "conferencing": { "default": null, "allowed": [ "zoom" ] }, "tallyResponses": null, "hidden": false, "provider": "pyas", "providerRefs": { "calendarId": "calfda58c59801w", "accountId": "sbx_fda58c5980_1" }, "metadata": null } ], "provider": "pyas", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": { "nextCursor": null }}Create a calendar
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. Required here or in the request body of a write.
Headers
- Name
Idempotency-Key- Type
- string
- Description
A unique key that makes the request safe to retry. A retry with the same key returns the original response and does not make the change twice. Keys are kept for 24 hours.
Body
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. You can send it here or in the query.
- Name
name- Type
- string
- Required
- required
- Description
- Name
description- Type
- string | null
- Description
- Name
timezone- Type
- string | null
- Description
- Name
color- Type
- string | null
- Description
The color, as
#rrggbb.
- Name
location- Type
- string | null
- Description
Google Calendar only.
- Name
conferencing- Type
- object
- Description
- Name
conferencing.default- Type
- string | null
- Description
- Name
conferencing.allowed- Type
- array of string
- Description
- Name
tallyResponses- Type
- boolean
- Description
Outlook only.
- Name
hidden- Type
- boolean
- Description
Google Calendar only. Whether to hide the calendar from the calendar list.
- Name
groupId- Type
- string
- Description
Outlook only, when creating a calendar. The calendar group to create it in.
- Name
metadata- Type
- Metadata
- Description
Your own key-value pairs, stored by Pyas with the object. A value is text, a number, a boolean or a list of those.
- Name
providerOptions- Type
- ProviderOptions
- Description
Provider-specific fields that have no equivalent in v2, grouped by provider. Each group applies only to accounts on that provider.
Errors
VALIDATION_INVALID_BODY(400): The request body is not valid.VALIDATION_INVALID_TIMEZONE(400): The time zone is not an IANA time zone name.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.CONNECTION_NOT_FOUND(404): No connected account was found for this request.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.CONNECTION_REVOKED(422): The user revoked access, or the provider no longer accepts the stored credentials.CONNECTION_TOKEN_EXPIRED(422): The provider's access token expired and could not be refreshed.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.PROVIDER_TIMEOUT(504): The calendar provider did not respond in time.
Request
curl -X POST 'https://api.pyas.io/v2/calendars' \ -H "x-api-key: $PYAS_API_KEY" \ -H "content-type: application/json" \ -d '{ "accountId": "sbx_fda58c5980_1", "name": "Client meetings", "timezone": "America/New_York", "color": "#33b679", "metadata": { "team": "sales" }}'Response
{ "success": true, "data": { "id": "calba3nh0btrcap9js6fcfv", "name": "Client meetings", "description": null, "timezone": "America/New_York", "isPrimary": false, "color": "#33b679", "accessRole": "owner", "location": null, "conferencing": { "default": null, "allowed": [ "zoom" ] }, "tallyResponses": null, "hidden": false, "provider": "pyas", "providerRefs": { "calendarId": "calba3nh0btrcap9js6fcfv", "accountId": "sbx_fda58c5980_1" }, "metadata": { "team": "sales" } }, "provider": "pyas", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Get color palettes
Returns the calendar and event colors that the account's provider offers, as #rrggbb values.
Query parameters
- Name
accountId- Type
- string
- Required
- required
- Description
The Pyas
accountIdof the connected account.
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.CONNECTION_NOT_FOUND(404): No connected account was found for this request.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.
Request
curl 'https://api.pyas.io/v2/colors?accountId=sbx_fda58c5980_google' \ -H "x-api-key: $PYAS_API_KEY"Response
{ "success": true, "data": { "calendarColors": [ { "id": "1", "color": "#ac725e" }, { "id": "2", "color": "#d06b64" }, { "id": "3", "color": "#f83a22" }, { "id": "4", "color": "#fa573c" }, { "id": "5", "color": "#ff7537" }, { "id": "6", "color": "#ffad46" }, { "id": "7", "color": "#42d692" }, { "id": "8", "color": "#16a765" }, { "id": "9", "color": "#7bd148" }, { "id": "10", "color": "#b3dc6c" }, { "id": "11", "color": "#fbe983" }, { "id": "12", "color": "#fad165" }, { "id": "13", "color": "#92e1c0" }, { "id": "14", "color": "#9fe1e7" }, { "id": "15", "color": "#9fc6e7" }, { "id": "16", "color": "#4986e7" }, { "id": "17", "color": "#9a9cff" }, { "id": "18", "color": "#b99aff" }, { "id": "19", "color": "#c2c2c2" }, { "id": "20", "color": "#cabdbf" }, { "id": "21", "color": "#cca6ac" }, { "id": "22", "color": "#f691b2" }, { "id": "23", "color": "#cd74e6" }, { "id": "24", "color": "#a47ae2" } ], "eventColors": [ { "id": "1", "color": "#a4bdfc" }, { "id": "2", "color": "#7ae7bf" }, { "id": "3", "color": "#dbadff" }, { "id": "4", "color": "#ff887c" }, { "id": "5", "color": "#fbd75b" }, { "id": "6", "color": "#ffb878" }, { "id": "7", "color": "#46d6db" }, { "id": "8", "color": "#e1e1e1" }, { "id": "9", "color": "#5484ed" }, { "id": "10", "color": "#51b749" }, { "id": "11", "color": "#dc2127" } ] }, "provider": "google", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Rename a calendar group
Calendar groups are Outlook folders that contain calendars. Google Calendar doesn't have calendar groups, so requests for Google accounts are rejected.
Path parameters
- Name
groupId- Type
- string
- Required
- required
- Description
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. Required here or in the request body of a write.
Headers
- Name
Idempotency-Key- Type
- string
- Description
A unique key that makes the request safe to retry. A retry with the same key returns the original response and does not make the change twice. Keys are kept for 24 hours.
Body
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. You can send it here or in the query.
- Name
name- Type
- string
- Required
- required
- Description
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.VALIDATION_INVALID_BODY(400): The request body is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.CONNECTION_NOT_FOUND(404): No connected account was found for this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.
Request
curl -X PATCH 'https://api.pyas.io/v2/calendar-groups/AAMkAYE1Kc3zrnSLkXx5fXHBEPOfQSybhu8nRccpNiIpXWVwAAA%3D?accountId=sbx_fda58c5980_outlook' \ -H "x-api-key: $PYAS_API_KEY" \ -H "content-type: application/json" \ -d '{ "name": "Key projects"}'Response
{ "success": true, "data": { "id": "AAMkAYE1Kc3zrnSLkXx5fXHBEPOfQSybhu8nRccpNiIpXWVwAAA=", "name": "Key projects", "calendarIds": [] }, "provider": "microsoft", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Delete a calendar group
Calendar groups are Outlook folders that contain calendars. Google Calendar doesn't have calendar groups, so requests for Google accounts are rejected.
In the sandbox: Outlook doesn't delete a group that still contains calendars, and the API returns an error explaining why.
Path parameters
- Name
groupId- Type
- string
- Required
- required
- Description
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. Required here or in the request body of a write.
Headers
- Name
Idempotency-Key- Type
- string
- Description
A unique key that makes the request safe to retry. A retry with the same key returns the original response and does not make the change twice. Keys are kept for 24 hours.
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.CONNECTION_NOT_FOUND(404): No connected account was found for this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.
Request
curl -X DELETE 'https://api.pyas.io/v2/calendar-groups/AAMkAYE1Kc3zrnSLkXx5fXHBEPOfQSybhu8nRccpNiIpXWVwAAA%3D?accountId=sbx_fda58c5980_outlook' \ -H "x-api-key: $PYAS_API_KEY"Response
{ "success": true, "data": null, "provider": "microsoft", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Get a calendar
Path parameters
- Name
calendarRef- Type
- string
- Required
- required
- Description
The calendar ID returned by the provider, or
primaryfor the account's primary calendar.
Query parameters
- Name
accountId- Type
- string
- Required
- required
- Description
The
accountIdof the connected account.
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_NOT_FOUND(404): No connected account was found for this request.CONNECTION_REVOKED(422): The user revoked access, or the provider no longer accepts the stored credentials.CONNECTION_TOKEN_EXPIRED(422): The provider's access token expired and could not be refreshed.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.PROVIDER_TIMEOUT(504): The calendar provider did not respond in time.
Request
curl 'https://api.pyas.io/v2/calendars/calfda58c59801w?accountId=sbx_fda58c5980_1' \ -H "x-api-key: $PYAS_API_KEY"Response
{ "success": true, "data": { "id": "calfda58c59801w", "name": "Work", "description": null, "timezone": "America/New_York", "isPrimary": false, "color": "#039be5", "accessRole": "owner", "location": null, "conferencing": { "default": null, "allowed": [ "zoom" ] }, "tallyResponses": null, "hidden": false, "provider": "pyas", "providerRefs": { "calendarId": "calfda58c59801w", "accountId": "sbx_fda58c5980_1" }, "metadata": null }, "provider": "pyas", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Update a calendar
Updates the calendar. Send only the fields to update. Set description, timezone, color or location to null to clear it.
Path parameters
- Name
calendarRef- Type
- string
- Required
- required
- Description
The calendar ID returned by the provider, or
primaryfor the account's primary calendar.
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. Required here or in the request body of a write.
Headers
- Name
Idempotency-Key- Type
- string
- Description
A unique key that makes the request safe to retry. A retry with the same key returns the original response and does not make the change twice. Keys are kept for 24 hours.
Body
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. You can send it here or in the query.
- Name
name- Type
- string
- Description
- Name
description- Type
- string | null
- Description
- Name
timezone- Type
- string | null
- Description
- Name
color- Type
- string | null
- Description
The color, as
#rrggbb.
- Name
location- Type
- string | null
- Description
Google Calendar only.
- Name
conferencing- Type
- object
- Description
- Name
conferencing.default- Type
- string | null
- Description
- Name
conferencing.allowed- Type
- array of string
- Description
- Name
tallyResponses- Type
- boolean
- Description
Outlook only.
- Name
hidden- Type
- boolean
- Description
Google Calendar only. Whether to hide the calendar from the calendar list.
- Name
groupId- Type
- string
- Description
Outlook only, when creating a calendar. The calendar group to create it in.
- Name
metadata- Type
- Metadata
- Description
Your own key-value pairs, stored by Pyas with the object. A value is text, a number, a boolean or a list of those.
- Name
providerOptions- Type
- ProviderOptions
- Description
Provider-specific fields that have no equivalent in v2, grouped by provider. Each group applies only to accounts on that provider.
Errors
VALIDATION_INVALID_BODY(400): The request body is not valid.VALIDATION_INVALID_TIMEZONE(400): The time zone is not an IANA time zone name.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_NOT_FOUND(404): No connected account was found for this request.CONNECTION_REVOKED(422): The user revoked access, or the provider no longer accepts the stored credentials.CONNECTION_TOKEN_EXPIRED(422): The provider's access token expired and could not be refreshed.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.PROVIDER_TIMEOUT(504): The calendar provider did not respond in time.
Request
curl -X PATCH 'https://api.pyas.io/v2/calendars/calfda58c59801w?accountId=sbx_fda58c5980_1' \ -H "x-api-key: $PYAS_API_KEY" \ -H "content-type: application/json" \ -d '{ "name": "Work (team)"}'Response
{ "success": true, "data": { "id": "calfda58c59801w", "name": "Work (team)", "description": null, "timezone": "America/New_York", "isPrimary": false, "color": "#039be5", "accessRole": "owner", "location": null, "conferencing": { "default": null, "allowed": [ "zoom" ] }, "tallyResponses": null, "hidden": false, "provider": "pyas", "providerRefs": { "calendarId": "calfda58c59801w", "accountId": "sbx_fda58c5980_1" }, "metadata": null }, "provider": "pyas", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Delete a calendar
Deletes the calendar and its events at the provider. A primary calendar cannot be deleted.
Path parameters
- Name
calendarRef- Type
- string
- Required
- required
- Description
The calendar ID returned by the provider, or
primaryfor the account's primary calendar.
Query parameters
- Name
accountId- Type
- string
- Required
- required
- Description
The
accountIdof the connected account.
Headers
- Name
Idempotency-Key- Type
- string
- Description
A unique key that makes the request safe to retry. A retry with the same key returns the original response and does not make the change twice. Keys are kept for 24 hours.
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_NOT_FOUND(404): No connected account was found for this request.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.CONNECTION_REVOKED(422): The user revoked access, or the provider no longer accepts the stored credentials.CONNECTION_TOKEN_EXPIRED(422): The provider's access token expired and could not be refreshed.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.PROVIDER_TIMEOUT(504): The calendar provider did not respond in time.
Request
curl -X DELETE 'https://api.pyas.io/v2/calendars/calfda58c59804w?accountId=sbx_fda58c5980_4' \ -H "x-api-key: $PYAS_API_KEY"Response
{ "success": true, "data": null, "provider": "pyas", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Subscribe to a calendar
Adds a calendar that the account has access to, such as a colleague's calendar or a shared calendar, to the account's calendar list.
In the sandbox: Google adds any calendar the account has access to. The sandbox accepts any calendar ID, but a live account must have access to the calendar. Outlook adds a shared calendar only when the person accepts the invitation, so for Outlook accounts the API returns an error explaining that it can't add the calendar.
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. Required here or in the request body of a write.
Headers
- Name
Idempotency-Key- Type
- string
- Description
A unique key that makes the request safe to retry. A retry with the same key returns the original response and does not make the change twice. Keys are kept for 24 hours.
Body
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. You can send it here or in the query.
- Name
calendarId- Type
- string
- Required
- required
- Description
The ID of the calendar to add, such as a colleague's email address.
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.VALIDATION_INVALID_BODY(400): The request body is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.CONNECTION_NOT_FOUND(404): No connected account was found for this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.
Request
curl -X POST 'https://api.pyas.io/v2/calendars/subscribe' \ -H "x-api-key: $PYAS_API_KEY" \ -H "content-type: application/json" \ -d '{ "accountId": "sbx_fda58c5980_google", "calendarId": "team-calendar@example.com"}'Response
{ "success": true, "data": { "id": "team-calendar@example.com", "name": "team-calendar@example.com", "description": null, "timezone": "America/New_York", "isPrimary": false, "color": "#9fc6e7", "accessRole": "reader", "location": null, "conferencing": { "default": null, "allowed": [] }, "tallyResponses": null, "hidden": false, "provider": "google", "providerRefs": { "calendarId": "team-calendar@example.com", "accountId": "sbx_fda58c5980_google" } }, "provider": "google", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}List categories
Lists the values that events accept in categories. On Outlook, there is one list for the whole mailbox. On Google Calendar, these are the calendar's event labels.
Path parameters
- Name
calendarRef- Type
- string
- Required
- required
- Description
The calendar ID returned by the provider, or
primaryfor the account's primary calendar.
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. Required here or in the request body of a write.
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.CONNECTION_NOT_FOUND(404): No connected account was found for this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.
Request
curl 'https://api.pyas.io/v2/calendars/primary/categories?accountId=sbx_fda58c5980_outlook' \ -H "x-api-key: $PYAS_API_KEY"Response
{ "success": true, "data": [ { "id": "2eb82094-ec40-4d5d-a8b8-15cf273998c1", "name": "Red category", "color": "#e74856" }, { "id": "945326ef-02ee-47a7-a625-8364f33d9abd", "name": "Orange category", "color": "#f7630c" }, { "id": "d4c5c9cb-5502-42de-a335-3f8f85322a98", "name": "Yellow category", "color": "#fce100" }, { "id": "109ef2a3-89fc-4525-a7b8-d4d3eddfec23", "name": "Green category", "color": "#16c60c" }, { "id": "0eed55fa-f6a2-4cb2-a808-1ab178ff93b5", "name": "Blue category", "color": "#0078d7" }, { "id": "18d6d65c-6b1e-47ac-ac6f-5ae45fad5968", "name": "Purple category", "color": "#8764b8" } ], "provider": "microsoft", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Create a category
In the sandbox: Outlook categories belong to the mailbox, so they are the same for every calendar, and they use Outlook's own colors (the nearest color is used). Google categories are per-calendar labels and accept any color.
Path parameters
- Name
calendarRef- Type
- string
- Required
- required
- Description
The calendar ID returned by the provider, or
primaryfor the account's primary calendar.
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. Required here or in the request body of a write.
Headers
- Name
Idempotency-Key- Type
- string
- Description
A unique key that makes the request safe to retry. A retry with the same key returns the original response and does not make the change twice. Keys are kept for 24 hours.
Body
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. You can send it here or in the query.
- Name
name- Type
- string
- Required
- required
- Description
- Name
color- Type
- string
- Description
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.VALIDATION_INVALID_BODY(400): The request body is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.CONNECTION_NOT_FOUND(404): No connected account was found for this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.RESOURCE_CONFLICT(409): The resource was modified or already exists.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.
Request
curl -X POST 'https://api.pyas.io/v2/calendars/primary/categories?accountId=sbx_fda58c5980_outlook' \ -H "x-api-key: $PYAS_API_KEY" \ -H "content-type: application/json" \ -d '{ "name": "Client work", "color": "#33b679"}'Response
{ "success": true, "data": { "id": "ee111d87-0428-40cf-875f-2f0f2b7c5d4a", "name": "Client work", "color": "#16c60c" }, "provider": "microsoft", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Get a calendar's feed
Returns the state and link of a virtual calendar's iCalendar subscription feed, which calendar apps can subscribe to.
Path parameters
- Name
calendarRef- Type
- string
- Required
- required
- Description
The calendar ID returned by the provider, or
primaryfor the account's primary calendar.
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the virtual calendar account.
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_NOT_FOUND(404): No connected account was found for this request.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.
Request
curl 'https://api.pyas.io/v2/calendars/primary/feed?accountId=sbx_fda58c5980_2' \ -H "x-api-key: $PYAS_API_KEY"Response
{ "success": true, "data": { "enabled": false, "url": null, "webcalUrl": null, "details": null, "createdAt": null, "expiresAt": null }, "provider": "pyas", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Enable a calendar's feed
Publishes a virtual calendar as an iCalendar feed that people can subscribe to. If the feed is already enabled, only details is updated, and the link stays the same.
Path parameters
- Name
calendarRef- Type
- string
- Required
- required
- Description
The calendar ID returned by the provider, or
primaryfor the account's primary calendar.
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the virtual calendar account.
Headers
- Name
Idempotency-Key- Type
- string
- Description
A unique key that makes the request safe to retry. A retry with the same key returns the original response and does not make the change twice. Keys are kept for 24 hours.
Body
- Name
accountId- Type
- string
- Description
The
accountIdof the virtual calendar account. You can also send it as a query parameter.
- Name
details- Type
- string
- Description
full(the default) includes titles, locations and notes.busyshows only when the calendar is busy. One offull,busy.
Errors
VALIDATION_INVALID_BODY(400): The request body is not valid.VALIDATION_INVALID_QUERY(400): A query parameter is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_NOT_FOUND(404): No connected account was found for this request.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.
Request
curl -X PUT 'https://api.pyas.io/v2/calendars/primary/feed?accountId=sbx_fda58c5980_2' \ -H "x-api-key: $PYAS_API_KEY" \ -H "content-type: application/json" \ -d '{ "details": "busy"}'Response
{ "success": true, "data": { "enabled": true, "url": "https://cal.pyas.io/feeds/D_Gflr0xO2HNSXG26-HC1jZIOauvvfJyBo_S7MbS8IA.ics", "webcalUrl": "webcal://cal.pyas.io/feeds/D_Gflr0xO2HNSXG26-HC1jZIOauvvfJyBo_S7MbS8IA.ics", "details": "busy", "createdAt": "2026-11-14T20:00:25.503Z", "expiresAt": "2026-11-21T20:00:25.503Z" }, "provider": "pyas", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Disable a calendar's feed
Disables the feed. The feed link stops working, and subscribers stop receiving updates.
Path parameters
- Name
calendarRef- Type
- string
- Required
- required
- Description
The calendar ID returned by the provider, or
primaryfor the account's primary calendar.
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the virtual calendar account.
Headers
- Name
Idempotency-Key- Type
- string
- Description
A unique key that makes the request safe to retry. A retry with the same key returns the original response and does not make the change twice. Keys are kept for 24 hours.
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_NOT_FOUND(404): No connected account was found for this request.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.
Request
curl -X DELETE 'https://api.pyas.io/v2/calendars/primary/feed?accountId=sbx_fda58c5980_2' \ -H "x-api-key: $PYAS_API_KEY"Response
{ "success": true, "data": { "enabled": false, "url": null, "webcalUrl": null, "details": null, "createdAt": null, "expiresAt": null }, "provider": "pyas", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}List calendar permissions
Path parameters
- Name
calendarRef- Type
- string
- Required
- required
- Description
The calendar ID returned by the provider, or
primaryfor the account's primary calendar.
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. Required here or in the request body of a write.
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.CONNECTION_NOT_FOUND(404): No connected account was found for this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.
Request
curl 'https://api.pyas.io/v2/calendars/primary/permissions?accountId=sbx_fda58c5980_google' \ -H "x-api-key: $PYAS_API_KEY"Response
{ "success": true, "data": [ { "id": "user:avery.brooks@example.com", "grantee": { "type": "user", "email": "avery.brooks@example.com", "domain": null, "name": null }, "role": "owner", "removable": false }, { "id": "user:sam.patel@example.org", "grantee": { "type": "user", "email": "sam.patel@example.org", "domain": null, "name": null }, "role": "read", "removable": true } ], "provider": "google", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Share a calendar
In the sandbox: Each provider supports its own set of roles. Google supports freeBusy, read, write and owner. Outlook also supports limitedRead, and has delegate roles instead of owner. If a provider doesn't support a role, the request is rejected with an error that explains why.
Path parameters
- Name
calendarRef- Type
- string
- Required
- required
- Description
The calendar ID returned by the provider, or
primaryfor the account's primary calendar.
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. Required here or in the request body of a write.
Headers
- Name
Idempotency-Key- Type
- string
- Description
A unique key that makes the request safe to retry. A retry with the same key returns the original response and does not make the change twice. Keys are kept for 24 hours.
Body
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. You can send it here or in the query.
- Name
grantee- Type
- object
- Required
- required
- Description
Who to share the calendar with.
- Name
grantee.type- Type
- string
- Required
- required
- Description
One of
user,group,domain,public,organization.
- Name
grantee.email- Type
- string
- Description
The email address. Required for a
userorgroup.
- Name
grantee.domain- Type
- string
- Description
The domain, such as
example.com. Required for adomain.
- Name
grantee.name- Type
- string
- Description
- Name
role- Type
- PermissionRole
- Required
- required
- Description
The level of access, from least to most:
freeBusy(free/busy only),limitedRead(titles and locations, Outlook only),read(everything except private events),write(editing),delegateanddelegateWithPrivate(a delegate, Outlook only), andowner(full control, Google Calendar only). One offreeBusy,limitedRead,read,write,delegate,delegateWithPrivate,owner.
- Name
notify- Type
- boolean
- Description
Whether to email the grantee about the new permission. Google Calendar only, because Outlook decides whether to send the email.
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.VALIDATION_INVALID_BODY(400): The request body is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.CONNECTION_NOT_FOUND(404): No connected account was found for this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.
Request
curl -X POST 'https://api.pyas.io/v2/calendars/primary/permissions?accountId=sbx_fda58c5980_google' \ -H "x-api-key: $PYAS_API_KEY" \ -H "content-type: application/json" \ -d '{ "grantee": { "type": "user", "email": "assistant@example.com" }, "role": "read"}'Response
{ "success": true, "data": { "id": "user:assistant@example.com", "grantee": { "type": "user", "email": "assistant@example.com", "domain": null, "name": null }, "role": "read", "removable": true }, "provider": "google", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Unsubscribe from a calendar
Removes the calendar from the account's calendar list. The calendar itself isn't deleted.
Path parameters
- Name
calendarRef- Type
- string
- Required
- required
- Description
The calendar ID returned by the provider, or
primaryfor the account's primary calendar.
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. Required here or in the request body of a write.
Headers
- Name
Idempotency-Key- Type
- string
- Description
A unique key that makes the request safe to retry. A retry with the same key returns the original response and does not make the change twice. Keys are kept for 24 hours.
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.CONNECTION_NOT_FOUND(404): No connected account was found for this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.
Request
curl -X DELETE 'https://api.pyas.io/v2/calendars/en.usa%23holiday@group.v.calendar.google.com/subscription?accountId=sbx_fda58c5980_google' \ -H "x-api-key: $PYAS_API_KEY"Response
{ "success": true, "data": null, "provider": "google", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Update a category
In the sandbox: On Outlook, you can update a category's color but not its name. On Google, you can also rename labels.
Path parameters
- Name
calendarRef- Type
- string
- Required
- required
- Description
The calendar ID returned by the provider, or
primaryfor the account's primary calendar.
- Name
categoryId- Type
- string
- Required
- required
- Description
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. Required here or in the request body of a write.
Headers
- Name
Idempotency-Key- Type
- string
- Description
A unique key that makes the request safe to retry. A retry with the same key returns the original response and does not make the change twice. Keys are kept for 24 hours.
Body
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. You can send it here or in the query.
- Name
name- Type
- string
- Description
- Name
color- Type
- string
- Description
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.VALIDATION_INVALID_BODY(400): The request body is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.CONNECTION_NOT_FOUND(404): No connected account was found for this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.
Request
curl -X PATCH 'https://api.pyas.io/v2/calendars/primary/categories/0eed55fa-f6a2-4cb2-a808-1ab178ff93b5?accountId=sbx_fda58c5980_outlook' \ -H "x-api-key: $PYAS_API_KEY" \ -H "content-type: application/json" \ -d '{ "color": "#f6bf26"}'Response
{ "success": true, "data": { "id": "0eed55fa-f6a2-4cb2-a808-1ab178ff93b5", "name": "Blue category", "color": "#fce100" }, "provider": "microsoft", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Delete a category
Path parameters
- Name
calendarRef- Type
- string
- Required
- required
- Description
The calendar ID returned by the provider, or
primaryfor the account's primary calendar.
- Name
categoryId- Type
- string
- Required
- required
- Description
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. Required here or in the request body of a write.
Headers
- Name
Idempotency-Key- Type
- string
- Description
A unique key that makes the request safe to retry. A retry with the same key returns the original response and does not make the change twice. Keys are kept for 24 hours.
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.CONNECTION_NOT_FOUND(404): No connected account was found for this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.
Request
curl -X DELETE 'https://api.pyas.io/v2/calendars/primary/categories/d4c5c9cb-5502-42de-a335-3f8f85322a98?accountId=sbx_fda58c5980_outlook' \ -H "x-api-key: $PYAS_API_KEY"Response
{ "success": true, "data": null, "provider": "microsoft", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Rotate a feed's link
Creates a new link for the feed. The old link stops working immediately. Use this when a link was shared too widely.
Path parameters
- Name
calendarRef- Type
- string
- Required
- required
- Description
The calendar ID returned by the provider, or
primaryfor the account's primary calendar.
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the virtual calendar account.
Headers
- Name
Idempotency-Key- Type
- string
- Description
A unique key that makes the request safe to retry. A retry with the same key returns the original response and does not make the change twice. Keys are kept for 24 hours.
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_NOT_FOUND(404): No connected account was found for this request.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.
Request
curl -X POST 'https://api.pyas.io/v2/calendars/primary/feed/rotate?accountId=sbx_fda58c5980_2' \ -H "x-api-key: $PYAS_API_KEY"Response
{ "success": true, "data": { "enabled": true, "url": "https://cal.pyas.io/feeds/lWpiTMfSX4Gl5H8tvoNz966qj6jeZuWGltO0U_1tdYw.ics", "webcalUrl": "webcal://cal.pyas.io/feeds/lWpiTMfSX4Gl5H8tvoNz966qj6jeZuWGltO0U_1tdYw.ics", "details": "busy", "createdAt": "2026-11-14T20:00:25.510Z", "expiresAt": "2026-11-21T20:00:25.510Z" }, "provider": "pyas", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Update a calendar permission
In the sandbox: Google identifies a share by its grantee (user:email), and Outlook uses its own ID. Use an ID from the list.
Path parameters
- Name
calendarRef- Type
- string
- Required
- required
- Description
The calendar ID returned by the provider, or
primaryfor the account's primary calendar.
- Name
permissionId- Type
- string
- Required
- required
- Description
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. Required here or in the request body of a write.
Headers
- Name
Idempotency-Key- Type
- string
- Description
A unique key that makes the request safe to retry. A retry with the same key returns the original response and does not make the change twice. Keys are kept for 24 hours.
Body
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. You can send it here or in the query.
- Name
role- Type
- PermissionRole
- Required
- required
- Description
The level of access, from least to most:
freeBusy(free/busy only),limitedRead(titles and locations, Outlook only),read(everything except private events),write(editing),delegateanddelegateWithPrivate(a delegate, Outlook only), andowner(full control, Google Calendar only). One offreeBusy,limitedRead,read,write,delegate,delegateWithPrivate,owner.
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.VALIDATION_INVALID_BODY(400): The request body is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.CONNECTION_NOT_FOUND(404): No connected account was found for this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.
Request
curl -X PATCH 'https://api.pyas.io/v2/calendars/primary/permissions/user%3Asam.patel@example.org?accountId=sbx_fda58c5980_google' \ -H "x-api-key: $PYAS_API_KEY" \ -H "content-type: application/json" \ -d '{ "role": "write"}'Response
{ "success": true, "data": { "id": "user:sam.patel@example.org", "grantee": { "type": "user", "email": "sam.patel@example.org", "domain": null, "name": null }, "role": "write", "removable": true }, "provider": "google", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Delete a calendar permission
In the sandbox: Deleting a share that no longer exists also returns 200, on every provider.
Path parameters
- Name
calendarRef- Type
- string
- Required
- required
- Description
The calendar ID returned by the provider, or
primaryfor the account's primary calendar.
- Name
permissionId- Type
- string
- Required
- required
- Description
Query parameters
- Name
accountId- Type
- string
- Description
The
accountIdof the connected account. Required here or in the request body of a write.
Headers
- Name
Idempotency-Key- Type
- string
- Description
A unique key that makes the request safe to retry. A retry with the same key returns the original response and does not make the change twice. Keys are kept for 24 hours.
Errors
VALIDATION_INVALID_QUERY(400): A query parameter is not valid.AUTH_INVALID_KEY(401): The API key is missing, unknown or revoked.AUTH_EXPIRED_KEY(401): The API key has expired.AUTH_INSUFFICIENT_SCOPE(403): The API key or session does not have permission to make this request.CONNECTION_NOT_FOUND(404): No connected account was found for this request.RESOURCE_NOT_FOUND(404): The calendar or event was not found.CONNECTION_SCOPE_INSUFFICIENT(422): The connected account did not grant a permission that this operation requires.VALIDATION_UNSUPPORTED_OPERATION(422): This provider does not support this operation.PROVIDER_RATE_LIMITED(429): The calendar provider is rate limiting requests for this account.RATE_LIMIT_EXCEEDED(429): The request rate exceeds this plan's rate limit.RATE_LIMIT_BURST(429): Too many requests were sent in a short period.INTERNAL_ERROR(500): Something went wrong on our end.PROVIDER_UNAVAILABLE(503): The calendar provider is not responding normally.
Request
curl -X DELETE 'https://api.pyas.io/v2/calendars/primary/permissions/user%3Aassistant@example.com?accountId=sbx_fda58c5980_google' \ -H "x-api-key: $PYAS_API_KEY"Response
{ "success": true, "data": null, "provider": "google", "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}