{
  "openapi": "3.1.2",
  "info": {
    "title": "ArchURL Workspace API",
    "version": "0.1.0",
    "description": "Workspace management on the configured control origin. Supply a scoped bearer credential. Operator provisioning, Stripe test reconciliation, and public redirect routes are covered in the operations and product guides."
  },
  "servers": [
    {
      "url": "/api/v1",
      "description": "Control origin workspace API"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/me": {
      "get": {
        "tags": [
          "Workspace"
        ],
        "summary": "Read the authenticated workspace and scopes",
        "operationId": "getMe",
        "x-archurl-scope": "authenticated",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Identity"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/entitlements": {
      "get": {
        "tags": [
          "Workspace"
        ],
        "summary": "Read plan allowances and usage",
        "operationId": "getEntitlements",
        "x-archurl-scope": "authenticated",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Entitlements"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/links": {
      "get": {
        "tags": [
          "Links"
        ],
        "summary": "List workspace links",
        "operationId": "getLinks",
        "x-archurl-scope": "links:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Link"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "post": {
        "tags": [
          "Links"
        ],
        "summary": "Create a link or save the first draft",
        "operationId": "postLinks",
        "x-archurl-scope": "links:write",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewLink"
              },
              "example": {
                "slug": "welcome",
                "destination": "https://example.com/welcome",
                "publish": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Link"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The required resource is missing or unavailable in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The workspace has reached an applicable plan limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/links/{id}": {
      "patch": {
        "tags": [
          "Links"
        ],
        "summary": "Edit the link and optionally publish a revision",
        "operationId": "patchLinksId",
        "x-archurl-scope": "links:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkEdit"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Link"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/links/{id}/publish": {
      "post": {
        "tags": [
          "Links"
        ],
        "summary": "Publish the latest revision",
        "operationId": "postLinksIdPublish",
        "x-archurl-scope": "links:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expectedRevision": {
                    "type": "integer",
                    "minimum": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Link"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/links/export.csv": {
      "get": {
        "tags": [
          "Links"
        ],
        "summary": "Download the workspace links CSV",
        "operationId": "getLinksExportCsv",
        "x-archurl-scope": "links:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/domains": {
      "get": {
        "tags": [
          "Domains"
        ],
        "summary": "List workspace domain claims",
        "operationId": "getDomains",
        "x-archurl-scope": "domains:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Domain"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "post": {
        "tags": [
          "Domains"
        ],
        "summary": "Create a domain claim and TXT challenge",
        "operationId": "postDomains",
        "x-archurl-scope": "domains:write",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hostname": {
                    "type": "string",
                    "format": "hostname"
                  }
                },
                "required": [
                  "hostname"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Domain"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/domains/{id}/verify": {
      "post": {
        "tags": [
          "Domains"
        ],
        "summary": "Verify the domain’s current DNS TXT challenge",
        "operationId": "postDomainsIdVerify",
        "x-archurl-scope": "domains:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Domain"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The workspace has reached an applicable plan limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "A configured service or local dependency is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/qr": {
      "get": {
        "tags": [
          "QR"
        ],
        "summary": "List QR codes",
        "operationId": "getQr",
        "x-archurl-scope": "qr:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Qr"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "post": {
        "tags": [
          "QR"
        ],
        "summary": "Create a static or dynamic QR code",
        "operationId": "postQr",
        "x-archurl-scope": "qr:write",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewQr"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Qr"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The required resource is missing or unavailable in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The workspace has reached an applicable plan limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/qr/{id}": {
      "patch": {
        "tags": [
          "QR"
        ],
        "summary": "Update style or a standalone dynamic destination",
        "operationId": "patchQrId",
        "x-archurl-scope": "qr:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "destination": {
                    "type": "string",
                    "format": "uri",
                    "description": "Absolute HTTP(S) URL."
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 160
                  },
                  "dark": {
                    "type": "string",
                    "pattern": "^#[a-fA-F0-9]{6}$"
                  },
                  "light": {
                    "type": "string",
                    "pattern": "^#[a-fA-F0-9]{6}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Qr"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          }
        }
      }
    },
    "/qr/{id}/image": {
      "get": {
        "tags": [
          "QR"
        ],
        "summary": "Download the QR image",
        "operationId": "getQrIdImage",
        "x-archurl-scope": "qr:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "svg",
                "png"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "image/svg+xml": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          }
        }
      }
    },
    "/analytics": {
      "get": {
        "tags": [
          "Reporting"
        ],
        "summary": "Read aggregate clicks and scans",
        "operationId": "getAnalytics",
        "x-archurl-scope": "links:read",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Inclusive UTC start date."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Inclusive UTC end date."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Analytics"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/jobs/preview": {
      "post": {
        "tags": [
          "Imports"
        ],
        "summary": "Validate CSV and preview each row",
        "operationId": "postJobsPreview",
        "x-archurl-scope": "links:write",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "mapping": {
                      "$ref": "#/components/schemas/ResolvedImportMapping"
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "ready": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "failed": {
                          "type": "integer",
                          "minimum": 0
                        }
                      }
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ImportRow"
                      }
                    }
                  },
                  "required": [
                    "mapping",
                    "counts",
                    "rows"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "413": {
            "description": "The request exceeds the accepted size limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/jobs": {
      "get": {
        "tags": [
          "Imports"
        ],
        "summary": "List workspace import jobs",
        "operationId": "getJobs",
        "x-archurl-scope": "links:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ImportJob"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "post": {
        "tags": [
          "Imports"
        ],
        "summary": "Save a durable CSV import job",
        "operationId": "postJobs",
        "description": "Supply an idempotency key in the header or body. Reuse it only for the same CSV and column mapping.",
        "x-archurl-scope": "links:write",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportJob"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The request exceeds the accepted size limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/jobs/{id}": {
      "get": {
        "tags": [
          "Imports"
        ],
        "summary": "Read import job and row outcomes",
        "operationId": "getJobsId",
        "x-archurl-scope": "links:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportJob"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          }
        }
      }
    },
    "/jobs/{id}/run": {
      "post": {
        "tags": [
          "Imports"
        ],
        "summary": "Run or resume the import job",
        "operationId": "postJobsIdRun",
        "x-archurl-scope": "links:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportJob"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/jobs/{id}/export.csv": {
      "get": {
        "tags": [
          "Imports"
        ],
        "summary": "Download row results as CSV",
        "operationId": "getJobsIdExportCsv",
        "x-archurl-scope": "links:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          }
        }
      }
    },
    "/campaigns": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "List workspace campaigns",
        "operationId": "getCampaigns",
        "x-archurl-scope": "campaigns:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Campaign"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Create a workspace campaign",
        "operationId": "postCampaigns",
        "x-archurl-scope": "campaigns:write",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 160
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/campaigns/{id}": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Read a campaign",
        "operationId": "getCampaignsId",
        "x-archurl-scope": "campaigns:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          }
        }
      }
    },
    "/campaigns/{id}/releases": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "List release proposals",
        "operationId": "getCampaignsIdReleases",
        "x-archurl-scope": "campaigns:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Release"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          }
        }
      },
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Save an exact release proposal",
        "operationId": "postCampaignsIdReleases",
        "x-archurl-scope": "campaigns:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "links": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/CampaignLinkInput"
                    },
                    "minItems": 1,
                    "maxItems": 50
                  }
                },
                "required": [
                  "links"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Release"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The request exceeds the accepted size limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/campaigns/{id}/releases/{releaseId}": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Review a stored release and receipts",
        "operationId": "getCampaignsIdReleasesReleaseId",
        "x-archurl-scope": "campaigns:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "releaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Release"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          }
        }
      }
    },
    "/campaigns/{id}/releases/{releaseId}/simulate": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Simulate routing against the stored proposal",
        "operationId": "postCampaignsIdReleasesReleaseIdSimulate",
        "x-archurl-scope": "campaigns:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "releaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contexts": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "device": {
                          "type": "string"
                        },
                        "language": {
                          "type": "string"
                        },
                        "country": {
                          "type": "string"
                        },
                        "bucket": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9999
                        }
                      },
                      "required": [
                        "at"
                      ]
                    }
                  }
                },
                "required": [
                  "contexts"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The request exceeds the accepted size limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/campaigns/{id}/releases/{releaseId}/approve": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Approve the exact proposal digest",
        "operationId": "postCampaignsIdReleasesReleaseIdApprove",
        "x-archurl-scope": "campaigns:approve",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "releaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "digest": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$"
                  }
                },
                "required": [
                  "digest"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReleaseReceipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/campaigns/{id}/releases/{releaseId}/publish": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Publish the approved links atomically",
        "operationId": "postCampaignsIdReleasesReleaseIdPublish",
        "x-archurl-scope": "campaigns:publish",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "releaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "digest": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$"
                  }
                },
                "required": [
                  "digest"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReleaseReceipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/campaigns/{id}/releases/{releaseId}/rollback": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Reverse a release when both revision pointers match",
        "operationId": "postCampaignsIdReleasesReleaseIdRollback",
        "x-archurl-scope": "campaigns:publish",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "releaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "digest": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$"
                  }
                },
                "required": [
                  "digest"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReleaseReceipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/pages": {
      "get": {
        "tags": [
          "Pages"
        ],
        "summary": "List workspace landing pages",
        "operationId": "getPages",
        "x-archurl-scope": "pages:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Page"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "post": {
        "tags": [
          "Pages"
        ],
        "summary": "Create an unpublished landing page draft",
        "operationId": "postPages",
        "x-archurl-scope": "pages:write",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hostname": {
                    "type": "string",
                    "format": "hostname"
                  },
                  "slug": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,64}$"
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 160
                  },
                  "heading": {
                    "type": "string"
                  },
                  "brand": {
                    "type": "string"
                  },
                  "blocks": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/PageBlock"
                    }
                  }
                },
                "required": [
                  "hostname",
                  "slug",
                  "title",
                  "blocks"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The required resource is missing or unavailable in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The request exceeds the accepted size limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/pages/{id}": {
      "get": {
        "tags": [
          "Pages"
        ],
        "summary": "Read landing page revisions and content",
        "operationId": "getPagesId",
        "x-archurl-scope": "pages:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          }
        }
      },
      "patch": {
        "tags": [
          "Pages"
        ],
        "summary": "Save a new page draft revision",
        "operationId": "patchPagesId",
        "x-archurl-scope": "pages:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expectedRevision": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 160
                  },
                  "heading": {
                    "type": "string"
                  },
                  "brand": {
                    "type": "string"
                  },
                  "blocks": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/PageBlock"
                    }
                  }
                },
                "required": [
                  "expectedRevision"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The request exceeds the accepted size limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/pages/{id}/publish": {
      "post": {
        "tags": [
          "Pages"
        ],
        "summary": "Publish the exact page draft",
        "operationId": "postPagesIdPublish",
        "x-archurl-scope": "pages:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expectedRevision": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "required": [
                  "expectedRevision"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/pages/{id}/cancel": {
      "post": {
        "tags": [
          "Pages"
        ],
        "summary": "Discard the exact page draft",
        "operationId": "postPagesIdCancel",
        "x-archurl-scope": "pages:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expectedRevision": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "required": [
                  "expectedRevision"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversions": {
      "get": {
        "tags": [
          "Reporting"
        ],
        "summary": "Read retained conversion aggregates",
        "operationId": "getConversions",
        "x-archurl-scope": "conversions:read",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Inclusive UTC start date."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Inclusive UTC end date."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversions"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "post": {
        "tags": [
          "Reporting"
        ],
        "summary": "Record a consented conversion or deduplicate a replay",
        "operationId": "postConversions",
        "x-archurl-scope": "conversions:write",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversionInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "recorded",
                        "duplicate"
                      ]
                    }
                  },
                  "required": [
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The required resource is missing or unavailable in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/print-proofs": {
      "get": {
        "tags": [
          "Print Proof"
        ],
        "summary": "List saved proof reports",
        "operationId": "getPrintProofs",
        "x-archurl-scope": "print:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Proof"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "post": {
        "tags": [
          "Print Proof"
        ],
        "summary": "Scan declared zones in an uploaded PDF",
        "operationId": "postPrintProofs",
        "x-archurl-scope": "print:write",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pdfBase64": {
                    "type": "string",
                    "contentEncoding": "base64",
                    "contentMediaType": "application/pdf",
                    "description": "Unencrypted PDF. At most 8 MiB decoded, 12 pages and 14 inches per page side."
                  },
                  "placements": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Placement"
                    },
                    "minItems": 1,
                    "maxItems": 32,
                    "description": "Fractions of the visible page measured from the top-left."
                  }
                },
                "required": [
                  "pdfBase64",
                  "placements"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Proof"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The required resource is missing or unavailable in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The request exceeds the accepted size limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "A configured service or local dependency is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/print-proofs/{id}": {
      "get": {
        "tags": [
          "Print Proof"
        ],
        "summary": "Read current proof and approval status",
        "operationId": "getPrintProofsId",
        "x-archurl-scope": "print:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Proof"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          }
        }
      }
    },
    "/print-proofs/{id}/approve": {
      "post": {
        "tags": [
          "Print Proof"
        ],
        "summary": "Approve an exact current passing proof",
        "operationId": "postPrintProofsIdApprove",
        "x-archurl-scope": "print:approve",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "digest": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$"
                  }
                },
                "required": [
                  "digest"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Proof"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/continuity/key": {
      "get": {
        "tags": [
          "Continuity"
        ],
        "summary": "Read the configured Ed25519 public key",
        "operationId": "getContinuityKey",
        "x-archurl-scope": "continuity:export",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "algorithm": {
                      "const": "Ed25519"
                    },
                    "keyId": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}$"
                    },
                    "publicKey": {
                      "type": "string"
                    },
                    "defaultTtlSeconds": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "maxTtlSeconds": {
                      "type": "integer",
                      "minimum": 1
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "description": "A configured service or local dependency is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/continuity/snapshots": {
      "post": {
        "tags": [
          "Continuity"
        ],
        "summary": "Issue a signed whole-workspace redirect edition",
        "operationId": "postContinuitySnapshots",
        "x-archurl-scope": "continuity:export",
        "parameters": [],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ttlSeconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 86400
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Snapshot"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "description": "A configured service or local dependency is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gs1": {
      "get": {
        "tags": [
          "Packaging"
        ],
        "summary": "List product destination records",
        "operationId": "getGs1",
        "x-archurl-scope": "gs1:read",
        "parameters": [
          {
            "name": "hostname",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "hostname"
            }
          },
          {
            "name": "gtin",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{14}$",
              "description": "GS1 modulo-10 check digit and leading zeroes are required."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Gs1Record"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "post": {
        "tags": [
          "Packaging"
        ],
        "summary": "Create a verified-host product or qualifier record",
        "operationId": "postGs1",
        "x-archurl-scope": "gs1:write",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Gs1Input"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Gs1Record"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The required resource is missing or unavailable in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gs1/{id}": {
      "get": {
        "tags": [
          "Packaging"
        ],
        "summary": "Read a product record",
        "operationId": "getGs1Id",
        "x-archurl-scope": "gs1:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Gs1Record"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          }
        }
      },
      "patch": {
        "tags": [
          "Packaging"
        ],
        "summary": "Append a product record revision",
        "operationId": "patchGs1Id",
        "x-archurl-scope": "gs1:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expectedRevision": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 160
                  },
                  "links": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "gs1:pip",
                            "gs1:instructions",
                            "gs1:nutritionalInfo",
                            "gs1:recallStatus",
                            "gs1:sustainabilityInfo",
                            "gs1:traceability"
                          ]
                        },
                        "title": {
                          "type": "string",
                          "maxLength": 160
                        },
                        "href": {
                          "type": "string",
                          "format": "uri",
                          "description": "Absolute HTTP(S) URL."
                        }
                      },
                      "required": [
                        "type",
                        "title",
                        "href"
                      ]
                    }
                  },
                  "defaultType": {
                    "type": "string",
                    "enum": [
                      "gs1:pip",
                      "gs1:instructions",
                      "gs1:nutritionalInfo",
                      "gs1:recallStatus",
                      "gs1:sustainabilityInfo",
                      "gs1:traceability"
                    ]
                  },
                  "active": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "expectedRevision"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Gs1Record"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gs1/{id}/history": {
      "get": {
        "tags": [
          "Packaging"
        ],
        "summary": "Read product record revision history",
        "operationId": "getGs1IdHistory",
        "x-archurl-scope": "gs1:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          }
        }
      }
    },
    "/team": {
      "get": {
        "tags": [
          "Teams"
        ],
        "summary": "List seat usage, members and pending invitations",
        "operationId": "getTeam",
        "x-archurl-scope": "teams:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "seats": {
                      "type": "object",
                      "properties": {
                        "limit": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "used": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "suspended": {
                          "type": "integer",
                          "minimum": 0
                        }
                      }
                    },
                    "members": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Member"
                      }
                    },
                    "invitations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Invitation"
                      }
                    }
                  },
                  "required": [
                    "seats",
                    "members",
                    "invitations"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/team/invitations": {
      "post": {
        "tags": [
          "Teams"
        ],
        "summary": "Issue an editor or viewer invitation",
        "operationId": "postTeamInvitations",
        "x-archurl-scope": "teams:write",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "editor",
                      "viewer"
                    ]
                  },
                  "expiresInHours": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 168
                  }
                },
                "required": [
                  "email",
                  "role"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invitation": {
                      "$ref": "#/components/schemas/Invitation"
                    },
                    "inviteToken": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "invitation",
                    "inviteToken"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The workspace has reached an applicable plan limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/team/invitations/accept": {
      "post": {
        "tags": [
          "Teams"
        ],
        "summary": "Accept an active invitation with a client-generated member secret",
        "operationId": "postTeamInvitationsAccept",
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "inviteToken": {
                    "type": "string"
                  },
                  "memberToken": {
                    "type": "string"
                  }
                },
                "required": [
                  "inviteToken",
                  "memberToken"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "workspaceId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "member": {
                      "$ref": "#/components/schemas/Member"
                    }
                  },
                  "required": [
                    "workspaceId",
                    "member"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "The invitation is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The workspace has reached an applicable plan limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/team/invitations/{id}": {
      "delete": {
        "tags": [
          "Teams"
        ],
        "summary": "Revoke an unused invitation",
        "operationId": "deleteTeamInvitationsId",
        "x-archurl-scope": "teams:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invitation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/team/members/{id}": {
      "delete": {
        "tags": [
          "Teams"
        ],
        "summary": "Remove a collaborator and revoke member access",
        "operationId": "deleteTeamMembersId",
        "x-archurl-scope": "teams:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Member"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Missing"
          },
          "409": {
            "description": "The requested action conflicts with current saved state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/exports/analytics.csv": {
      "get": {
        "tags": [
          "Exports"
        ],
        "summary": "Download retained daily click and scan aggregates",
        "operationId": "getExportsAnalyticsCsv",
        "x-archurl-scope": "exports:read + links:read",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Inclusive UTC start date."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Inclusive UTC end date."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "X-ArchURL-Report-From": {
                "description": "Effective inclusive UTC start.",
                "schema": {
                  "type": "string",
                  "format": "date"
                }
              },
              "X-ArchURL-Report-To": {
                "description": "Effective inclusive UTC end.",
                "schema": {
                  "type": "string",
                  "format": "date"
                }
              },
              "X-ArchURL-Report-Covered": {
                "description": "Whether the plan window covers any of the requested period.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/exports/conversions.csv": {
      "get": {
        "tags": [
          "Exports"
        ],
        "summary": "Download retained daily conversion aggregates",
        "operationId": "getExportsConversionsCsv",
        "x-archurl-scope": "exports:read + conversions:read",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Inclusive UTC start date."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Inclusive UTC end date."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "X-ArchURL-Report-From": {
                "description": "Effective inclusive UTC start.",
                "schema": {
                  "type": "string",
                  "format": "date"
                }
              },
              "X-ArchURL-Report-To": {
                "description": "Effective inclusive UTC end.",
                "schema": {
                  "type": "string",
                  "format": "date"
                }
              },
              "X-ArchURL-Report-Covered": {
                "description": "Whether the plan window covers any of the requested period.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/exports/workspace.json": {
      "get": {
        "tags": [
          "Exports"
        ],
        "summary": "Download the owner’s workspace inventory",
        "operationId": "getExportsWorkspaceJson",
        "description": "Includes current workspace asset metadata and retained report summaries. The bootstrap operator may export its own workspace.",
        "x-archurl-scope": "exports:read + workspace owner",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Inclusive UTC start date."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Inclusive UTC end date."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schemaVersion": {
                      "const": 1
                    },
                    "exportedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "workspace": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ]
                    },
                    "plan": {
                      "type": "string",
                      "enum": [
                        "free",
                        "plus"
                      ]
                    },
                    "entitlements": {
                      "type": "object"
                    },
                    "usage": {
                      "type": "object"
                    },
                    "reports": {
                      "type": "object",
                      "properties": {
                        "analytics": {
                          "anyOf": [
                            {
                              "type": "object"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "conversions": {
                          "anyOf": [
                            {
                              "type": "object"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      }
                    },
                    "assets": {
                      "type": "object",
                      "properties": {
                        "links": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "qr": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "pages": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "gs1": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "domains": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "schemaVersion",
                    "exportedAt",
                    "workspace",
                    "plan",
                    "entitlements",
                    "usage",
                    "reports",
                    "assets"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "A workspace-scoped ArchURL API key or member credential. See x-archurl-scope for each operation."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "object"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "Link": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "hostname": {
            "type": "string",
            "format": "hostname"
          },
          "slug": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,64}$"
          },
          "title": {
            "type": "string",
            "maxLength": 160
          },
          "destination": {
            "type": "string",
            "format": "uri",
            "description": "Absolute HTTP(S) URL."
          },
          "active": {
            "type": "boolean"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "publishedRevision": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "publicUrl": {
            "type": "string",
            "format": "uri",
            "description": "Absolute HTTP(S) URL."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "hostname",
          "slug",
          "destination",
          "revision",
          "publishedRevision",
          "publicUrl"
        ]
      },
      "NewLink": {
        "type": "object",
        "properties": {
          "hostname": {
            "type": "string",
            "format": "hostname"
          },
          "slug": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,64}$"
          },
          "title": {
            "type": "string",
            "maxLength": 160
          },
          "destination": {
            "type": "string",
            "format": "uri",
            "description": "Absolute HTTP(S) URL."
          },
          "publish": {
            "type": "boolean",
            "default": true
          }
        },
        "required": [
          "slug",
          "destination"
        ]
      },
      "LinkEdit": {
        "type": "object",
        "properties": {
          "destination": {
            "type": "string",
            "format": "uri",
            "description": "Absolute HTTP(S) URL."
          },
          "title": {
            "type": "string",
            "maxLength": 160
          },
          "active": {
            "type": "boolean"
          },
          "expectedRevision": {
            "type": "integer",
            "minimum": 1
          },
          "publish": {
            "type": "boolean"
          }
        }
      },
      "Domain": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "hostname": {
            "type": "string",
            "format": "hostname"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "verified",
              "revoked",
              "retired"
            ]
          },
          "verified": {
            "type": "boolean"
          },
          "verification": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "value"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "verifiedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "hostname",
          "status",
          "verified",
          "verification"
        ]
      },
      "Qr": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "type": "string",
            "enum": [
              "static",
              "dynamic"
            ]
          },
          "payload": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "linkId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "destination": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri",
                "description": "Absolute HTTP(S) URL."
              },
              {
                "type": "null"
              }
            ]
          },
          "hostname": {
            "anyOf": [
              {
                "type": "string",
                "format": "hostname"
              },
              {
                "type": "null"
              }
            ]
          },
          "label": {
            "type": "string",
            "maxLength": 160
          },
          "dark": {
            "type": "string",
            "pattern": "^#[a-fA-F0-9]{6}$"
          },
          "light": {
            "type": "string",
            "pattern": "^#[a-fA-F0-9]{6}$"
          },
          "token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "publicUrl": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri",
                "description": "Absolute HTTP(S) URL."
              },
              {
                "type": "null"
              }
            ]
          },
          "imageUrl": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "type",
          "imageUrl"
        ]
      },
      "NewQr": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "static"
              },
              "payload": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512,
                "description": "At most 512 UTF-8 bytes."
              },
              "label": {
                "type": "string",
                "maxLength": 160
              },
              "dark": {
                "type": "string",
                "pattern": "^#[a-fA-F0-9]{6}$"
              },
              "light": {
                "type": "string",
                "pattern": "^#[a-fA-F0-9]{6}$"
              }
            },
            "required": [
              "type",
              "payload"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "dynamic"
              },
              "destination": {
                "type": "string",
                "format": "uri",
                "description": "Absolute HTTP(S) URL."
              },
              "linkId": {
                "type": "string",
                "minLength": 1
              },
              "hostname": {
                "type": "string",
                "format": "hostname"
              },
              "label": {
                "type": "string",
                "maxLength": 160
              },
              "dark": {
                "type": "string",
                "pattern": "^#[a-fA-F0-9]{6}$"
              },
              "light": {
                "type": "string",
                "pattern": "^#[a-fA-F0-9]{6}$"
              }
            },
            "required": [
              "type"
            ],
            "oneOf": [
              {
                "required": [
                  "destination"
                ]
              },
              {
                "required": [
                  "linkId"
                ]
              }
            ]
          }
        ]
      },
      "Entitlements": {
        "type": "object",
        "properties": {
          "plan": {
            "type": "string",
            "enum": [
              "free",
              "plus"
            ]
          },
          "entitlements": {
            "type": "object",
            "properties": {
              "verifiedDomains": {
                "type": "integer",
                "minimum": 0
              },
              "dynamicQr": {
                "type": "integer",
                "minimum": 0
              },
              "linksPerMonth": {
                "type": "integer",
                "minimum": 0
              },
              "trackedPerMonth": {
                "type": "integer",
                "minimum": 0
              },
              "reportDays": {
                "type": "integer",
                "minimum": 0
              },
              "priceMonthlyUsd": {
                "type": "integer",
                "minimum": 0
              },
              "priceYearlyUsd": {
                "type": "integer",
                "minimum": 0
              },
              "seats": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "usage": {
            "type": "object"
          }
        },
        "required": [
          "plan",
          "entitlements",
          "usage"
        ]
      },
      "AnalyticsRow": {
        "type": "object",
        "properties": {
          "day": {
            "type": "string",
            "format": "date"
          },
          "kind": {
            "type": "string",
            "enum": [
              "click",
              "scan"
            ]
          },
          "linkId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "qrId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "count": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "day",
          "kind",
          "linkId",
          "qrId",
          "revision",
          "count"
        ]
      },
      "Analytics": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "covered": {
            "type": "boolean"
          },
          "totals": {
            "type": "object",
            "properties": {
              "clicks": {
                "type": "integer",
                "minimum": 0
              },
              "scans": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsRow"
            }
          },
          "usage": {
            "type": "object"
          }
        },
        "required": [
          "from",
          "to",
          "covered",
          "totals",
          "items",
          "usage"
        ]
      },
      "ImportInput": {
        "type": "object",
        "properties": {
          "csv": {
            "type": "string",
            "description": "CSV up to 256 KiB and 500 data rows."
          },
          "idempotencyKey": {
            "type": "string"
          },
          "mapping": {
            "type": "object",
            "properties": {
              "destination": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 64
                  }
                ]
              },
              "hostname": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 64
                  }
                ]
              },
              "slug": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 64
                  }
                ]
              },
              "shortUrl": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 64
                  }
                ]
              },
              "title": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 64
                  }
                ]
              }
            },
            "required": [
              "destination"
            ],
            "description": "Use column header names or one-based indexes. Map destination with shortUrl, or with both hostname and slug."
          }
        },
        "required": [
          "csv"
        ]
      },
      "Campaign": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "maxLength": 160
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdBy": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "Routing": {
        "type": "object",
        "properties": {
          "rules": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "when": {
                  "type": "object",
                  "properties": {
                    "countries": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "languages": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "devices": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "mobile",
                          "tablet",
                          "desktop"
                        ]
                      }
                    },
                    "startsAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "endsAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "variants": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "destination": {
                        "type": "string",
                        "format": "uri",
                        "description": "Absolute HTTP(S) URL."
                      },
                      "weight": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 10000
                      }
                    },
                    "required": [
                      "destination",
                      "weight"
                    ]
                  }
                }
              },
              "required": [
                "when",
                "variants"
              ]
            }
          }
        },
        "required": [
          "rules"
        ]
      },
      "CampaignLinkInput": {
        "type": "object",
        "properties": {
          "linkId": {
            "type": "string",
            "minLength": 1
          },
          "expectedLatestRevision": {
            "type": "integer",
            "minimum": 1
          },
          "expectedPublishedRevision": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "destination": {
            "type": "string",
            "format": "uri",
            "description": "Absolute HTTP(S) URL."
          },
          "title": {
            "type": "string",
            "maxLength": 160
          },
          "routing": {
            "$ref": "#/components/schemas/Routing"
          }
        },
        "required": [
          "linkId",
          "expectedLatestRevision",
          "expectedPublishedRevision",
          "destination",
          "title"
        ]
      },
      "Release": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "campaignId": {
            "type": "string",
            "minLength": 1
          },
          "digest": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "proposal": {
            "type": "object"
          },
          "status": {
            "type": "string",
            "enum": [
              "proposed",
              "approved",
              "published",
              "rolled_back"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdBy": {
            "type": "string",
            "minLength": 1
          },
          "receipts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReleaseReceipt"
            }
          }
        },
        "required": [
          "id",
          "campaignId",
          "digest",
          "proposal",
          "status",
          "receipts"
        ]
      },
      "ReleaseReceipt": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "action": {
            "type": "string",
            "enum": [
              "approve",
              "publish",
              "rollback"
            ]
          },
          "digest": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "actorId": {
            "type": "string",
            "minLength": 1
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "links": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "required": [
          "id",
          "action",
          "digest",
          "actorId",
          "at",
          "links"
        ]
      },
      "PageBlock": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "text"
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "text"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "link"
              },
              "label": {
                "type": "string",
                "maxLength": 160
              },
              "href": {
                "type": "string",
                "format": "uri",
                "description": "Absolute HTTP(S) URL."
              }
            },
            "required": [
              "type",
              "label",
              "href"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "image"
              },
              "src": {
                "type": "string",
                "format": "uri",
                "description": "Absolute HTTP(S) URL."
              },
              "alt": {
                "type": "string",
                "maxLength": 160
              }
            },
            "required": [
              "type",
              "src",
              "alt"
            ]
          }
        ]
      },
      "Page": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "hostname": {
            "type": "string",
            "format": "hostname"
          },
          "path": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,64}$"
          },
          "title": {
            "type": "string",
            "maxLength": 160
          },
          "heading": {
            "type": "string"
          },
          "brand": {
            "type": "string"
          },
          "draftRevision": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "publishedRevision": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "blocks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PageBlock"
            }
          }
        },
        "required": [
          "id",
          "hostname",
          "path",
          "draftRevision",
          "publishedRevision"
        ]
      },
      "ConversionInput": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "minLength": 1
          },
          "kind": {
            "type": "string",
            "enum": [
              "lead",
              "signup",
              "sale",
              "refund"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "manual",
              "integrated"
            ],
            "default": "manual"
          },
          "consent": {
            "const": true
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "pageId": {
            "type": "string",
            "minLength": 1
          },
          "linkId": {
            "type": "string",
            "minLength": 1
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "amountMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000000
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          }
        },
        "required": [
          "eventId",
          "kind",
          "consent",
          "occurredAt"
        ],
        "oneOf": [
          {
            "required": [
              "linkId",
              "revision"
            ],
            "not": {
              "required": [
                "pageId"
              ]
            }
          },
          {
            "required": [
              "pageId"
            ],
            "not": {
              "required": [
                "linkId"
              ]
            }
          }
        ],
        "dependentRequired": {
          "amountMinor": [
            "currency"
          ],
          "currency": [
            "amountMinor"
          ]
        },
        "if": {
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "lead",
                "signup"
              ]
            }
          }
        },
        "then": {
          "not": {
            "anyOf": [
              {
                "required": [
                  "amountMinor"
                ]
              },
              {
                "required": [
                  "currency"
                ]
              }
            ]
          }
        }
      },
      "Placement": {
        "type": "object",
        "properties": {
          "qrId": {
            "type": "string",
            "minLength": 1
          },
          "page": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12
          },
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          },
          "width": {
            "type": "number"
          },
          "height": {
            "type": "number"
          }
        },
        "required": [
          "qrId",
          "page",
          "x",
          "y",
          "width",
          "height"
        ]
      },
      "Proof": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "artifactSha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "digest": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "failed",
              "ready",
              "approved",
              "needs_review"
            ]
          },
          "placements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Placement",
              "properties": {
                "expectedUrl": {
                  "type": "string",
                  "format": "uri",
                  "description": "Absolute HTTP(S) URL."
                },
                "binding": {
                  "type": "object"
                },
                "widthMm": {
                  "type": "number"
                },
                "heightMm": {
                  "type": "number"
                },
                "symbolWidthMm": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "sizeWarning": {
                  "type": "boolean"
                },
                "samples": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "dpi": {
                        "type": "integer",
                        "enum": [
                          150,
                          300
                        ]
                      },
                      "result": {
                        "type": "string",
                        "enum": [
                          "match",
                          "unreadable",
                          "unexpected_qr",
                          "multiple_qrs"
                        ]
                      }
                    },
                    "required": [
                      "dpi",
                      "result"
                    ]
                  }
                }
              }
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdBy": {
            "type": "string",
            "minLength": 1
          },
          "approval": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "digest": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$"
                  },
                  "approvedAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "approvedBy": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "artifactSha256",
          "digest",
          "status",
          "placements",
          "createdAt",
          "createdBy",
          "approval"
        ]
      },
      "Snapshot": {
        "type": "object",
        "properties": {
          "payload": {
            "type": "object",
            "properties": {
              "format": {
                "const": "archurl-continuity-v1"
              },
              "workspaceId": {
                "type": "string",
                "minLength": 1
              },
              "edition": {
                "type": "integer",
                "minimum": 1
              },
              "issuedAt": {
                "type": "string",
                "format": "date-time"
              },
              "expiresAt": {
                "type": "string",
                "format": "date-time"
              },
              "hosts": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            },
            "required": [
              "format",
              "workspaceId",
              "edition",
              "issuedAt",
              "expiresAt",
              "hosts"
            ]
          },
          "keyId": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "digest": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "signature": {
            "type": "string"
          }
        },
        "required": [
          "payload",
          "keyId",
          "digest",
          "signature"
        ]
      },
      "Gs1Input": {
        "type": "object",
        "properties": {
          "hostname": {
            "type": "string",
            "format": "hostname"
          },
          "gtin": {
            "type": "string",
            "pattern": "^[0-9]{14}$",
            "description": "GS1 modulo-10 check digit and leading zeroes are required."
          },
          "lot": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9._-]{1,20}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "serial": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9._-]{1,20}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "type": "string",
            "maxLength": 160
          },
          "links": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "gs1:pip",
                    "gs1:instructions",
                    "gs1:nutritionalInfo",
                    "gs1:recallStatus",
                    "gs1:sustainabilityInfo",
                    "gs1:traceability"
                  ]
                },
                "title": {
                  "type": "string",
                  "maxLength": 160
                },
                "href": {
                  "type": "string",
                  "format": "uri",
                  "description": "Absolute HTTP(S) URL."
                }
              },
              "required": [
                "type",
                "title",
                "href"
              ]
            }
          },
          "defaultType": {
            "type": "string",
            "enum": [
              "gs1:pip",
              "gs1:instructions",
              "gs1:nutritionalInfo",
              "gs1:recallStatus",
              "gs1:sustainabilityInfo",
              "gs1:traceability"
            ]
          },
          "active": {
            "type": "boolean"
          }
        },
        "required": [
          "hostname",
          "gtin",
          "title",
          "links",
          "defaultType"
        ]
      },
      "Gs1Record": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "hostname": {
            "type": "string",
            "format": "hostname"
          },
          "gtin": {
            "type": "string",
            "pattern": "^[0-9]{14}$",
            "description": "GS1 modulo-10 check digit and leading zeroes are required."
          },
          "lot": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9._-]{1,20}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "serial": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9._-]{1,20}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "type": "string",
            "maxLength": 160
          },
          "path": {
            "type": "string"
          },
          "links": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "gs1:pip",
                    "gs1:instructions",
                    "gs1:nutritionalInfo",
                    "gs1:recallStatus",
                    "gs1:sustainabilityInfo",
                    "gs1:traceability"
                  ]
                },
                "title": {
                  "type": "string",
                  "maxLength": 160
                },
                "href": {
                  "type": "string",
                  "format": "uri",
                  "description": "Absolute HTTP(S) URL."
                }
              },
              "required": [
                "type",
                "title",
                "href"
              ]
            }
          },
          "defaultType": {
            "type": "string",
            "enum": [
              "gs1:pip",
              "gs1:instructions",
              "gs1:nutritionalInfo",
              "gs1:recallStatus",
              "gs1:sustainabilityInfo",
              "gs1:traceability"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "hostname",
          "gtin",
          "path",
          "links",
          "defaultType",
          "revision"
        ]
      },
      "Member": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "editor",
              "viewer"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "suspended",
              "removed"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "removedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "workspaceId",
          "email",
          "role",
          "status"
        ]
      },
      "Invitation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "editor",
              "viewer"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "accepted",
              "revoked",
              "expired"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "acceptedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "revokedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "workspaceId",
          "email",
          "role",
          "status",
          "expiresAt"
        ]
      },
      "ResolvedImportMapping": {
        "type": "object",
        "properties": {
          "destination": {
            "type": "integer",
            "minimum": 1,
            "maximum": 64
          },
          "hostname": {
            "type": "integer",
            "minimum": 1,
            "maximum": 64
          },
          "slug": {
            "type": "integer",
            "minimum": 1,
            "maximum": 64
          },
          "shortUrl": {
            "type": "integer",
            "minimum": 1,
            "maximum": 64
          },
          "title": {
            "type": "integer",
            "minimum": 1,
            "maximum": 64
          }
        },
        "required": [
          "destination"
        ]
      },
      "Identity": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Entitlements"
          },
          {
            "type": "object",
            "properties": {
              "actorId": {
                "type": "string",
                "minLength": 1
              },
              "workspaceId": {
                "type": "string",
                "minLength": 1
              },
              "workspace": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "origin": {
                "type": "string",
                "format": "uri",
                "description": "Absolute HTTP(S) URL."
              },
              "authType": {
                "type": "string",
                "enum": [
                  "bootstrap",
                  "api_key",
                  "member"
                ]
              },
              "role": {
                "type": "string",
                "enum": [
                  "owner",
                  "editor",
                  "viewer"
                ]
              }
            },
            "required": [
              "actorId",
              "workspaceId",
              "workspace",
              "scopes",
              "authType",
              "origin"
            ]
          }
        ]
      },
      "ImportRow": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "rowNumber": {
            "type": "integer",
            "minimum": 1
          },
          "hostname": {
            "anyOf": [
              {
                "type": "string",
                "format": "hostname"
              },
              {
                "type": "null"
              }
            ]
          },
          "slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "destination": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "linkId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "ready",
              "pending",
              "succeeded",
              "failed"
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "code",
                  "message"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "retryable": {
            "type": "boolean"
          }
        },
        "required": [
          "rowNumber",
          "status",
          "error",
          "retryable"
        ]
      },
      "ImportJob": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "complete",
              "failed",
              "partial"
            ]
          },
          "createdBy": {
            "type": "string",
            "minLength": 1
          },
          "lastRunBy": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "mapping": {
            "$ref": "#/components/schemas/ResolvedImportMapping"
          },
          "counts": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0
              },
              "pending": {
                "type": "integer",
                "minimum": 0
              },
              "succeeded": {
                "type": "integer",
                "minimum": 0
              },
              "failed": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "total",
              "pending",
              "succeeded",
              "failed"
            ]
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportRow"
            }
          }
        },
        "required": [
          "id",
          "status",
          "counts",
          "mapping"
        ]
      },
      "Conversions": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "covered": {
            "type": "boolean"
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "day": {
                  "type": "string",
                  "format": "date"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "lead",
                    "signup",
                    "sale",
                    "refund"
                  ]
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "manual",
                    "integrated"
                  ],
                  "default": "manual"
                },
                "linkId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "pageId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "revision": {
                  "type": "integer",
                  "minimum": 1
                },
                "currency": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "count": {
                  "type": "integer",
                  "minimum": 0
                },
                "amountMinor": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "day",
                "kind",
                "source",
                "linkId",
                "pageId",
                "revision",
                "currency",
                "count",
                "amountMinor"
              ]
            }
          }
        },
        "required": [
          "from",
          "to",
          "covered",
          "total",
          "items"
        ]
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "The required credential is missing, expired, revoked, or otherwise unavailable.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The authenticated actor lacks permission for this action.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Invalid": {
        "description": "Invalid request parameters or JSON body.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Missing": {
        "description": "The resource is missing or unavailable to this workspace.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
