{
  "openapi": "3.0.1",
  "info": {
    "title": "WordPress Integration",
    "description": "Manage WordPress content from Apify. Pull WordPress posts and pages, upload draft or published posts from JSON input, and delete WordPress posts by ID using the WordPress REST API.",
    "version": "0.1",
    "x-build-id": "mJ7wwqdEUB1dB4Zmb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/new-world-scripts~wordpress-integration/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-new-world-scripts-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/new-world-scripts~wordpress-integration/runs": {
      "post": {
        "operationId": "runs-sync-new-world-scripts-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/new-world-scripts~wordpress-integration/run-sync": {
      "post": {
        "operationId": "run-sync-new-world-scripts-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",
          "username",
          "appPassword",
          "action"
        ],
        "properties": {
          "siteUrl": {
            "title": "WordPress site URL",
            "type": "string",
            "description": "Full URL of your WordPress site, e.g. https://mysite.com"
          },
          "username": {
            "title": "WordPress username",
            "type": "string",
            "description": "Your WordPress admin username"
          },
          "appPassword": {
            "title": "WordPress Application Password",
            "type": "string",
            "description": "Paste the WordPress Application Password exactly as WordPress shows it. Generate it at Users → Profile → Application Passwords. Do not use your normal login password or sandbox access code."
          },
          "action": {
            "title": "Action to perform",
            "enum": [
              "pull_posts",
              "upload_posts",
              "pull_pages",
              "delete_post",
              "test_auth"
            ],
            "type": "string",
            "description": "What should the actor do?",
            "default": "pull_posts"
          },
          "postType": {
            "title": "Where to upload content",
            "type": "string",
            "description": "Choose the WordPress content area to use. Keep 'post' for normal blog posts. Use 'page' for website pages, or enter a custom type only if your WordPress site uses one.",
            "default": "post"
          },
          "postStatus": {
            "title": "Post status when creating",
            "enum": [
              "draft",
              "publish",
              "pending",
              "private"
            ],
            "type": "string",
            "description": "Status to assign to newly created posts",
            "default": "draft"
          },
          "maxPosts": {
            "title": "Max posts to pull (0 = unlimited)",
            "type": "integer",
            "description": "Limit number of posts fetched. Set to 0 for all posts.",
            "default": 0
          },
          "deletePostId": {
            "title": "Post ID to delete",
            "type": "integer",
            "description": "Required only for the delete_post action"
          },
          "itemsToPush": {
            "title": "Posts to upload",
            "type": "array",
            "description": "JSON array of post objects with title, content, and optional meta fields",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "title": "Post title",
                  "description": "Title for the WordPress post",
                  "type": "string"
                },
                "content": {
                  "title": "Post content",
                  "description": "HTML or plain text content for the WordPress post",
                  "type": "string"
                },
                "featuredImageUrl": {
                  "title": "Featured image URL",
                  "description": "Optional main image URL to upload to WordPress and set as the post featured image",
                  "type": "string"
                },
                "imageUrls": {
                  "title": "Image URLs",
                  "description": "Optional image URLs to upload to WordPress. Use {{image1}}, {{image2}}, etc. inside content to choose where each image appears. Images without placeholders are added at the end.",
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "imageOptions": {
                  "title": "Image display options",
                  "description": "Optional display settings for each imageUrl. First object applies to {{image1}}, second to {{image2}}, and so on.",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "width": {
                        "title": "Image width",
                        "description": "Optional image width in pixels",
                        "type": "integer"
                      },
                      "height": {
                        "title": "Image height",
                        "description": "Optional image height in pixels",
                        "type": "integer"
                      },
                      "alt": {
                        "title": "Alt text",
                        "description": "Optional image alt text",
                        "type": "string"
                      },
                      "class": {
                        "title": "CSS class",
                        "description": "Optional CSS class for the image",
                        "type": "string"
                      }
                    }
                  }
                },
                "meta": {
                  "title": "Post meta",
                  "description": "Optional WordPress meta fields exposed through the REST API",
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}