Using API v1? See what changes in v2, or the v1 docs
Metadata
Import the extended properties stored at the provider into Pyas metadata.
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.
Import extended properties into metadata
Copies the provider's extended properties from events on the selected calendars into the events' metadata. The import runs in the background and doesn't modify the calendar. With dryRun: true, the API immediately returns a report on a sample, showing which keys exist and on how many events, and writes nothing.
In the sandbox: Copies the extended properties that another app wrote on Google and Outlook events into metadata. A dry run reports what would be copied. For Outlook, set microsoft.properties to the IDs of the properties to read.
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
accountIds- Type
- array of string
- Description
The accounts to import from. Send one of
accountIds,subjectIdorallAccounts. At most 100 items.
- Name
subjectId- Type
- string
- Description
Imports from every account with this
subjectId.
- Name
allAccounts- Type
- true
- Description
Imports from every account in the app.
- Name
calendarRefs- Type
- array of string
- Description
The calendars to read. Defaults to
primary. At most 20 items.
- Name
from- Type
- string (date-time)
- Description
An ISO 8601 time with a zone.
- Name
to- Type
- string (date-time)
- Description
An ISO 8601 time with a zone.
- Name
google- Type
- object
- Description
- Name
google.scope- Type
- string
- Description
Which extended properties to read. Defaults to
both. One ofprivate,shared,both.
- Name
google.keys- Type
- array of string
- Description
The keys to import. Defaults to every key. At most 50 items.
- Name
microsoft- Type
- object
- Description
- Name
microsoft.properties- Type
- array of string | object
- Required
- required
- Description
The properties to read, by ID, of any type:
String {00020329-0000-0000-c000-000000000046} Name orderId,IntegerArray {...} Name counts(imported as a list), or a numbered one such asInteger 0x8012. A named property imports under its name. To choose the key, send{ "id": "...", "key": "count" }, which a numbered property needs. Outlook can read these properties only by ID. At most 10 items.
- Name
overwrite- Type
- boolean
- Description
Whether to replace metadata already set through v2. Defaults to
false, which keeps the existing metadata.
- Name
convert- Type
- string
- Description
With
auto, values such as "42" and "true" are converted to a number and a boolean. One ofnone,auto.
- Name
dryRun- Type
- boolean
- Description
Returns a report on a sample of recent events without writing any metadata.
- Name
sampleSize- Type
- integer
- Description
For a dry run, the number of events to read per calendar. Defaults to 200. From 1 to 1000.
Errors
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.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/metadata/import' \ -H "x-api-key: $PYAS_API_KEY" \ -H "content-type: application/json" \ -d '{ "accountIds": [ "sbx_fda58c5980_google" ], "dryRun": true}'Response
{ "success": true, "data": { "importId": "mi_2387a8fe491044d8ad779768cee4a8f0", "status": "queued", "request": { "accounts": { "accountIds": [ "sbx_fda58c5980_google" ] }, "calendarRefs": [ "primary" ], "google": { "scope": "both" }, "overwrite": false, "convert": "none" }, "progress": { "calendars": 0, "finished": 0 }, "counts": { "scanned": 0, "copied": 0, "unchanged": 0, "skipped": 0 }, "skippedKeys": [], "skipped": [], "errors": [], "createdAt": "2026-11-14T20:00:32.982Z", "startedAt": null, "finishedAt": null }, "provider": null, "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}List metadata imports
Query parameters
- Name
limit- Type
- integer
- Description
The number of imports to return, newest first. Defaults to 20. From 1 to 100.
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.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/metadata/imports' \ -H "x-api-key: $PYAS_API_KEY"Response
{ "success": true, "data": [], "provider": null, "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Get a metadata import
In the sandbox: Use the importId returned by POST /v2/metadata/import.
Path parameters
- Name
importId- Type
- string
- Required
- required
- Description
Errors
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.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/metadata/imports/mimp_from_the_import' \ -H "x-api-key: $PYAS_API_KEY"Response
{ "success": true, "data": { "importId": "mi_2387a8fe491044d8ad779768cee4a8f0", "status": "queued", "request": { "accounts": { "accountIds": [ "sbx_fda58c5980_google" ] }, "calendarRefs": [ "primary" ], "google": { "scope": "both" }, "overwrite": false, "convert": "none" }, "progress": { "calendars": 0, "finished": 0 }, "counts": { "scanned": 0, "copied": 0, "unchanged": 0, "skipped": 0 }, "skippedKeys": [], "skipped": [], "errors": [], "createdAt": "2026-11-14T20:00:32.982Z", "startedAt": null, "finishedAt": null }, "provider": null, "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}Cancel a metadata import
In the sandbox: Use the importId returned by POST /v2/metadata/import.
Path parameters
- Name
importId- Type
- string
- Required
- required
- Description
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
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.RESOURCE_CONFLICT(409): The resource was modified or already exists.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/metadata/imports/mimp_from_the_import' \ -H "x-api-key: $PYAS_API_KEY"Response
{ "success": true, "data": { "importId": "mi_2387a8fe491044d8ad779768cee4a8f0", "status": "cancelled", "request": { "accounts": { "accountIds": [ "sbx_fda58c5980_google" ] }, "calendarRefs": [ "primary" ], "google": { "scope": "both" }, "overwrite": false, "convert": "none" }, "progress": { "calendars": 0, "finished": 0 }, "counts": { "scanned": 0, "copied": 0, "unchanged": 0, "skipped": 0 }, "skippedKeys": [], "skipped": [], "errors": [], "createdAt": "2026-11-14T20:00:32.982Z", "startedAt": null, "finishedAt": "2026-11-14T20:00:32.994Z" }, "provider": null, "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d", "meta": {}}