{
  "openapi": "3.1.0",
  "info": {
    "title": "packagepage API",
    "version": "v1",
    "description": "The routes mounted under /v1. 26 accept an API key. The others take a signed-in session."
  },
  "servers": [
    {
      "url": "https://app.packagepage.com"
    }
  ],
  "tags": [
    {
      "name": "Orgs"
    },
    {
      "name": "Me"
    },
    {
      "name": "Invites"
    },
    {
      "name": "ApiKeys"
    },
    {
      "name": "Webhooks"
    },
    {
      "name": "CompanyPrefixes"
    },
    {
      "name": "Products"
    },
    {
      "name": "Media"
    },
    {
      "name": "Imports"
    },
    {
      "name": "LinkTypes"
    },
    {
      "name": "Recalls"
    },
    {
      "name": "Artwork"
    },
    {
      "name": "AuditLog"
    },
    {
      "name": "Domains"
    },
    {
      "name": "Subscription"
    },
    {
      "name": "Usage"
    },
    {
      "name": "Analytics"
    },
    {
      "name": "Billing"
    }
  ],
  "paths": {
    "/v1/orgs": {
      "post": {
        "operationId": "postOrgs",
        "summary": "Creates an organisation with the signed-in user as its owner.",
        "tags": [
          "Orgs"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ]
          },
          "409": {
            "description": "That conflicts with something that already exists",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "CONFLICT",
                "type": "https://packagepage.com/problems/conflict"
              }
            ]
          }
        }
      }
    },
    "/v1/me/orgs": {
      "get": {
        "operationId": "getMeOrgs",
        "summary": "Lists the organisations the signed-in user belongs to.",
        "tags": [
          "Me"
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "orgs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "owner",
                              "admin",
                              "editor",
                              "analyst",
                              "billing"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "slug",
                          "role"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "orgs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ]
          }
        }
      }
    },
    "/v1/invites/accept": {
      "post": {
        "operationId": "postInvitesAccept",
        "summary": "Accepts an invitation and adds the signed-in user to its organisation.",
        "tags": [
          "Invites"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{43}$"
                  }
                },
                "required": [
                  "token"
                ],
                "additionalProperties": false,
                "description": "POST /v1/invites/accept — join the organisation an invitation names."
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "orgId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "orgName": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string",
                      "enum": [
                        "owner",
                        "admin",
                        "editor",
                        "analyst",
                        "billing"
                      ]
                    }
                  },
                  "required": [
                    "orgId",
                    "orgName",
                    "role"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. That invitation was sent to a different email address",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              },
              {
                "code": "INVITE_EMAIL_MISMATCH",
                "type": "https://packagepage.com/problems/invite-email-mismatch"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "That invitation has expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "INVITE_EXPIRED",
                "type": "https://packagepage.com/problems/invite-expired"
              }
            ]
          }
        }
      }
    },
    "/v1/invites": {
      "get": {
        "operationId": "getInvites",
        "summary": "Lists the invitations an organisation has sent.",
        "tags": [
          "Invites"
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invites": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "email": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "owner",
                              "admin",
                              "editor",
                              "analyst",
                              "billing"
                            ]
                          },
                          "sentAt": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          },
                          "expiresAt": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          }
                        },
                        "required": [
                          "id",
                          "email",
                          "role",
                          "sentAt",
                          "expiresAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "invites"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          }
        }
      },
      "post": {
        "operationId": "postInvites",
        "summary": "Invites a person to the organisation by email.",
        "tags": [
          "Invites"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "role": {
                    "default": "editor",
                    "type": "string",
                    "enum": [
                      "owner",
                      "admin",
                      "editor",
                      "analyst",
                      "billing"
                    ]
                  }
                },
                "required": [
                  "email"
                ],
                "additionalProperties": false,
                "description": "POST /v1/invites — invite someone to this organisation by email."
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "email": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string",
                      "enum": [
                        "owner",
                        "admin",
                        "editor",
                        "analyst",
                        "billing"
                      ]
                    },
                    "sentAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                    },
                    "expiresAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                    }
                  },
                  "required": [
                    "id",
                    "email",
                    "role",
                    "sentAt",
                    "expiresAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "409": {
            "description": "That conflicts with something that already exists",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "CONFLICT",
                "type": "https://packagepage.com/problems/conflict"
              }
            ]
          }
        }
      }
    },
    "/v1/invites/{inviteId}/resend": {
      "post": {
        "operationId": "postInvitesByInviteIdResend",
        "summary": "Sends an open invitation again.",
        "tags": [
          "Invites"
        ],
        "parameters": [
          {
            "name": "inviteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "email": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string",
                      "enum": [
                        "owner",
                        "admin",
                        "editor",
                        "analyst",
                        "billing"
                      ]
                    },
                    "sentAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                    },
                    "expiresAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                    }
                  },
                  "required": [
                    "id",
                    "email",
                    "role",
                    "sentAt",
                    "expiresAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          }
        }
      }
    },
    "/v1/invites/{inviteId}": {
      "delete": {
        "operationId": "deleteInvitesByInviteId",
        "summary": "Revokes an open invitation.",
        "tags": [
          "Invites"
        ],
        "parameters": [
          {
            "name": "inviteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          }
        }
      }
    },
    "/v1/api-keys": {
      "get": {
        "operationId": "getApiKeys",
        "summary": "Lists the organisation's API keys without their secrets.",
        "tags": [
          "ApiKeys"
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "keys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "scopes": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "read:products",
                                "write:products",
                                "read:links",
                                "write:links",
                                "read:analytics",
                                "read:recalls",
                                "write:recalls",
                                "read:webhooks",
                                "write:webhooks"
                              ]
                            }
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          },
                          "lastUsedAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "expiresAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "revokedAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "callsThisWindow": {
                            "type": "integer",
                            "minimum": 0
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "scopes",
                          "createdAt",
                          "lastUsedAt",
                          "expiresAt",
                          "revokedAt",
                          "callsThisWindow"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "keys"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          }
        }
      },
      "post": {
        "operationId": "postApiKeys",
        "summary": "Mints an API key and returns its secret once.",
        "tags": [
          "ApiKeys"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "scopes": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "read:products",
                        "write:products",
                        "read:links",
                        "write:links",
                        "read:analytics",
                        "read:recalls",
                        "write:recalls",
                        "read:webhooks",
                        "write:webhooks"
                      ]
                    }
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  }
                },
                "required": [
                  "name",
                  "scopes"
                ],
                "additionalProperties": false,
                "description": "POST /v1/api-keys — mint a key. The plaintext is returned once."
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "scopes": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "read:products",
                          "write:products",
                          "read:links",
                          "write:links",
                          "read:analytics",
                          "read:recalls",
                          "write:recalls",
                          "read:webhooks",
                          "write:webhooks"
                        ]
                      }
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                    },
                    "lastUsedAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "expiresAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "revokedAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "callsThisWindow": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "key": {
                      "type": "string",
                      "pattern": "^g2d_live_[A-Za-z0-9_-]{43}$"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "scopes",
                    "createdAt",
                    "lastUsedAt",
                    "expiresAt",
                    "revokedAt",
                    "callsThisWindow",
                    "key"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. That is included from a higher plan. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              },
              {
                "code": "PLAN_GATED",
                "type": "https://packagepage.com/problems/plan-gated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          }
        }
      }
    },
    "/v1/api-keys/{keyId}": {
      "delete": {
        "operationId": "deleteApiKeysByKeyId",
        "summary": "Revokes an API key.",
        "tags": [
          "ApiKeys"
        ],
        "parameters": [
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          }
        }
      }
    },
    "/v1/webhooks": {
      "get": {
        "operationId": "getWebhooks",
        "summary": "Lists the organisation's webhook endpoints without their secrets.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "apiKey": [
              "read:webhooks"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhooks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "url": {
                            "type": "string"
                          },
                          "events": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "product.published",
                                "link.changed",
                                "import.completed",
                                "domain.live",
                                "subscription.changed"
                              ]
                            }
                          },
                          "active": {
                            "type": "boolean"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          },
                          "lastDeliveryAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "pendingDeliveries": {
                            "type": "integer",
                            "minimum": 0
                          }
                        },
                        "required": [
                          "id",
                          "url",
                          "events",
                          "active",
                          "createdAt",
                          "lastDeliveryAt",
                          "pendingDeliveries"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "webhooks"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      },
      "post": {
        "operationId": "postWebhooks",
        "summary": "Registers a webhook endpoint and returns its signing secret once.",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "events": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "product.published",
                        "link.changed",
                        "import.completed",
                        "domain.live",
                        "subscription.changed"
                      ]
                    }
                  }
                },
                "required": [
                  "url",
                  "events"
                ],
                "additionalProperties": false,
                "description": "POST /v1/webhooks — add an endpoint. The signing secret is returned once."
              }
            }
          }
        },
        "security": [
          {
            "apiKey": [
              "write:webhooks"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "url": {
                      "type": "string"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "product.published",
                          "link.changed",
                          "import.completed",
                          "domain.live",
                          "subscription.changed"
                        ]
                      }
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                    },
                    "lastDeliveryAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "pendingDeliveries": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "secret": {
                      "type": "string",
                      "pattern": "^whsec_[A-Za-z0-9_-]{43}$"
                    }
                  },
                  "required": [
                    "id",
                    "url",
                    "events",
                    "active",
                    "createdAt",
                    "lastDeliveryAt",
                    "pendingDeliveries",
                    "secret"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. That is included from a higher plan. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              },
              {
                "code": "PLAN_GATED",
                "type": "https://packagepage.com/problems/plan-gated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/webhooks/{id}/rotate-secret": {
      "post": {
        "operationId": "postWebhooksByIdRotateSecret",
        "summary": "Replaces a webhook endpoint's signing secret and returns the new one once.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "write:webhooks"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "secret": {
                      "type": "string",
                      "pattern": "^whsec_[A-Za-z0-9_-]{43}$"
                    }
                  },
                  "required": [
                    "id",
                    "secret"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. That is included from a higher plan. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              },
              {
                "code": "PLAN_GATED",
                "type": "https://packagepage.com/problems/plan-gated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/webhooks/{id}": {
      "delete": {
        "operationId": "deleteWebhooksById",
        "summary": "Deletes a webhook endpoint and its delivery history.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "write:webhooks"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/orgs/{orgId}/members": {
      "get": {
        "operationId": "getOrgsByOrgIdMembers",
        "summary": "Lists the members of an organisation and their roles.",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "members": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "userId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "name": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "email": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "owner",
                              "admin",
                              "editor",
                              "analyst",
                              "billing"
                            ]
                          },
                          "lastActiveAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "userId",
                          "name",
                          "email",
                          "role",
                          "lastActiveAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "members"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          }
        }
      }
    },
    "/v1/orgs/{orgId}/members/{userId}": {
      "patch": {
        "operationId": "patchOrgsByOrgIdMembersByUserId",
        "summary": "Changes a member's role.",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "owner",
                      "admin",
                      "editor",
                      "analyst",
                      "billing"
                    ]
                  }
                },
                "required": [
                  "userId",
                  "role"
                ],
                "additionalProperties": false,
                "description": "PATCH /v1/orgs/{id}/members/{userId} — change one member's role."
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "An organisation needs at least one owner",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "LAST_OWNER",
                "type": "https://packagepage.com/problems/last-owner"
              }
            ]
          }
        }
      },
      "delete": {
        "operationId": "deleteOrgsByOrgIdMembersByUserId",
        "summary": "Removes a member from the organisation.",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "An organisation needs at least one owner",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "LAST_OWNER",
                "type": "https://packagepage.com/problems/last-owner"
              }
            ]
          }
        }
      }
    },
    "/v1/orgs/{orgId}/transfer-owner": {
      "post": {
        "operationId": "postOrgsByOrgIdTransferOwner",
        "summary": "Hands ownership of the organisation to another member.",
        "tags": [
          "Orgs"
        ],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  }
                },
                "required": [
                  "userId"
                ],
                "additionalProperties": false,
                "description": "POST /v1/orgs/{id}/transfer-owner — make another member the owner and step down."
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          }
        }
      }
    },
    "/v1/company-prefixes": {
      "get": {
        "operationId": "getCompanyPrefixes",
        "summary": "Lists the company prefixes the organisation has claimed.",
        "tags": [
          "CompanyPrefixes"
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          }
        }
      },
      "post": {
        "operationId": "postCompanyPrefixes",
        "summary": "Claims a GS1 company prefix for the organisation.",
        "tags": [
          "CompanyPrefixes"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "prefix": {
                    "type": "string",
                    "pattern": "^[0-9]{4,12}$"
                  },
                  "gs1Mo": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "required": [
                  "prefix"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. A company prefix is 4 to 12 digits. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              },
              {
                "code": "INVALID_PREFIX",
                "type": "https://packagepage.com/problems/invalid-prefix"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "409": {
            "description": "This prefix is claimed by another organisation",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "PREFIX_DISPUTED",
                "type": "https://packagepage.com/problems/prefix-disputed"
              }
            ]
          }
        }
      }
    },
    "/v1/company-prefixes/verification-states": {
      "get": {
        "operationId": "getCompanyPrefixesVerificationStates",
        "summary": "Lists the states a company prefix verification can be in.",
        "tags": [
          "CompanyPrefixes"
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          }
        }
      }
    },
    "/v1/company-prefixes/{prefixId}/verify": {
      "post": {
        "operationId": "postCompanyPrefixesByPrefixIdVerify",
        "summary": "Submits the evidence that a company prefix belongs to the organisation.",
        "tags": [
          "CompanyPrefixes"
        ],
        "parameters": [
          {
            "name": "prefixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "default": "licence_certificate",
                    "type": "string",
                    "enum": [
                      "licence_certificate"
                    ]
                  },
                  "mime": {
                    "type": "string",
                    "minLength": 1
                  },
                  "bytes": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "filename": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "mime",
                  "bytes"
                ],
                "description": "POST /v1/company-prefixes/{id}/verify — returns a presigned PUT."
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          }
        }
      }
    },
    "/v1/products": {
      "get": {
        "operationId": "getProducts",
        "summary": "Lists products with filters, sorting and cursor paging.",
        "tags": [
          "Products"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "published",
                "archived",
                "tombstoned"
              ]
            }
          },
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 100,
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "createdAt",
              "type": "string",
              "enum": [
                "createdAt",
                "name",
                "gtin14",
                "status"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read:products"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Next-Cursor": {
                "description": "Present when more rows exist. Send it back as the cursor query parameter.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      },
      "post": {
        "operationId": "postProducts",
        "summary": "Creates a product in draft.",
        "tags": [
          "Products"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "gtin14": {
                    "type": "string"
                  },
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "workspaceId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "brandName": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sku": {
                    "type": "string",
                    "minLength": 1
                  },
                  "name": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "gtin14",
                  "workspaceId",
                  "brandName"
                ],
                "description": "POST /v1/products — a product is created draft, always."
              }
            }
          }
        },
        "security": [
          {
            "apiKey": [
              "write:products"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "A retry with the same `id`: the row the first request created, and no second row.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. That is not a valid GTIN. That GTIN's check digit does not match its other digits. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              },
              {
                "code": "INVALID_GTIN",
                "type": "https://packagepage.com/problems/invalid-gtin"
              },
              {
                "code": "INVALID_CHECK_DIGIT",
                "type": "https://packagepage.com/problems/invalid-check-digit"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "409": {
            "description": "That conflicts with something that already exists. You already have a product on that GTIN. That SKU is already used in this organisation",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "CONFLICT",
                "type": "https://packagepage.com/problems/conflict"
              },
              {
                "code": "DUPLICATE_GTIN",
                "type": "https://packagepage.com/problems/duplicate-gtin"
              },
              {
                "code": "DUPLICATE_SKU",
                "type": "https://packagepage.com/problems/duplicate-sku"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/products/{id}": {
      "get": {
        "operationId": "getProductsById",
        "summary": "Reads one product.",
        "tags": [
          "Products"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read:products"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/products/{id}/publish": {
      "post": {
        "operationId": "postProductsByIdPublish",
        "summary": "Publishes a draft product and claims its GTIN.",
        "tags": [
          "Products"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "write:products"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "A published GTIN needs a destination for plain scans. This prefix is not verified yet. This prefix is claimed by another organisation. This GTIN is claimed by another organisation. Publishing this would pass your plan's active GTINs. A product cannot move to that state",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "PUBLISH_NEEDS_DEFAULT",
                "type": "https://packagepage.com/problems/publish-needs-default"
              },
              {
                "code": "PREFIX_NOT_VERIFIED",
                "type": "https://packagepage.com/problems/prefix-not-verified"
              },
              {
                "code": "PREFIX_DISPUTED",
                "type": "https://packagepage.com/problems/prefix-disputed"
              },
              {
                "code": "GTIN_CLAIMED",
                "type": "https://packagepage.com/problems/gtin-claimed"
              },
              {
                "code": "GTIN_LIMIT_REACHED",
                "type": "https://packagepage.com/problems/gtin-limit-reached"
              },
              {
                "code": "INVALID_STATE_TRANSITION",
                "type": "https://packagepage.com/problems/invalid-state-transition"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/products/{id}/retire": {
      "post": {
        "operationId": "postProductsByIdRetire",
        "summary": "Archives a product, or tombstones it when the body says so.",
        "tags": [
          "Products"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "type": "string",
                    "enum": [
                      "archived",
                      "tombstoned"
                    ]
                  }
                },
                "description": "POST /v1/products/{id}/retire"
              }
            }
          }
        },
        "security": [
          {
            "apiKey": [
              "write:products"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "A product cannot move to that state",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "INVALID_STATE_TRANSITION",
                "type": "https://packagepage.com/problems/invalid-state-transition"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/products/{productId}/variants": {
      "get": {
        "operationId": "getProductsByProductIdVariants",
        "summary": "Lists a product's variants.",
        "tags": [
          "Products"
        ],
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          }
        }
      },
      "post": {
        "operationId": "postProductsByProductIdVariants",
        "summary": "Adds a variant to a product.",
        "tags": [
          "Products"
        ],
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "cpv": {
                    "type": "string",
                    "pattern": "^[!%-?A-Z_a-z\"]{1,20}$"
                  },
                  "name": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "cpv"
                ],
                "description": "POST /v1/products/{id}/variants"
              }
            }
          }
        },
        "security": [
          {
            "apiKey": [
              "write:products"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "A retry with the same `id`: the row the first request created, and no second row.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "That conflicts with something that already exists",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "CONFLICT",
                "type": "https://packagepage.com/problems/conflict"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/products/{productId}/batches": {
      "get": {
        "operationId": "getProductsByProductIdBatches",
        "summary": "Lists a product's batches.",
        "tags": [
          "Products"
        ],
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          }
        }
      },
      "post": {
        "operationId": "postProductsByProductIdBatches",
        "summary": "Adds a batch to a product.",
        "tags": [
          "Products"
        ],
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "lot": {
                    "type": "string",
                    "minLength": 1
                  },
                  "expiry": {
                    "type": "string"
                  }
                },
                "required": [
                  "lot"
                ],
                "description": "POST /v1/products/{id}/batches"
              }
            }
          }
        },
        "security": [
          {
            "apiKey": [
              "write:products"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "A retry with the same `id`: the row the first request created, and no second row.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "That conflicts with something that already exists",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "CONFLICT",
                "type": "https://packagepage.com/problems/conflict"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/products/{productId}/links": {
      "get": {
        "operationId": "getProductsByProductIdLinks",
        "summary": "Lists the links on a product.",
        "tags": [
          "Products"
        ],
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read:links"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      },
      "post": {
        "operationId": "postProductsByProductIdLinks",
        "summary": "Adds a link to a product, with warnings for anything suspect.",
        "tags": [
          "Products"
        ],
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "linkType": {
                    "type": "string",
                    "pattern": "^[a-z][A-Za-z0-9]*:[a-z][A-Za-z0-9]*$"
                  },
                  "href": {
                    "type": "string",
                    "pattern": "^https?:\\/\\/"
                  },
                  "mediaType": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9._+-]+\\/[A-Za-z0-9._+-]+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "grain": {
                    "type": "object",
                    "properties": {
                      "cpv": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[!%-?A-Z_a-z\"]{1,20}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "lot": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[!%-?A-Z_a-z\"]{1,20}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "serial": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[!%-?A-Z_a-z\"]{1,20}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    }
                  },
                  "hreflang": {},
                  "validFrom": {},
                  "validTo": {},
                  "title": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "isDefault": {
                    "type": "boolean"
                  },
                  "active": {
                    "type": "boolean"
                  }
                },
                "description": "POST /v1/products/{id}/links"
              }
            }
          }
        },
        "security": [
          {
            "apiKey": [
              "write:links"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "A retry with the same `id`: the row the first request created, and no second row.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. That is not a GS1 link type. That link type cannot hold a default slot. A default link needs a title. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              },
              {
                "code": "UNKNOWN_LINK_TYPE",
                "type": "https://packagepage.com/problems/unknown-link-type"
              },
              {
                "code": "LINK_TYPE_NOT_ASSIGNABLE",
                "type": "https://packagepage.com/problems/link-type-not-assignable"
              },
              {
                "code": "DEFAULT_NEEDS_TITLE",
                "type": "https://packagepage.com/problems/default-needs-title"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "That conflicts with something that already exists. This GTIN has reached its link limit. This grain already has a default link",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "CONFLICT",
                "type": "https://packagepage.com/problems/conflict"
              },
              {
                "code": "LINK_LIMIT_REACHED",
                "type": "https://packagepage.com/problems/link-limit-reached"
              },
              {
                "code": "DEFAULT_SLOT_OCCUPIED",
                "type": "https://packagepage.com/problems/default-slot-occupied"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/products/{productId}/linkset": {
      "get": {
        "operationId": "getProductsByProductIdLinkset",
        "summary": "Previews the linkset a scan of this product would receive.",
        "tags": [
          "Products"
        ],
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cpv",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[!%-?A-Z_a-z\"]{1,20}$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "name": "lot",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[!%-?A-Z_a-z\"]{1,20}$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "name": "serial",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[!%-?A-Z_a-z\"]{1,20}$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "name": "linkType",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[a-z][A-Za-z0-9]*:[a-z][A-Za-z0-9]*$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "name": "accept",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read:links"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/products/{productId}/links/{linkId}": {
      "patch": {
        "operationId": "patchProductsByProductIdLinksByLinkId",
        "summary": "Edits a link on a product.",
        "tags": [
          "Products"
        ],
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "linkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "href": {
                    "type": "string",
                    "pattern": "^https?:\\/\\/"
                  },
                  "mediaType": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9._+-]+\\/[A-Za-z0-9._+-]+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "hreflang": {},
                  "validFrom": {},
                  "validTo": {},
                  "title": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "isDefault": {
                    "type": "boolean"
                  }
                },
                "description": "PATCH /v1/products/{id}/links/{linkId}"
              }
            }
          }
        },
        "security": [
          {
            "apiKey": [
              "write:links"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. A default link needs a title. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              },
              {
                "code": "DEFAULT_NEEDS_TITLE",
                "type": "https://packagepage.com/problems/default-needs-title"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "That link belongs to an active recall",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RECALL_LINK_LOCKED",
                "type": "https://packagepage.com/problems/recall-link-locked"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      },
      "delete": {
        "operationId": "deleteProductsByProductIdLinksByLinkId",
        "summary": "Deletes a link from a product.",
        "tags": [
          "Products"
        ],
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "linkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "write:links"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "That link belongs to an active recall. This GTIN would be left with nowhere for plain scans to go",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RECALL_LINK_LOCKED",
                "type": "https://packagepage.com/problems/recall-link-locked"
              },
              {
                "code": "DEFAULT_SLOT_REQUIRED",
                "type": "https://packagepage.com/problems/default-slot-required"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/products/{productId}/links/{linkId}/deactivate": {
      "post": {
        "operationId": "postProductsByProductIdLinksByLinkIdDeactivate",
        "summary": "Turns a link off without deleting it.",
        "tags": [
          "Products"
        ],
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "linkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "write:links"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "That link belongs to an active recall. This GTIN would be left with nowhere for plain scans to go",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RECALL_LINK_LOCKED",
                "type": "https://packagepage.com/problems/recall-link-locked"
              },
              {
                "code": "DEFAULT_SLOT_REQUIRED",
                "type": "https://packagepage.com/problems/default-slot-required"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/products/{productId}/links/{linkId}/activate": {
      "post": {
        "operationId": "postProductsByProductIdLinksByLinkIdActivate",
        "summary": "Turns a deactivated link back on.",
        "tags": [
          "Products"
        ],
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "linkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "write:links"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "This grain already has a default link",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "DEFAULT_SLOT_OCCUPIED",
                "type": "https://packagepage.com/problems/default-slot-occupied"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/products/{productId}/links/reorder": {
      "post": {
        "operationId": "postProductsByProductIdLinksReorder",
        "summary": "Sets the order of a product's links.",
        "tags": [
          "Products"
        ],
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "linkIds": {}
                },
                "description": "POST /v1/products/{id}/links/reorder"
              }
            }
          }
        },
        "security": [
          {
            "apiKey": [
              "write:links"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. A reorder must name every link for this GTIN. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              },
              {
                "code": "REORDER_SET_MISMATCH",
                "type": "https://packagepage.com/problems/reorder-set-mismatch"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "Recall links must stay at the head",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RECALL_HEAD_ORDER",
                "type": "https://packagepage.com/problems/recall-head-order"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/products/{productId}/media": {
      "post": {
        "operationId": "postProductsByProductIdMedia",
        "summary": "Starts an upload for a product image and returns a presigned PUT.",
        "tags": [
          "Products"
        ],
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "image",
                      "doc",
                      "artwork"
                    ]
                  },
                  "mime": {
                    "type": "string",
                    "minLength": 1
                  },
                  "bytes": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "filename": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "alt": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "position": {
                    "default": 0,
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "kind",
                  "mime",
                  "bytes"
                ],
                "description": "POST /v1/products/{id}/media — returns a presigned PUT."
              }
            }
          }
        },
        "security": [
          {
            "apiKey": [
              "write:products"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "A retry with the same `id`: the row the first request created, and no second row.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "That conflicts with something that already exists",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "CONFLICT",
                "type": "https://packagepage.com/problems/conflict"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/media": {
      "get": {
        "operationId": "getMedia",
        "summary": "Lists media records.",
        "tags": [
          "Media"
        ],
        "parameters": [
          {
            "name": "productId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          }
        }
      },
      "post": {
        "operationId": "postMedia",
        "summary": "Records a media file that is already in storage. This route takes a session. A key uploads through the media route under a product.",
        "tags": [
          "Media"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "image",
                      "doc",
                      "artwork"
                    ]
                  },
                  "storageKey": {
                    "type": "string",
                    "minLength": 1
                  },
                  "mime": {
                    "type": "string",
                    "minLength": 1
                  },
                  "bytes": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "productId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "alt": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "position": {
                    "default": 0,
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "kind",
                  "storageKey",
                  "mime",
                  "bytes"
                ],
                "description": "POST /v1/media — metadata only; bytes go straight to object storage."
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          }
        }
      }
    },
    "/v1/imports": {
      "get": {
        "operationId": "getImports",
        "summary": "Lists catalogue imports, newest first.",
        "tags": [
          "Imports"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Next-Cursor": {
                "description": "Present when more rows exist. Send it back as the cursor query parameter.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          }
        }
      },
      "post": {
        "operationId": "postImports",
        "summary": "Starts an import and returns a presigned PUT for the file.",
        "tags": [
          "Imports"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filename": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "bytes": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "contentSha256": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$"
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "source": {
                    "type": "string",
                    "enum": [
                      "csv",
                      "xlsx"
                    ]
                  }
                },
                "required": [
                  "filename",
                  "bytes",
                  "contentSha256",
                  "idempotencyKey",
                  "source"
                ],
                "description": "POST /v1/imports — returns a presigned PUT."
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "409": {
            "description": "That idempotency key was used for a different file",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "IMPORT_IDEMPOTENCY_MISMATCH",
                "type": "https://packagepage.com/problems/import-idempotency-mismatch"
              }
            ]
          }
        }
      }
    },
    "/v1/imports/{id}": {
      "get": {
        "operationId": "getImportsById",
        "summary": "Reads one import with its mapping and counts.",
        "tags": [
          "Imports"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          }
        }
      }
    },
    "/v1/imports/{id}/rows": {
      "get": {
        "operationId": "getImportsByIdRows",
        "summary": "Lists the rows of an import with each row's verdict.",
        "tags": [
          "Imports"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "create",
                "update",
                "skip",
                "error"
              ]
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "check_digit",
                "outside_prefix",
                "excel_mangled",
                "unreadable_date",
                "duplicate_gtin",
                "invalid_lot",
                "invalid_language",
                "unknown_attribute",
                "attribute_above_tier",
                "invalid_value"
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 500,
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Next-Cursor": {
                "description": "Present when more rows exist. Send it back as the cursor query parameter.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          }
        }
      }
    },
    "/v1/imports/{id}/report": {
      "get": {
        "operationId": "getImportsByIdReport",
        "summary": "Downloads an import's row report as CSV.",
        "tags": [
          "Imports"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rows",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "failed"
              ]
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          }
        }
      }
    },
    "/v1/imports/{id}/uploaded": {
      "post": {
        "operationId": "postImportsByIdUploaded",
        "summary": "Tells the import its file has arrived, so parsing can begin.",
        "tags": [
          "Imports"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "An import cannot move to that state",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "IMPORT_INVALID_STATE_TRANSITION",
                "type": "https://packagepage.com/problems/import-invalid-state-transition"
              }
            ]
          }
        }
      }
    },
    "/v1/imports/{id}/mapping": {
      "post": {
        "operationId": "postImportsByIdMapping",
        "summary": "Confirms how the file's columns map to product fields.",
        "tags": [
          "Imports"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mapping": {
                    "type": "object",
                    "properties": {
                      "columns": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "header": {
                              "type": "string",
                              "minLength": 1
                            },
                            "field": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "header",
                            "field"
                          ]
                        }
                      }
                    },
                    "required": [
                      "columns"
                    ]
                  },
                  "dateOrder": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "dmy",
                          "mdy",
                          "ymd"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "saveAs": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  }
                },
                "required": [
                  "mapping"
                ],
                "description": "POST /v1/imports/{id}/mapping — confirms the columns and starts validation."
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. That mapping has no column for the GTIN. That mapping has a batch date and no batch lot. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              },
              {
                "code": "IMPORT_MAPPING_NO_GTIN",
                "type": "https://packagepage.com/problems/import-mapping-no-gtin"
              },
              {
                "code": "IMPORT_MAPPING_BATCH_DATE_NO_LOT",
                "type": "https://packagepage.com/problems/import-mapping-batch-date-no-lot"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "An import cannot move to that state",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "IMPORT_INVALID_STATE_TRANSITION",
                "type": "https://packagepage.com/problems/import-invalid-state-transition"
              }
            ]
          }
        }
      }
    },
    "/v1/imports/{id}/apply": {
      "post": {
        "operationId": "postImportsByIdApply",
        "summary": "Applies a reviewed import to the catalogue.",
        "tags": [
          "Imports"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspaceId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "required": [
                  "workspaceId"
                ],
                "description": "POST /v1/imports/{id}/apply — creates the reviewed rows as drafts and updates the rest."
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "An import cannot move to that state",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "IMPORT_INVALID_STATE_TRANSITION",
                "type": "https://packagepage.com/problems/import-invalid-state-transition"
              }
            ]
          }
        }
      }
    },
    "/v1/imports/{id}/cancel": {
      "post": {
        "operationId": "postImportsByIdCancel",
        "summary": "Cancels an import that has not been applied.",
        "tags": [
          "Imports"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "An import cannot move to that state",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "IMPORT_INVALID_STATE_TRANSITION",
                "type": "https://packagepage.com/problems/import-invalid-state-transition"
              }
            ]
          }
        }
      }
    },
    "/v1/link-types": {
      "get": {
        "operationId": "getLinkTypes",
        "summary": "Lists the GS1 link types a link can use.",
        "tags": [
          "LinkTypes"
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          }
        }
      }
    },
    "/v1/recalls": {
      "get": {
        "operationId": "getRecalls",
        "summary": "Lists the organisation's recall notices.",
        "tags": [
          "Recalls"
        ],
        "security": [
          {
            "apiKey": [
              "read:recalls"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      },
      "post": {
        "operationId": "postRecalls",
        "summary": "Publishes a recall notice on the products it names.",
        "tags": [
          "Recalls"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "productId": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                  },
                  "externalUrl": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^https?:\\/\\/"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "overrideDefault": {
                    "type": "boolean"
                  },
                  "notice": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "sourceNote": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "noticeTitle": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "scope": {
                    "type": "string",
                    "enum": [
                      "gtin",
                      "lots"
                    ]
                  },
                  "lots": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "scope"
                ],
                "description": "POST /v1/recalls — the whole body, for form pre-validation."
              }
            }
          }
        },
        "security": [
          {
            "apiKey": [
              "write:recalls"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "A retry with the same `id`: the row the first request created, and no second row.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "409": {
            "description": "That conflicts with something that already exists. This GTIN already has an active recall. That many lots will not fit in one entry. This GTIN would be left with nowhere for plain scans to go. This GTIN has reached its link limit",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "CONFLICT",
                "type": "https://packagepage.com/problems/conflict"
              },
              {
                "code": "RECALL_ALREADY_ACTIVE",
                "type": "https://packagepage.com/problems/recall-already-active"
              },
              {
                "code": "RECALL_SCOPE_TOO_WIDE",
                "type": "https://packagepage.com/problems/recall-scope-too-wide"
              },
              {
                "code": "DEFAULT_SLOT_REQUIRED",
                "type": "https://packagepage.com/problems/default-slot-required"
              },
              {
                "code": "LINK_LIMIT_REACHED",
                "type": "https://packagepage.com/problems/link-limit-reached"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/recalls/{recallId}": {
      "get": {
        "operationId": "getRecallsByRecallId",
        "summary": "Reads one recall notice with its scope and history.",
        "tags": [
          "Recalls"
        ],
        "parameters": [
          {
            "name": "recallId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read:recalls"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/recalls/{recallId}/evidence": {
      "get": {
        "operationId": "getRecallsByRecallIdEvidence",
        "summary": "Downloads a recall's evidence record as a PDF, or as CSV with format=csv.",
        "tags": [
          "Recalls"
        ],
        "parameters": [
          {
            "name": "recallId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          }
        }
      }
    },
    "/v1/recalls/{recallId}/scope": {
      "patch": {
        "operationId": "patchRecallsByRecallIdScope",
        "summary": "Widens the scope of an active recall.",
        "tags": [
          "Recalls"
        ],
        "parameters": [
          {
            "name": "recallId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "scope": {
                    "type": "string",
                    "enum": [
                      "gtin",
                      "lots"
                    ]
                  },
                  "lots": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "noticeTitle": {
                    "type": "string"
                  }
                },
                "required": [
                  "scope"
                ],
                "description": "PATCH /v1/recalls/{id}/scope — for form pre-validation. See the header."
              }
            }
          }
        },
        "security": [
          {
            "apiKey": [
              "write:recalls"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "That recall is no longer active. A recall's scope can only widen. That many lots will not fit in one entry",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RECALL_NOT_ACTIVE",
                "type": "https://packagepage.com/problems/recall-not-active"
              },
              {
                "code": "RECALL_SCOPE_NARROWED",
                "type": "https://packagepage.com/problems/recall-scope-narrowed"
              },
              {
                "code": "RECALL_SCOPE_TOO_WIDE",
                "type": "https://packagepage.com/problems/recall-scope-too-wide"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/recalls/{recallId}/lift": {
      "post": {
        "operationId": "postRecallsByRecallIdLift",
        "summary": "Lifts an active recall and restores the links it displaced.",
        "tags": [
          "Recalls"
        ],
        "parameters": [
          {
            "name": "recallId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "write:recalls"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "That recall is no longer active",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RECALL_NOT_ACTIVE",
                "type": "https://packagepage.com/problems/recall-not-active"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/artwork": {
      "post": {
        "operationId": "postArtwork",
        "summary": "Renders barcode artwork for a product and returns the file.",
        "tags": [
          "Artwork"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "productId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "symbology": {
                    "type": "string",
                    "enum": [
                      "qr",
                      "datamatrix"
                    ]
                  },
                  "xDimensionMm": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "applicationPreset": {
                    "default": "retail-pos",
                    "type": "string",
                    "enum": [
                      "retail-pos"
                    ]
                  },
                  "eccLevel": {
                    "type": "string",
                    "enum": [
                      "L",
                      "M",
                      "Q",
                      "H"
                    ]
                  },
                  "qualifiers": {
                    "type": "object",
                    "properties": {
                      "cpv": {
                        "type": "string",
                        "pattern": "^[!%-?A-Z_a-z\"]{1,20}$"
                      },
                      "lot": {
                        "type": "string",
                        "pattern": "^[!%-?A-Z_a-z\"]{1,20}$"
                      },
                      "serial": {
                        "type": "string",
                        "pattern": "^[!%-?A-Z_a-z\"]{1,20}$"
                      }
                    }
                  },
                  "escapeHatch": {
                    "default": false,
                    "type": "boolean"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "svg",
                      "eps",
                      "pdf",
                      "png"
                    ]
                  },
                  "confirmedQuantity": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "productId",
                  "symbology",
                  "xDimensionMm",
                  "format"
                ],
                "description": "POST /v1/artwork — one symbol, synchronously. The response is the file."
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "This product is not published yet. This product is archived. This product has been permanently retired. This prefix is not verified yet. This prefix is claimed by another organisation. This domain has never answered a request. That module width is below the minimum for the chosen application",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "PRODUCT_DRAFT",
                "type": "https://packagepage.com/problems/product-draft"
              },
              {
                "code": "PRODUCT_ARCHIVED",
                "type": "https://packagepage.com/problems/product-archived"
              },
              {
                "code": "PRODUCT_TOMBSTONED",
                "type": "https://packagepage.com/problems/product-tombstoned"
              },
              {
                "code": "PREFIX_NOT_VERIFIED",
                "type": "https://packagepage.com/problems/prefix-not-verified"
              },
              {
                "code": "PREFIX_DISPUTED",
                "type": "https://packagepage.com/problems/prefix-disputed"
              },
              {
                "code": "DOMAIN_NEVER_LIVE",
                "type": "https://packagepage.com/problems/domain-never-live"
              },
              {
                "code": "XDIM_BELOW_MINIMUM",
                "type": "https://packagepage.com/problems/xdim-below-minimum"
              }
            ]
          }
        }
      }
    },
    "/v1/artwork/placement-sheet": {
      "post": {
        "operationId": "postArtworkPlacementSheet",
        "summary": "Renders the dual-marking placement sheet for a product.",
        "tags": [
          "Artwork"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "productId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "symbology": {
                    "type": "string",
                    "enum": [
                      "qr",
                      "datamatrix"
                    ]
                  },
                  "xDimensionMm": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "applicationPreset": {
                    "default": "retail-pos",
                    "type": "string",
                    "enum": [
                      "retail-pos"
                    ]
                  },
                  "eccLevel": {
                    "type": "string",
                    "enum": [
                      "L",
                      "M",
                      "Q",
                      "H"
                    ]
                  },
                  "qualifiers": {
                    "type": "object",
                    "properties": {
                      "cpv": {
                        "type": "string",
                        "pattern": "^[!%-?A-Z_a-z\"]{1,20}$"
                      },
                      "lot": {
                        "type": "string",
                        "pattern": "^[!%-?A-Z_a-z\"]{1,20}$"
                      },
                      "serial": {
                        "type": "string",
                        "pattern": "^[!%-?A-Z_a-z\"]{1,20}$"
                      }
                    }
                  },
                  "escapeHatch": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "required": [
                  "productId",
                  "symbology",
                  "xDimensionMm"
                ],
                "description": "POST /v1/artwork/placement-sheet — the dual-marking placement sheet for one symbol. The response is the PDF."
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          },
          "409": {
            "description": "This product is not published yet. That module width is below the minimum for the chosen application",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "PRODUCT_DRAFT",
                "type": "https://packagepage.com/problems/product-draft"
              },
              {
                "code": "XDIM_BELOW_MINIMUM",
                "type": "https://packagepage.com/problems/xdim-below-minimum"
              }
            ]
          }
        }
      }
    },
    "/v1/artwork/batches": {
      "post": {
        "operationId": "postArtworkBatches",
        "summary": "Checks many products against the artwork gates, and starts a zip job on request.",
        "tags": [
          "Artwork"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "productIds": {
                    "minItems": 1,
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    }
                  },
                  "symbology": {
                    "type": "string",
                    "enum": [
                      "qr",
                      "datamatrix"
                    ]
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "svg",
                      "eps",
                      "pdf",
                      "png"
                    ]
                  },
                  "xDimensionMm": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "applicationPreset": {
                    "default": "retail-pos",
                    "type": "string",
                    "enum": [
                      "retail-pos"
                    ]
                  },
                  "eccLevel": {
                    "type": "string",
                    "enum": [
                      "L",
                      "M",
                      "Q",
                      "H"
                    ]
                  },
                  "zip": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "required": [
                  "productIds",
                  "symbology",
                  "format",
                  "xDimensionMm"
                ],
                "description": "POST /v1/artwork/batches — per-product gate results, free at every tier, plus the ZIP job when `zip` is set (Starter and above)."
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          }
        }
      }
    },
    "/v1/artwork/batches/{id}": {
      "get": {
        "operationId": "getArtworkBatchesById",
        "summary": "Reads the progress of an artwork zip job.",
        "tags": [
          "Artwork"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "running",
                        "ready",
                        "failed"
                      ]
                    },
                    "entries": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "withheld": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "bytes": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "expired": {
                      "type": "boolean"
                    },
                    "downloadUrl": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "status",
                    "entries",
                    "withheld",
                    "bytes",
                    "error",
                    "expiresAt",
                    "expired",
                    "downloadUrl"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          }
        }
      }
    },
    "/v1/audit-log": {
      "get": {
        "operationId": "getAuditLog",
        "summary": "Lists the organisation's audit log, newest first, with cursor paging.",
        "tags": [
          "AuditLog"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 100,
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Next-Cursor": {
                "description": "Present when more rows exist. Send it back as the cursor query parameter.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          }
        }
      }
    },
    "/v1/domains": {
      "get": {
        "operationId": "getDomains",
        "summary": "Lists the organisation's custom domains with their DNS instructions.",
        "tags": [
          "Domains"
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          }
        }
      },
      "post": {
        "operationId": "postDomains",
        "summary": "Adds a custom domain.",
        "tags": [
          "Domains"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hostname": {
                    "type": "string"
                  },
                  "kind": {
                    "default": "resolver",
                    "type": "string",
                    "enum": [
                      "resolver",
                      "pip"
                    ]
                  }
                },
                "required": [
                  "hostname"
                ],
                "description": "POST /v1/domains — claim a hostname and get its DNS instructions."
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. That is included from a higher plan. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              },
              {
                "code": "PLAN_GATED",
                "type": "https://packagepage.com/problems/plan-gated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "409": {
            "description": "This hostname is claimed by another organisation. This organisation already has a custom domain",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "DOMAIN_CLAIMED",
                "type": "https://packagepage.com/problems/domain-claimed"
              },
              {
                "code": "DOMAIN_ALREADY_CONFIGURED",
                "type": "https://packagepage.com/problems/domain-already-configured"
              }
            ]
          }
        }
      }
    },
    "/v1/domains/{domainId}": {
      "delete": {
        "operationId": "deleteDomainsByDomainId",
        "summary": "Removes a custom domain and re-emits the entries that used it.",
        "tags": [
          "Domains"
        ],
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          }
        }
      }
    },
    "/v1/domains/{domainId}/recheck": {
      "post": {
        "operationId": "postDomainsByDomainIdRecheck",
        "summary": "Asks DNS again whether a custom domain is set up.",
        "tags": [
          "Domains"
        ],
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NOT_FOUND",
                "type": "https://packagepage.com/problems/not-found"
              }
            ]
          }
        }
      }
    },
    "/v1/subscription": {
      "get": {
        "operationId": "getSubscription",
        "summary": "Reads the organisation's plan and billing state.",
        "tags": [
          "Subscription"
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "plan": {
                      "type": "string",
                      "enum": [
                        "launch",
                        "starter",
                        "growth",
                        "scale",
                        "enterprise"
                      ]
                    },
                    "billingStatus": {
                      "type": "string",
                      "enum": [
                        "active",
                        "grace",
                        "degraded",
                        "churned"
                      ]
                    },
                    "subscription": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "stripeSubscriptionId": {
                              "type": "string"
                            },
                            "plan": {
                              "type": "string",
                              "enum": [
                                "launch",
                                "starter",
                                "growth",
                                "scale",
                                "enterprise"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "incomplete",
                                "incomplete_expired",
                                "trialing",
                                "active",
                                "past_due",
                                "canceled",
                                "unpaid",
                                "paused"
                              ]
                            },
                            "periodStart": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "periodEnd": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "gtinLimit": {
                              "type": "integer"
                            },
                            "requestLimit": {
                              "type": "integer"
                            },
                            "cancelAtPeriodEnd": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "stripeSubscriptionId",
                            "plan",
                            "status",
                            "periodStart",
                            "periodEnd",
                            "gtinLimit",
                            "requestLimit",
                            "cancelAtPeriodEnd"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "gtinsActive": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "plan",
                    "billingStatus",
                    "subscription",
                    "gtinsActive"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          }
        }
      }
    },
    "/v1/subscription/checkout": {
      "post": {
        "operationId": "postSubscriptionCheckout",
        "summary": "Starts a checkout session for a paid plan.",
        "tags": [
          "Subscription"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tier": {
                    "type": "string",
                    "enum": [
                      "starter",
                      "growth",
                      "scale"
                    ]
                  },
                  "interval": {
                    "type": "string",
                    "enum": [
                      "month",
                      "year"
                    ]
                  }
                },
                "required": [
                  "tier",
                  "interval"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "409": {
            "description": "This organisation already has a paid subscription",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "SUBSCRIPTION_EXISTS",
                "type": "https://packagepage.com/problems/subscription-exists"
              }
            ]
          }
        }
      }
    },
    "/v1/subscription/preview": {
      "get": {
        "operationId": "getSubscriptionPreview",
        "summary": "Previews what a plan switch would cost.",
        "tags": [
          "Subscription"
        ],
        "parameters": [
          {
            "name": "tier",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "starter",
                "growth",
                "scale"
              ]
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "amountDueToday": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "creditToday": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "currency": {
                          "type": "string"
                        },
                        "nextRenewal": {
                          "type": "object",
                          "properties": {
                            "at": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "amount": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "at",
                            "amount"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "amountDueToday",
                        "creditToday",
                        "currency",
                        "nextRenewal"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "409": {
            "description": "This organisation has no active subscription to change",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NO_SUBSCRIPTION",
                "type": "https://packagepage.com/problems/no-subscription"
              }
            ]
          }
        }
      }
    },
    "/v1/subscription/switch": {
      "post": {
        "operationId": "postSubscriptionSwitch",
        "summary": "Switches the organisation to another plan.",
        "tags": [
          "Subscription"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tier": {
                    "type": "string",
                    "enum": [
                      "starter",
                      "growth",
                      "scale"
                    ]
                  }
                },
                "required": [
                  "tier"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "409": {
            "description": "This organisation has no active subscription to change",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NO_SUBSCRIPTION",
                "type": "https://packagepage.com/problems/no-subscription"
              }
            ]
          }
        }
      }
    },
    "/v1/subscription/manage": {
      "post": {
        "operationId": "postSubscriptionManage",
        "summary": "Opens the billing portal for the organisation.",
        "tags": [
          "Subscription"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "intent": {
                    "type": "string",
                    "enum": [
                      "cancel",
                      "payment"
                    ]
                  }
                },
                "required": [
                  "intent"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "409": {
            "description": "This organisation has no active subscription to change",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "NO_SUBSCRIPTION",
                "type": "https://packagepage.com/problems/no-subscription"
              }
            ]
          }
        }
      }
    },
    "/v1/subscription/contact": {
      "get": {
        "operationId": "getSubscriptionContact",
        "summary": "Reads the billing contact.",
        "tags": [
          "Subscription"
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "email": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "email"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          }
        }
      },
      "put": {
        "operationId": "putSubscriptionContact",
        "summary": "Sets the billing contact.",
        "tags": [
          "Subscription"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ],
                "additionalProperties": false,
                "description": "PUT /v1/subscription/contact — the address Stripe invoices."
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "email": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "email"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "operationId": "getUsage",
        "summary": "Reads the organisation's usage against its plan limits.",
        "tags": [
          "Usage"
        ],
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "window": {
                      "type": "string",
                      "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])$"
                    },
                    "requestsCountedFrom": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                    },
                    "counters": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "metric": {
                            "type": "string",
                            "enum": [
                              "gtins_active",
                              "resolver_requests",
                              "api_calls"
                            ]
                          },
                          "value": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "limit": {
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "countedAt": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          }
                        },
                        "required": [
                          "metric",
                          "value",
                          "limit",
                          "countedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "window",
                    "requestsCountedFrom",
                    "counters"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Name the organization this request is for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          }
        }
      }
    },
    "/v1/analytics/scans": {
      "get": {
        "operationId": "getAnalyticsScans",
        "summary": "Reads scan counts over a period.",
        "tags": [
          "Analytics"
        ],
        "parameters": [
          {
            "name": "group",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "gtin",
                "linkType",
                "uaClass"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "read:analytics"
            ]
          },
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "group": {
                      "type": "string",
                      "enum": [
                        "day",
                        "gtin",
                        "linkType",
                        "uaClass"
                      ]
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "scans": {
                            "type": "integer",
                            "exclusiveMinimum": 0
                          }
                        },
                        "required": [
                          "key",
                          "scans"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "group",
                    "rows"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid. Name the organization this request is for. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "ORG_NOT_SPECIFIED": {
                    "value": {
                      "error": "organization not specified"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "VALIDATION_FAILED",
                "type": "https://packagepage.com/problems/validation-failed"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "ORG_NOT_SPECIFIED",
                "docs": "https://packagepage.com/problems/org-not-specified"
              }
            ]
          },
          "401": {
            "description": "Sign in to continue. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "UNAUTHENTICATED": {
                    "value": {
                      "error": "unauthenticated"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "UNAUTHENTICATED",
                "type": "https://packagepage.com/problems/unauthenticated"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "UNAUTHENTICATED",
                "docs": "https://packagepage.com/problems/unauthenticated"
              }
            ]
          },
          "403": {
            "description": "Your role does not permit this. You are not a member of this organisation. application/problem+json answers the problem codes listed in x-problems, and application/json answers the codes listed in x-legacy-auth.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyAuthBody"
                },
                "examples": {
                  "NOT_A_MEMBER": {
                    "value": {
                      "error": "not a member of this organization"
                    }
                  }
                }
              }
            },
            "x-problems": [
              {
                "code": "FORBIDDEN",
                "type": "https://packagepage.com/problems/forbidden"
              }
            ],
            "x-legacy-auth": [
              {
                "code": "NOT_A_MEMBER",
                "docs": "https://packagepage.com/problems/not-a-member"
              }
            ]
          },
          "429": {
            "description": "Too many requests for this API key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "x-problems": [
              {
                "code": "RATE_LIMITED",
                "type": "https://packagepage.com/problems/rate-limited"
              }
            ]
          }
        }
      }
    },
    "/v1/billing/webhooks/stripe": {
      "post": {
        "operationId": "postBillingWebhooksStripe",
        "summary": "Receives Stripe's signed billing events.",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "stripeSignature": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "g2d_live_",
        "description": "An API key. The security requirement names the scope the route needs. Each key may make 1000 requests in each 1 hour window."
      },
      "session": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Secure-better-auth.session_token",
        "description": "The dashboard's session cookie, set by sign-in. Without https the cookie is named better-auth.session_token. Routes that take a session also need the x-packagepage-org header."
      },
      "stripeSignature": {
        "type": "apiKey",
        "in": "header",
        "name": "Stripe-Signature",
        "description": "Stripe's signature over the request body."
      }
    },
    "schemas": {
      "LegacyAuthBody": {
        "type": "object",
        "description": "The body of the three auth refusals, which predate the problem registry. Match on the error string.",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "Problem": {
        "type": "object",
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "code"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          }
        }
      }
    }
  }
}
