Metadata

Import the extended properties stored at the provider into Pyas metadata.


POST/v2/metadata/import

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.

Sends the request to your sandbox, never to live data.

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, subjectId or allAccounts. 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 of private, 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 as Integer 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 of none, 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

Request

POST
/v2/metadata/import
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

202 Accepted
{  "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": {}}

GET/v2/metadata/imports

List metadata imports

Sends the request to your sandbox, never to live data.

Query parameters

  • Name
    limit
    Type
    integer
    Description

    The number of imports to return, newest first. Defaults to 20. From 1 to 100.

Errors

Request

GET
/v2/metadata/imports
curl 'https://api.pyas.io/v2/metadata/imports' \  -H "x-api-key: $PYAS_API_KEY"

Response

200 OK
{  "success": true,  "data": [],  "provider": null,  "traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d",  "meta": {}}

GET/v2/metadata/imports/{importId}

Get a metadata import

In the sandbox: Use the importId returned by POST /v2/metadata/import.

Sends the request to your sandbox, never to live data.

Path parameters

  • Name
    importId
    Type
    string
    Required
    required
    Description

Errors

Request

GET
/v2/metadata/imports/{importId}
curl 'https://api.pyas.io/v2/metadata/imports/mimp_from_the_import' \  -H "x-api-key: $PYAS_API_KEY"

Response

200 OK
{  "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": {}}

DELETE/v2/metadata/imports/{importId}

Cancel a metadata import

In the sandbox: Use the importId returned by POST /v2/metadata/import.

Sends the request to your sandbox, never to live data.

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

Request

DELETE
/v2/metadata/imports/{importId}
curl -X DELETE 'https://api.pyas.io/v2/metadata/imports/mimp_from_the_import' \  -H "x-api-key: $PYAS_API_KEY"

Response

200 OK
{  "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": {}}