{
  "openapi": "3.0.1",
  "info": {
    "title": "WordPress Integration: Publish to WordPress & WooCommerce",
    "description": "Two-way WordPress integration: publish any Apify actor's dataset as WordPress posts, pages, custom post types or WooCommerce products (with dedupe and safe re-runs), or export WordPress and WooCommerce content as a dataset for other actors.",
    "version": "0.1",
    "x-build-id": "tN3lGMKebGuDoAOvz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/aimen_ch~wordpress-integration/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-aimen_ch-wordpress-integration",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/aimen_ch~wordpress-integration/runs": {
      "post": {
        "operationId": "runs-sync-aimen_ch-wordpress-integration",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/aimen_ch~wordpress-integration/run-sync": {
      "post": {
        "operationId": "run-sync-aimen_ch-wordpress-integration",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "siteUrl"
        ],
        "properties": {
          "mode": {
            "title": "What do you want to do?",
            "enum": [
              "check",
              "import",
              "export"
            ],
            "type": "string",
            "description": "<b>Test connection</b> (only the $0.00125 run start is charged): checks the site, your login, permissions and WooCommerce, and previews how your data would be published. Nothing is written.<br><b>Publish data to WordPress</b>: turn a dataset (e.g. another actor's results) into posts, pages, custom posts or WooCommerce products. Re-runs update instead of duplicating.<br><b>Export WordPress content</b>: save posts, pages, products, orders... to this run's dataset.",
            "default": "check"
          },
          "siteUrl": {
            "title": "WordPress site URL",
            "type": "string",
            "description": "Your site's address, e.g. <code>https://example.com</code>. Any page of the site or a wp-admin link works too."
          },
          "username": {
            "title": "WordPress username",
            "type": "string",
            "description": "The login name of the account the actor works as. Needed to publish, and to export drafts, orders or customers. Use an <b>Editor</b> account (or <b>Shop manager</b> for WooCommerce)."
          },
          "applicationPassword": {
            "title": "Application password",
            "type": "string",
            "description": "<b>Not your login password.</b> In wp-admin go to <i>Users → Profile → Application Passwords</i>, type a name like \"Apify\", click <i>Add New Application Password</i> and paste it here (spaces are fine)."
          },
          "datasetId": {
            "title": "Dataset ID",
            "type": "string",
            "description": "ID (or name) of the dataset to publish, e.g. from the Storage tab of another actor's run."
          },
          "runId": {
            "title": "…or actor run ID",
            "type": "string",
            "description": "Publish the results (default dataset) of this run."
          },
          "items": {
            "title": "…or paste items (JSON)",
            "type": "array",
            "description": "A JSON array of objects, handy for a quick try, e.g. <code>[{\"title\": \"Hello\", \"description\": \"First post\"}]</code>."
          },
          "target": {
            "title": "Create as",
            "enum": [
              "post",
              "page",
              "wc_product",
              "custom"
            ],
            "type": "string",
            "description": "What each row of your data becomes.",
            "default": "post"
          },
          "postStatus": {
            "title": "Status of new items",
            "enum": [
              "draft",
              "pending",
              "publish",
              "private"
            ],
            "type": "string",
            "description": "<b>Draft</b> lets you review before anything goes live. Items that already exist keep their status, so what you published by hand stays published.",
            "default": "draft"
          },
          "fieldMapping": {
            "title": "Field mapping (optional)",
            "type": "object",
            "description": "Only needed when the automatic mapping is not what you want. Keys are WordPress fields, values say where the value comes from: <code>{{field}}</code>, nested <code>{{brand.name}}</code>, first available <code>{{title || name}}</code>, with filters <code>{{price | money}}</code>. Special keys: <code>categories</code>, <code>tags</code> (names, created if missing), <code>featuredImage</code> (image URL), <code>meta</code> (custom fields), <code>images</code> (WooCommerce gallery). All filters are listed in the README."
          },
          "uniqueKey": {
            "title": "Unique key (prevents duplicates)",
            "type": "string",
            "description": "The field that identifies the same item across runs, e.g. <code>{{url}}</code> or <code>{{id}}</code>. Leave empty to use the URL, ID or SKU automatically."
          },
          "onExisting": {
            "title": "If an item was already published",
            "enum": [
              "update",
              "skip"
            ],
            "type": "string",
            "description": "Update it with the new data, or leave it as it is in WordPress.",
            "default": "update"
          },
          "dryRun": {
            "title": "Dry run (preview only, no item charges)",
            "type": "boolean",
            "description": "Show what would be created or updated, with the exact data sent, without changing your site. Items are not charged; only the run start is.",
            "default": false
          },
          "customPostType": {
            "title": "Custom post type",
            "type": "string",
            "description": "Only for <i>Create as: Custom post type</i>. Its REST name, e.g. <code>portfolio</code> or <code>job_listing</code>. <b>Test connection</b> lists the ones available on your site."
          },
          "authorId": {
            "title": "Author (user ID)",
            "minimum": 1,
            "type": "integer",
            "description": "WordPress user ID shown as the author of new posts. Empty: the account above."
          },
          "usePresetMapping": {
            "title": "Recognise common field names automatically",
            "type": "boolean",
            "description": "Fill WordPress fields you did not map from common field names. In the field mapping, set a field to <code>\"\"</code> to keep it empty.",
            "default": true
          },
          "skipUnchanged": {
            "title": "Skip unchanged items (not charged)",
            "type": "boolean",
            "description": "Items whose data did not change since the last run are not touched and not charged.",
            "default": true
          },
          "allowUnsafeHtml": {
            "title": "Allow unsafe HTML",
            "type": "boolean",
            "description": "Off (recommended): scripts, iframes, <code>onclick</code>-style attributes and <code>javascript:</code> links are removed from your data, because scraped HTML could otherwise run code on your site. Formatting, links, images and tables are kept. Turn on only for data you trust (e.g. video embeds).",
            "default": false
          },
          "offset": {
            "title": "Skip the first N rows",
            "minimum": 0,
            "type": "integer",
            "description": "Start publishing from this row of the data.",
            "default": 0
          },
          "resources": {
            "title": "Content to export",
            "type": "array",
            "description": "Pick one or more.",
            "items": {
              "type": "string",
              "enum": [
                "posts",
                "pages",
                "categories",
                "tags",
                "media",
                "comments",
                "users",
                "wc_products",
                "wc_orders",
                "wc_customers"
              ],
              "enumTitles": [
                "Posts",
                "Pages",
                "Categories",
                "Tags",
                "Media library",
                "Comments",
                "Authors (public profile)",
                "WooCommerce products",
                "WooCommerce orders",
                "WooCommerce customers"
              ]
            },
            "default": [
              "posts"
            ]
          },
          "incremental": {
            "title": "Only what changed since the last run",
            "type": "boolean",
            "description": "Great for scheduled runs: each run exports only new and changed items.",
            "default": false
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Only items with this status, e.g. <code>publish</code>, <code>draft</code>, <code>any</code>, or for orders <code>processing</code>, <code>completed</code>. Several: <code>draft,pending</code>. Values that do not apply to a content type are ignored for it."
          },
          "search": {
            "title": "Search",
            "type": "string",
            "description": "Only items matching these words."
          },
          "modifiedAfter": {
            "title": "Changed after",
            "type": "string",
            "description": "Only items created or changed after this date."
          },
          "customResources": {
            "title": "Custom post types",
            "type": "array",
            "description": "Also export these custom post types (REST names, e.g. <code>portfolio</code>). <b>Test connection</b> lists them.",
            "items": {
              "type": "string"
            }
          },
          "includeRaw": {
            "title": "Include the full API response",
            "type": "boolean",
            "description": "Adds every field WordPress returns under <code>raw</code>, for advanced use.",
            "default": false
          },
          "wcConsumerKey": {
            "title": "Consumer key",
            "type": "string",
            "description": "Starts with <code>ck_</code>."
          },
          "wcConsumerSecret": {
            "title": "Consumer secret",
            "type": "string",
            "description": "Starts with <code>cs_</code>."
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many items (per content type when exporting). 0 = no limit. With \"Only what changed\", the next run continues where this one stopped.",
            "default": 0
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Requests sent to your site at the same time. Keep 1-3 on shared hosting; raise it for fast, managed hosting.",
            "default": 3
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "How long to wait for your site to answer one request.",
            "default": 30
          },
          "stateStoreName": {
            "title": "Memory name",
            "type": "string",
            "description": "Name of the key-value store where the actor remembers what it published and exported. Change it only to start over with a fresh memory.",
            "default": "wordpress-integration-state"
          },
          "payload": {
            "title": "Integration payload",
            "type": "object",
            "description": "Filled in automatically when this actor runs from another actor's Integrations tab."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}