{
  "createSend": {
    "post": {
      "operationId": "createSend",
      "tags": [
        "Sends"
      ],
      "summary": "Submit a URL or text for parsing",
      "description": "Requires sends:create or equivalent write access. The receipt contains the pending send record. Read that record to check parse status and results, including an owner-native save_id when available. A retry references an extraction-failed send created by this connection. Supply a new idempotency key and reuse it when repeating that retry request.",
      "parameters": [
        {
          "$ref": "../components/parameters.yaml#/UuidIdempotencyKey"
        }
      ],
      "requestBody": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "type": "object",
                  "required": [
                    "url"
                  ],
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "note": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "text"
                  ],
                  "properties": {
                    "text": {
                      "type": "string",
                      "minLength": 1
                    },
                    "note": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "retry_of"
                  ],
                  "properties": {
                    "retry_of": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Hub UUID of the failed send."
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          }
        }
      },
      "responses": {
        "200": {
          "description": "Successful receipt. When fair use is enabled the receipt also includes delayed (boolean) and estimate_seconds (integer or null), including on idempotent replay.",
          "headers": {
            "request-id": {
              "$ref": "../components/headers.yaml#/RequestId"
            },
            "Cache-Control": {
              "$ref": "../components/headers.yaml#/CacheControl"
            }
          },
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "../components/schemas.yaml#/OperationReceipt"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "delayed": {
                        "type": "boolean"
                      },
                      "estimate_seconds": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 1
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "400": {
          "description": "The request could not be parsed or contains an invalid parameter.",
          "headers": {
            "request-id": {
              "$ref": "../components/headers.yaml#/RequestId"
            },
            "Cache-Control": {
              "$ref": "../components/headers.yaml#/CacheControl"
            }
          },
          "content": {
            "application/problem+json": {
              "schema": {
                "$ref": "../components/schemas.yaml#/Problem"
              }
            }
          },
          "x-error-codes": [
            "invalid_idempotency_key",
            "invalid_json"
          ]
        },
        "401": {
          "$ref": "../components/responses.yaml#/Hub401"
        },
        "403": {
          "description": "The active credential or configuration does not permit this action.",
          "headers": {
            "request-id": {
              "$ref": "../components/headers.yaml#/RequestId"
            },
            "Cache-Control": {
              "$ref": "../components/headers.yaml#/CacheControl"
            }
          },
          "content": {
            "application/problem+json": {
              "schema": {
                "$ref": "../components/schemas.yaml#/Problem"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "../components/schemas.yaml#/Problem"
              }
            }
          },
          "x-error-codes": [
            "connection_disconnected",
            "connection_required",
            "namespace_denied",
            "sapphire_account_required",
            "scope_denied"
          ]
        },
        "404": {
          "description": "The send referenced for retry could not be found.",
          "headers": {
            "request-id": {
              "$ref": "../components/headers.yaml#/RequestId"
            },
            "Cache-Control": {
              "$ref": "../components/headers.yaml#/CacheControl"
            }
          },
          "content": {
            "application/problem+json": {
              "schema": {
                "$ref": "../components/schemas.yaml#/Problem"
              }
            }
          },
          "x-error-codes": [
            "not_found"
          ]
        },
        "409": {
          "description": "The request conflicts with the current state.",
          "headers": {
            "request-id": {
              "$ref": "../components/headers.yaml#/RequestId"
            },
            "Cache-Control": {
              "$ref": "../components/headers.yaml#/CacheControl"
            }
          },
          "content": {
            "application/problem+json": {
              "schema": {
                "$ref": "../components/schemas.yaml#/Problem"
              }
            }
          },
          "x-error-codes": [
            "pigeon_owner_mapping_required",
            "reuse_check_required",
            "send_not_retryable",
            "source_check_failed",
            "source_identity_conflict",
            "source_withdrawn"
          ]
        },
        "410": {
          "$ref": "../components/responses.yaml#/Hub410"
        },
        "413": {
          "description": "The request or its resulting work exceeds a size limit.",
          "headers": {
            "request-id": {
              "$ref": "../components/headers.yaml#/RequestId"
            },
            "Cache-Control": {
              "$ref": "../components/headers.yaml#/CacheControl"
            }
          },
          "content": {
            "application/problem+json": {
              "schema": {
                "$ref": "../components/schemas.yaml#/Problem"
              }
            }
          },
          "x-error-codes": [
            "body_too_large",
            "operation_too_large",
            "reference_work_exceeded"
          ]
        },
        "422": {
          "description": "The request violates a protocol or data rule.",
          "headers": {
            "request-id": {
              "$ref": "../components/headers.yaml#/RequestId"
            },
            "Cache-Control": {
              "$ref": "../components/headers.yaml#/CacheControl"
            }
          },
          "content": {
            "application/problem+json": {
              "schema": {
                "$ref": "../components/schemas.yaml#/Problem"
              }
            }
          },
          "x-error-codes": [
            "body_invalid",
            "dangling_reference",
            "idempotency_key_reused",
            "invalid_body",
            "invalid_request",
            "invalid_url",
            "unsupported_schema"
          ]
        },
        "429": {
          "description": "The sponsoring account has reached its waiting-job cap or explicit retry limit.",
          "headers": {
            "Retry-After": {
              "$ref": "../components/headers.yaml#/RetryAfter"
            }
          },
          "content": {
            "application/problem+json": {
              "schema": {
                "$ref": "../components/schemas.yaml#/Problem"
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "error",
                  "retryAfterSeconds"
                ],
                "properties": {
                  "error": {
                    "const": "rate_limited"
                  },
                  "retryAfterSeconds": {
                    "type": "integer",
                    "minimum": 1
                  }
                }
              }
            }
          }
        },
        "503": {
          "description": "The hub or an operation dependency is unavailable.",
          "headers": {
            "request-id": {
              "$ref": "../components/headers.yaml#/RequestId"
            },
            "Cache-Control": {
              "$ref": "../components/headers.yaml#/CacheControl"
            },
            "Retry-After": {
              "$ref": "../components/headers.yaml#/RetryAfter"
            }
          },
          "content": {
            "application/problem+json": {
              "schema": {
                "$ref": "../components/schemas.yaml#/Problem"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "../components/schemas.yaml#/Problem"
              }
            }
          },
          "x-error-codes": [
            "hub_not_configured",
            "hub_not_ready",
            "internal_error",
            "ledger_unavailable"
          ]
        }
      }
    }
  }
}
