{
  "openapi": "3.0.1",
  "info": {
    "title": "Airtable (apify/airtable)",
    "description": "Imports any Apify dataset into Airtable with append, override, or create modes. Supports custom field mapping, automatic column creation, duplicate detection, batching, retries, and OAuth. Works standalone or as an Actor-to-Actor integration.",
    "version": "0.0",
    "x-build-id": "P01U1dyUWVdPdEeKB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/apify~airtable-apify-airtable/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-apify-airtable-apify-airtable",
        "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/apify~airtable-apify-airtable/runs": {
      "post": {
        "operationId": "runs-sync-apify-airtable-apify-airtable",
        "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/apify~airtable-apify-airtable/run-sync": {
      "post": {
        "operationId": "run-sync-apify-airtable-apify-airtable",
        "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": [
          "oAuthAccount.BpW1howJtlI9fdEck",
          "operation",
          "base",
          "table",
          "datasetId",
          "dataMappings"
        ],
        "properties": {
          "oAuthAccount.BpW1howJtlI9fdEck": {
            "title": "Airtable",
            "type": "string",
            "description": "Connect your Airtable using OAuth2."
          },
          "operation": {
            "title": "Import operation",
            "enum": [
              "Append",
              "Override",
              "Create"
            ],
            "type": "string",
            "description": "How to handle records in the target Airtable table before importing. 'Append' keeps existing records and adds new ones. 'Override' deletes all existing records first, then imports. 'Create' will create the table if it does not exist, otherwise it behaves like 'Append'.",
            "default": "Append"
          },
          "clearOnCreate": {
            "title": "Clear existing data when table exists (create mode only)",
            "type": "boolean",
            "description": "Only applies when operation is 'Create'. If true and the table already exists, all existing records will be deleted before importing (similar to 'Override' mode). If false and the table already exists, an error will be thrown. If the table does not exist, it will be created regardless of this setting.",
            "default": false
          },
          "base": {
            "title": "Airtable base name or ID",
            "type": "string",
            "description": "The ID or name of the Airtable base where data will be imported (for example: appXXXXXXXXXXXXXX)."
          },
          "table": {
            "title": "Airtable table name",
            "type": "string",
            "description": "Name of the Airtable table to import into. If operation is 'Create' and this table does not exist, the Actor will try to create it (if Airtable permissions and APIs allow)."
          },
          "datasetId": {
            "title": "Dataset",
            "type": "string",
            "description": "Select a dataset"
          },
          "uniqueId": {
            "title": "Unique ID source field (optional)",
            "type": "string",
            "description": "Source field (using dot notation, e.g. 'url' or 'metadata.headers.age') used to detect duplicates. If provided, the Actor reads the mapped target field in Airtable and skips records whose ID already exists there."
          },
          "dataMappings": {
            "title": "Field mappings",
            "type": "array",
            "description": "List of mappings from Apify dataset fields (source) to Airtable fields (target). 'source' uses dot notation (e.g. 'metadata.headers.age'), 'target' is the Airtable field name. 'targetType' is 'existing' or 'new'. 'fieldType' describes the Airtable field type (e.g. 'singleLineText', 'multilineText', 'number').",
            "items": {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string",
                  "title": "Source field",
                  "description": "Field path from the Apify dataset item. Supports dot notation (e.g. 'metadata.description').",
                  "editor": "textfield"
                },
                "target": {
                  "type": "string",
                  "title": "Target Airtable field",
                  "description": "Airtable field name where the value should be stored.",
                  "editor": "textfield"
                },
                "targetType": {
                  "type": "string",
                  "title": "Target type",
                  "description": "'existing' if the field already exists in Airtable, 'new' if it should be created when missing.",
                  "editor": "select",
                  "enum": [
                    "existing",
                    "new"
                  ]
                },
                "fieldType": {
                  "type": "string",
                  "title": "Field type",
                  "description": "Airtable field type to use when creating a new field (e.g. 'singleLineText', 'multilineText', 'number', 'checkbox').",
                  "editor": "select",
                  "enum": [
                    "singleLineText",
                    "multilineText",
                    "number",
                    "checkbox"
                  ]
                }
              },
              "required": [
                "source",
                "target",
                "targetType",
                "fieldType"
              ],
              "additionalProperties": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}