{
  "openapi": "3.0.3",
  "info": {
    "title": "Fabric API - Audit",
    "version": "0.9.2264",
    "description": "API for querying audit events. Uses an async pattern: POST to start a query, then poll GET until SUCCEEDED."
  },
  "servers": [
    {
      "url": "{protocol}://{domain}/{basePath}",
      "variables": {
        "protocol": {
          "enum": [
            "http",
            "https"
          ],
          "default": "https"
        },
        "domain": {
          "default": "api.studio.fabricdata.com"
        },
        "basePath": {
          "default": "v1"
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Audit",
      "x-displayName": "Audit",
      "description": "Provides access to audit events for a tenant. Queries run asynchronously. Start a query with POST /auditQueries and poll for results with GET /auditQueries/{queryExecutionId}."
    },
    {
      "name": "Background Jobs",
      "x-displayName": "Background Jobs",
      "description": "Long-running asynchronous operations (record imports, contributor deletes, data delivery exports, etc.) that can be monitored via status polling."
    },
    {
      "name": "Contributors",
      "x-displayName": "Contributors",
      "description": "Manage contributors in the context of a tenant. Create and manage contributor records (people and organizations) for use in credits and metadata."
    },
    {
      "name": "Global Contributors",
      "x-displayName": "Global Contributors"
    },
    {
      "name": "Credits",
      "x-displayName": "Credits",
      "description": "Manage credit lists and individual credits in the context of records. A credit list is a named, ordered collection of cast and crew entries for a record. Each credit entry links a contributor to a record via a job role (e.g., Actor, Director). All tenants may reference shared, system-provided contributors when assigning credits."
    },
    {
      "name": "Data Deliveries",
      "x-displayName": "Data Deliveries",
      "description": "This API provides a way to manage Data Deliveries in the context of a Tenant."
    },
    {
      "name": "DataIngress",
      "x-displayName": "Data Ingress",
      "description": "This API provides a way to manage data ingress executions for importing records from external sources like Fabric V1. It supports multiple source adapters (API-based or CSV-based) and handles hierarchical record creation in the correct order. The system supports incremental imports and tracks progress with success/failure counts."
    },
    {
      "name": "Data Warehouse Settings",
      "x-displayName": "Data Warehouse Settings",
      "description": "Manage your scheduled data exports."
    },
    {
      "name": "Datasets",
      "x-displayName": "Datasets",
      "description": "Manage Datasets in the context of a tenant. A Dataset is an ordered collection of controlled vocabulary items used to constrain field values — for example, a list of genres or ratings. All tenants have access to shared system-owned datasets. Tenants may also create their own custom datasets."
    },
    {
      "name": "Fields",
      "x-displayName": "Fields",
      "description": "Manage Fields in the context of a tenant. A Field defines a data point that can be stored on a Record — for example, a synopsis, genre list, or release year. Fields may include a validation schema that the system enforces when data is saved. All tenants have access to a shared set of system-owned fields representing the standard metadata for a title. Tenants may also create their own custom fields."
    },
    {
      "name": "Global Metadata",
      "x-displayName": "Global Metadata",
      "description": "This API provides a way to search and filter through Metadata about commercially available Records. It can be used to enrich Records with additional information. This API is read-only and does not allow for any mutations."
    },
    {
      "name": "Licensed Metadata",
      "x-displayName": "Licensed Metadata",
      "description": "Enable or disable a licensed third-party metadata provider (e.g. Gracenote) for a tenant, using the tenant's own API key. Unlike Global Metadata, this API performs real per-tenant mutations and provisions dedicated, isolated storage for that tenant's licensed data."
    },
    {
      "name": "Media",
      "x-displayName": "Media",
      "description": "This API provides a way to manage Media (images and files) in the context of a Record."
    },
    {
      "name": "Records",
      "x-displayName": "Records",
      "description": "This API provides a way to manage Records in the context of a tenant. A Record is a lightweight Resource which stores the core metadata about a title and establishes relationships with other Resources, most important of which are the RecordFields which store the actual data about the title, and the Credits Lists which store the Credits for the title. This includes managing record background jobs (e.g. creating a Record from scratch, creating a Series with hierarchy from Global Metadata, deleting a Record together with all its hierarchical children), compilation members and compilations, and external data lookups."
    },
    {
      "name": "Record Lifecycles",
      "x-displayName": "Record Lifecycles",
      "description": "Manage record lifecycles in the context of a tenant. A Record Lifecycle defines the set of statuses (nodes) and transitions (edges) a record of a given workType can move through — e.g. Draft, In Review, Published — and the allowed paths between them."
    },
    {
      "name": "Tenants",
      "x-displayName": "Tenants",
      "description": "Manage policies, security tags, and other resources in the context of a tenant. A tenant is an organizational unit (e.g. a company or studio) that owns its own resources. A security policy defines what a role can do within a tenant. A security tag is a label used to categorize resources and restrict access."
    },
    {
      "name": "Users",
      "x-displayName": "Users",
      "description": "This API provides a way to manage Users and Roles in the context of a Tenant. A User is commonly used to represent a person, but in the future it may also represent a non-human entity such as an automated system. A Role is a collection of Security Policies which are used to determine what a User can do within a Tenant."
    },
    {
      "name": "Utilization",
      "x-displayName": "Utilization",
      "description": "This API provides a way to view and manage utilization data for a Tenant. Utilization tracks resource usage including user counts, record counts, API calls, delivery records, and media storage. Monthly snapshots are created to preserve historical usage data for billing and analytics purposes."
    }
  ],
  "paths": {
    "/auditQueries": {
      "post": {
        "summary": "Start an audit query",
        "description": "Starts an asynchronous audit query for the caller's tenant. Returns 202 with a queryExecutionId. Poll GET /auditQueries/{queryExecutionId} until status is SUCCEEDED or FAILED.",
        "operationId": "auditQueryCreateOne",
        "tags": [
          "Audit"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${auditHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuditQueryCreateOneRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Query started — poll for results",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditQueryCreateOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/auditQueries/{queryExecutionId}": {
      "get": {
        "summary": "Poll an audit query for results",
        "description": "Returns the current status of an audit query. While running, returns 202 with an empty data array. When SUCCEEDED, returns 200 with up to 1,000 audit events. If meta.hasMore is true, the result set was truncated — refine filters to see all results.",
        "operationId": "auditQueryFindOne",
        "tags": [
          "Audit"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${auditHttpApi}"
        },
        "parameters": [
          {
            "name": "queryExecutionId",
            "in": "path",
            "required": true,
            "description": "Query execution ID returned by POST /auditQueries",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Query succeeded — audit events returned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditQueryFindOneResponse"
                }
              }
            }
          },
          "202": {
            "description": "Query still running or failed — poll again or check queryStatus",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditQueryFindOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/backgroundJobs": {
      "get": {
        "summary": "Get all background jobs",
        "operationId": "backgroundJobFindMany",
        "description": "Returns a paginated list of background jobs for the authenticated tenant. Optionally filter by job type and sort by creation time.",
        "tags": [
          "Background Jobs"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${backgroundJobHttpApi}"
        },
        "parameters": [
          {
            "name": "filter.type",
            "description": "The background job type to filter by (e.g. deleteContributor, deleteRecord)",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter.author.id",
            "description": "The background job author to filter by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "description": "The field to sort background jobs by. Use '-' to sort in descending order.",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "created",
                "-created"
              ]
            }
          },
          {
            "name": "page.cursor",
            "description": "The pagination cursor used to get the next page of results",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page.size",
            "description": "The number of background jobs to return per page. Default is 20, maximum is 50.",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved background jobs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackgroundJobFindManyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Background job status temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/backgroundJobs/{jobId}": {
      "get": {
        "summary": "Get a background job by ID",
        "operationId": "backgroundJobFindOne",
        "description": "Returns a single background job for the authenticated tenant. Refreshes status from AWS Step Functions when the job is still running.",
        "tags": [
          "Background Jobs"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${backgroundJobHttpApi}"
        },
        "parameters": [
          {
            "name": "jobId",
            "description": "The ID of the background job to get",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved background job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackgroundJobFindOneResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Background job status temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/contributors": {
      "post": {
        "summary": "Create a single contributor",
        "operationId": "contributorCreateOne",
        "description": "Create a single contributor. Tenants can create their own contributors.",
        "tags": [
          "Contributors"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${contributorHttpApi}"
        },
        "parameters": [
          {
            "name": "tenantId",
            "description": "The ID of the tenant to create the contributor for.",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContributorCreateOneRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContributorCreateOneResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/contributors/{contributorId}": {
      "get": {
        "summary": "Get a single contributor",
        "operationId": "contributorFindOne",
        "description": "Get a single contributor by ID. For the moment only system-owned contributors can be retrieved.",
        "tags": [
          "Contributors"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${contributorHttpApi}"
        },
        "parameters": [
          {
            "name": "contributorId",
            "description": "The ID of the contributor to retrieve",
            "in": "path",
            "required": true,
            "example": "6883cdbce189e1b8",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContributorFindOneResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "patch": {
        "summary": "Update a single contributor",
        "operationId": "contributorUpdateOne",
        "description": "Update a single contributor by ID. For the moment Tenants cannot update their own contributors.",
        "tags": [
          "Contributors"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${contributorHttpApi}"
        },
        "parameters": [
          {
            "name": "contributorId",
            "description": "The ID of the contributor to update",
            "in": "path",
            "required": true,
            "example": "6883cdbce189e1b8",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContributorUpdateOneRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {}
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/tenants/system/contributors/{contributorId}": {
      "get": {
        "summary": "Get a single system-owned contributor",
        "operationId": "contributorFindOneSystemOwned",
        "description": "Get a single system-owned contributor by ID.",
        "tags": [
          "Contributors"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${contributorHttpApi}"
        },
        "parameters": [
          {
            "name": "contributorId",
            "description": "The ID of the contributor to retrieve",
            "in": "path",
            "required": true,
            "example": "6883cdbce189e1b8",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "description": "The ID of the tenant to get the contributor for.",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContributorFindOneResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/contributors/search": {
      "post": {
        "summary": "Search for contributors",
        "operationId": "searchContributors",
        "description": "Search for contributors. Tenants can search for their own contributors and system-owned contributors.",
        "tags": [
          "Contributors"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${searchHttpApi}"
        },
        "parameters": [
          {
            "name": "page.size",
            "description": "The number of results to return per page, default is 50",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50
            }
          },
          {
            "name": "page.number",
            "description": "The page number to return, default is 0",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "sort",
            "description": "Comma-separated list of fields to sort by. Use '-' prefix for descending order",
            "in": "query",
            "required": false,
            "example": "-originRating,name",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContributorSearchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContributorSearchResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/contributors/jobs": {
      "post": {
        "summary": "Create a single contributor job",
        "operationId": "contributorJobCreateOne",
        "description": "Create a single contributor job.",
        "tags": [
          "Contributors"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${contributorHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContributorJobCreateOneRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContributorJobCreateOneResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/records/{recordId}/creditsLists/{creditsListId}": {
      "get": {
        "summary": "Get a single credit list",
        "operationId": "creditsListFindOne",
        "description": "Retrieve a single credit list by its ID. Returns the list's name, ranking, default flag, and relationship links to the parent record and owning tenant.",
        "tags": [
          "Credits"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${creditsHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The ID of the record that owns the credit list.",
            "in": "path",
            "required": true,
            "example": "a1b2c3d4e5f6a7b8",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "creditsListId",
            "description": "The ID of the credit list to retrieve.",
            "in": "path",
            "required": true,
            "example": "f8e7d6c5b4a39281",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditsListFindOneResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "patch": {
        "summary": "Update a single credit list",
        "operationId": "creditsListUpdateOne",
        "description": "Partially update a credit list by its ID. Only the attributes included in the request body are changed. You can update the list's `name`, `ranking` order, and whether it is the `isDefault` list for the record.",
        "tags": [
          "Credits"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${creditsHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The ID of the record that owns the credit list.",
            "in": "path",
            "required": true,
            "example": "a1b2c3d4e5f6a7b8",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "creditsListId",
            "description": "The ID of the credit list to update.",
            "in": "path",
            "required": true,
            "example": "f8e7d6c5b4a39281",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreditsListUpdateOneRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditsListCreateOneResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/records/{recordId}/creditsLists": {
      "post": {
        "summary": "Create a single credit list",
        "operationId": "creditsListCreateOne",
        "description": "Create a new credit list for a record. Provide a display `name` for the list. Optionally set a `ranking` to control display order when a record has multiple credit lists, and `isDefault` to mark this as the primary list for the record.",
        "tags": [
          "Credits"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${creditsHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The ID of the record to create the credit list for.",
            "in": "path",
            "required": true,
            "example": "a1b2c3d4e5f6a7b8",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreditsListCreateOneRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditsListCreateOneResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "get": {
        "summary": "Get many credit lists for a record",
        "operationId": "creditsListFindMany",
        "description": "List all credit lists associated with a record. Use the `filter.isDefault` query parameter to narrow results to only the default credit list. Results include each list's name, ranking, and relationship links.",
        "tags": [
          "Credits"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${creditsHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The ID of the record whose credit lists to retrieve.",
            "in": "path",
            "required": true,
            "example": "a1b2c3d4e5f6a7b8",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter.isDefault",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "When `true`, returns only the default credit list for the record. When `false`, returns only non-default lists. Omit to return all lists."
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved credits lists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditsListFindManyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/records/{recordId}/creditsLists/{creditsListId}/operations": {
      "post": {
        "summary": "Execute atomic operations on a credit list",
        "operationId": "creditsListAtomicOperations",
        "description": "Apply one or more credit operations (`add`, `update`, `remove`) to a credit list in a single transactional call. Use `add` to create a new credit entry linking a contributor with a job role. Use `update` to modify an existing credit's attributes. Use `remove` to delete a credit. All operations in a single request succeed or fail together.",
        "tags": [
          "Credits"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${creditsHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The ID of the record that owns the credit list.",
            "in": "path",
            "required": true,
            "example": "a1b2c3d4e5f6a7b8",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "creditsListId",
            "description": "The ID of the credit list to apply operations to.",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "example": "f8e7d6c5b4a39281",
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreditsListAtomicOperationsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Accepted"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/records/{recordId}/creditsLists/{creditsListId}/credits": {
      "get": {
        "summary": "Get many credits for a credit list",
        "operationId": "creditsFindMany",
        "description": "List the credits in a credit list, filtered by job role. Returns contributor details, billing order (`ranking`), and character names where applicable. Supports cursor-based pagination for large casts.",
        "tags": [
          "Credits"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${creditsHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The ID of the record that owns the credit list.",
            "in": "path",
            "required": true,
            "example": "a1b2c3d4e5f6a7b8",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "creditsListId",
            "description": "The ID of the credit list to retrieve credits from.",
            "in": "path",
            "required": true,
            "example": "f8e7d6c5b4a39281",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter.job",
            "in": "query",
            "required": true,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter credits by job role. Must be one of the supported roles: `Actor`, `Director`, `Executive Producer`, `Producer`, `Creator`, `Writer`, `Editor`. Example: `filter.job=Actor`"
          },
          {
            "name": "page.cursor",
            "in": "query",
            "description": "Opaque cursor value returned by a previous response for fetching the next page of results.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditsFindManyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/contributors/{contributorId}/credits": {
      "get": {
        "summary": "Get many credits for a contributor",
        "operationId": "creditsFindManyByContributor",
        "description": "List all credits associated with a specific contributor, filtered by job role. Useful for finding all titles where a contributor has a particular role, such as all records where they are credited as an Actor.",
        "tags": [
          "Credits"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${creditsHttpApi}"
        },
        "parameters": [
          {
            "name": "contributorId",
            "description": "The ID of the contributor whose credits to retrieve.",
            "in": "path",
            "required": true,
            "example": "6883cdbce189e1b8",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter.job",
            "in": "query",
            "required": true,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter credits by job role. Must be one of the supported roles: `Actor`, `Director`, `Executive Producer`, `Producer`, `Creator`, `Writer`, `Editor`. Example: `filter.job=Actor`"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditsFindManyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/dataDeliveries": {
      "get": {
        "summary": "Get all data deliveries",
        "operationId": "dataDeliveryFindMany",
        "description": "Get all data deliveries for the current tenant. Supports filtering by status and state, and pagination via cursor.",
        "tags": [
          "Data Deliveries"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataDeliveryHttpApi}"
        },
        "parameters": [
          {
            "name": "filter.tenant.id",
            "in": "query",
            "description": "Filter by tenant ID. Only available for system users.",
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{16}$"
            }
          },
          {
            "name": "filter.status",
            "in": "query",
            "description": "Filter by status (IN_PROGRESS, COMPLETED, or DELETING)",
            "schema": {
              "type": "string",
              "enum": [
                "IN_PROGRESS",
                "COMPLETED",
                "DELETING"
              ]
            }
          },
          {
            "name": "filter.exportJobStatus",
            "in": "query",
            "description": "Filter by export job status (AWS Step Functions: PENDING, RUNNING, SUCCEEDED, PARTIALLY_SUCCEEDED, FAILED, TIMED_OUT, ABORTED, PENDING_REDRIVE)",
            "schema": {
              "type": "string",
              "enum": [
                "PENDING",
                "RUNNING",
                "SUCCEEDED",
                "PARTIALLY_SUCCEEDED",
                "FAILED",
                "TIMED_OUT",
                "ABORTED",
                "PENDING_REDRIVE"
              ]
            }
          },
          {
            "name": "filter.created.after",
            "in": "query",
            "description": "Filter data deliveries created after this date-time (inclusive, ISO 8601 format)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "filter.created.before",
            "in": "query",
            "description": "Filter data deliveries created before this date-time (inclusive, ISO 8601 format)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page.cursor",
            "in": "query",
            "description": "The cursor to use for pagination",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataDeliveryFindManyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "post": {
        "summary": "Create a single data delivery",
        "operationId": "dataDeliveryCreateOne",
        "description": "Create a single data delivery. Tenants can create their own data deliveries.",
        "tags": [
          "Data Deliveries"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataDeliveryHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataDeliveryCreateOneRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataDeliveryCreateOneResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/dataDeliveries/{dataDeliveryId}": {
      "get": {
        "summary": "Get a single data delivery",
        "operationId": "dataDeliveryFindOne",
        "description": "Get a single data delivery by ID.",
        "tags": [
          "Data Deliveries"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataDeliveryHttpApi}"
        },
        "parameters": [
          {
            "name": "dataDeliveryId",
            "description": "The ID of the data delivery to retrieve",
            "in": "path",
            "required": true,
            "example": "6883cdbce189e1b8",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataDeliveryFindOneResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "put": {
        "summary": "Update a single data delivery",
        "operationId": "dataDeliveryUpdateOne",
        "description": "Update a single data delivery by ID. Update is allowed only if the status is IN_PROGRESS.",
        "tags": [
          "Data Deliveries"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataDeliveryHttpApi}"
        },
        "parameters": [
          {
            "name": "dataDeliveryId",
            "description": "The ID of the data delivery to update",
            "in": "path",
            "required": true,
            "example": "6883cdbce189e1b8",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataDeliveryUpdateOneRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/dataDeliveries/{dataDeliveryId}/duplicate": {
      "post": {
        "summary": "Duplicate a data delivery",
        "operationId": "dataDeliveryDuplicateOne",
        "description": "Creates a new data delivery package by duplicating an existing one (same records). Allowed source packages: IN_PROGRESS with exportJobStatus PENDING, or COMPLETED. New package name appends ' (Copy)'.",
        "tags": [
          "Data Deliveries"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataDeliveryHttpApi}"
        },
        "parameters": [
          {
            "name": "dataDeliveryId",
            "description": "The ID of the data delivery to duplicate",
            "in": "path",
            "required": true,
            "example": "6883cdbce189e1b8",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataDeliveryCreateOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/dataDeliveries/{dataDeliveryId}/relationships/records": {
      "get": {
        "summary": "Get records relationship (linkage)",
        "operationId": "dataDeliveryFindRecordsRelationship",
        "description": "Returns all linkage records for the data delivery package as JSON:API resource identifiers (type + id). Supports optional pagination via page.size and page.number.",
        "tags": [
          "Data Deliveries"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataDeliveryHttpApi}"
        },
        "parameters": [
          {
            "name": "dataDeliveryId",
            "description": "The ID of the data delivery",
            "in": "path",
            "required": true,
            "example": "6883cdbce189e1b8",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page.size",
            "in": "query",
            "description": "Number of resource identifiers per page (default: return all)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            }
          },
          {
            "name": "page.number",
            "in": "query",
            "description": "1-based page number (used with page.size)",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataDeliveryFindRecordsRelationshipResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "post": {
        "summary": "Add records to data delivery relationship",
        "operationId": "dataDeliveryAddRecordsRelationship",
        "description": "Adds (appends) records to the relationship without removing existing ones. Maximum 50000 records per data delivery. Server will not add duplicates if a record is already present. Update is allowed only if the status is IN_PROGRESS.",
        "tags": [
          "Data Deliveries"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataDeliveryHttpApi}"
        },
        "parameters": [
          {
            "name": "dataDeliveryId",
            "description": "The ID of the data delivery",
            "in": "path",
            "required": true,
            "example": "6883cdbce189e1b8",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataDeliveryAddRecordsRelationshipRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "delete": {
        "summary": "Remove records from data delivery relationship",
        "operationId": "dataDeliveryRemoveRecordsRelationship",
        "description": "Removes specific records from the relationship. Update is allowed only if the status is IN_PROGRESS.",
        "tags": [
          "Data Deliveries"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataDeliveryHttpApi}"
        },
        "parameters": [
          {
            "name": "dataDeliveryId",
            "description": "The ID of the data delivery",
            "in": "path",
            "required": true,
            "example": "6883cdbce189e1b8",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataDeliveryRemoveRecordsRelationshipRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/dataDeliveries/jobs": {
      "post": {
        "summary": "Create a data delivery job",
        "operationId": "dataDeliveryExportJobCreateOne",
        "description": "Creates a background job. For type exportDataDelivery: export is allowed only if status is IN_PROGRESS and exportJobStatus is PENDING; starts the dataDelivery state machine. For type deleteDataDelivery: delete is allowed if status is IN_PROGRESS with exportJobStatus PENDING, or status is COMPLETED; starts the dataDeliveryDelete state machine.",
        "tags": [
          "Data Deliveries"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataDeliveryHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataDeliveryExportJobCreateOneRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataDeliveryExportJobCreateOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/data-ingress": {
      "post": {
        "summary": "Create a new data ingress execution",
        "description": "Creates a new data ingress execution to import records from an external source. The execution runs asynchronously in the background. The `sourceAdapterType` determines how data is fetched. The `importType` controls the import strategy: `api` paginates through an external API, while `file` reads items from an uploaded file. Poll the execution status using the returned ID.",
        "operationId": "dataIngressCreateOne",
        "tags": [
          "DataIngress"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataIngressHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataIngressCreateOneRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Data ingress execution created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataIngressCreateOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid source adapter or payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "get": {
        "summary": "List data ingress executions",
        "description": "Returns a list of data ingress executions for the tenant, sorted by creation time in descending order (most recent first). Can be filtered by status.",
        "operationId": "dataIngressFindMany",
        "tags": [
          "DataIngress"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataIngressHttpApi}"
        },
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter by execution status",
            "schema": {
              "type": "string",
              "enum": [
                "PENDING",
                "IN_PROGRESS",
                "COMPLETED",
                "FAILED"
              ]
            }
          },
          {
            "name": "page.limit",
            "in": "query",
            "description": "Maximum number of executions to return (default: 20)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "page.cursor",
            "in": "query",
            "description": "Cursor for pagination",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataIngressFindManyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/data-ingress/{dataIngressId}": {
      "get": {
        "summary": "Get a specific data ingress execution",
        "description": "Returns a single data ingress execution by its ID, including full details such as payload, output, and progress counts.",
        "operationId": "dataIngressFindOne",
        "tags": [
          "DataIngress"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataIngressHttpApi}"
        },
        "parameters": [
          {
            "name": "dataIngressId",
            "in": "path",
            "required": true,
            "description": "The data ingress execution ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataIngressFindOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/data-ingress/upload-url": {
      "post": {
        "summary": "Generate a presigned URL for file upload",
        "description": "Generates a presigned S3 URL that can be used to upload a file for data ingress. The returned URL accepts HTTP PUT requests with the file content. The uploaded file can then be referenced when creating a file-based data ingress execution.",
        "operationId": "dataIngressGetUploadUrl",
        "tags": [
          "DataIngress"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataIngressHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataIngressGetUploadUrlRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Presigned upload URL generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataIngressGetUploadUrlResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid file name or content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/data-ingress/download-url": {
      "post": {
        "summary": "Generate a presigned URL for file download",
        "description": "Generates a presigned S3 URL that can be used to download a file from the data ingress bucket. The returned URL accepts HTTP GET requests.",
        "operationId": "dataIngressGetDownloadUrl",
        "tags": [
          "DataIngress"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataIngressHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataIngressGetDownloadUrlRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Presigned download URL generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataIngressGetDownloadUrlResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/data-ingress/scan-columns": {
      "post": {
        "summary": "Scan a file and return column names and unique categorical values",
        "description": "Reads an uploaded file directly from the S3 ingress bucket and returns all column/key names plus the unique values found in requested categorical columns. Supports CSV, JSON, and JSONL formats. The file must have been previously uploaded via the upload-url endpoint. The S3 key is derived server-side from the tenant and file name — never supplied by the caller.",
        "operationId": "dataIngressScanColumns",
        "tags": [
          "DataIngress"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataIngressHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataIngressScanColumnsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File scanned successfully — column names and unique values returned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataIngressScanColumnsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request — requested column exceeds unique value cap or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found — file does not exist in the ingress bucket",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/dataWarehouseSettings": {
      "get": {
        "summary": "List data warehouse settings",
        "operationId": "dataWarehouseSettingsFindMany",
        "description": "Retrieve your current data export settings. Exports can only be set up once, so this returns at most one item. An empty list means exports have not been turned on yet. Available to Enterprise-plan customers only.",
        "tags": [
          "Data Warehouse Settings"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataWarehouseHttpApi}"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataWarehouseSettingsFindManyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (your plan does not include data exports, or you do not have permission)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "post": {
        "summary": "Enable data warehouse exports",
        "operationId": "dataWarehouseSettingsCreateOne",
        "description": "Turn on scheduled data exports. Returns an error if exports are already turned on. Available to Enterprise-plan customers only.",
        "tags": [
          "Data Warehouse Settings"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataWarehouseHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataWarehouseSettingsCreateOneRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataWarehouseSettingsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (your plan does not include data exports, or you do not have permission)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict (exports are already turned on)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity (the IAM role provided is not valid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/dataWarehouseSettings/{id}": {
      "get": {
        "summary": "Get data warehouse settings",
        "operationId": "dataWarehouseSettingsFindOne",
        "description": "Retrieve your data export settings by ID. Available to Enterprise-plan customers only.",
        "tags": [
          "Data Warehouse Settings"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataWarehouseHttpApi}"
        },
        "parameters": [
          {
            "name": "id",
            "description": "The ID of the export settings to retrieve",
            "in": "path",
            "required": true,
            "example": "dws-6883cdbce189e1b8",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataWarehouseSettingsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (your plan does not include data exports, or you do not have permission)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found (exports are not turned on, or the ID does not match)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "patch": {
        "summary": "Update data warehouse settings",
        "operationId": "dataWarehouseSettingsUpdateOne",
        "description": "Update your data export settings. Send only the fields you want to change. Available to Enterprise-plan customers only.",
        "tags": [
          "Data Warehouse Settings"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataWarehouseHttpApi}"
        },
        "parameters": [
          {
            "name": "id",
            "description": "The ID of the export settings to update",
            "in": "path",
            "required": true,
            "example": "dws-6883cdbce189e1b8",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataWarehouseSettingsUpdateOneRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataWarehouseSettingsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (your plan does not include data exports, or you do not have permission)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found (exports are not turned on)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity (the IAM role provided is not valid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "delete": {
        "summary": "Delete data warehouse settings and tear down all resources",
        "operationId": "dataWarehouseSettingsDeleteOne",
        "description": "Permanently delete the tenant's data warehouse settings and tear down every provisioned resource. Used for support & internal testing only.",
        "tags": [
          "Data Warehouse Settings"
        ],
        "x-internal": true,
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${dataWarehouseHttpApi}"
        },
        "parameters": [
          {
            "name": "id",
            "description": "The ID of the export settings to delete",
            "in": "path",
            "required": true,
            "example": "dws-6883cdbce189e1b8",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content (settings and resources deleted)"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found (exports are not turned on, or the ID does not match)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/datasets": {
      "get": {
        "summary": "Get datasets",
        "operationId": "datasetFindMany",
        "description": "Returns all datasets available to the current tenant, including system-provisioned datasets (shared across all tenants) and tenant-specific custom datasets. Use `filter.label` or `filter.id` to narrow results.",
        "tags": [
          "Datasets"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${fieldHttpApi}"
        },
        "parameters": [
          {
            "name": "filter.label",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter datasets by label. Example: filter.label=My Label"
          },
          {
            "name": "filter.id",
            "in": "query",
            "required": false,
            "style": "form",
            "example": "1d9376efd79b0bd5",
            "explode": false,
            "schema": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              ]
            },
            "description": "Filter datasets by one or more ids."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDatasetsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "post": {
        "summary": "Create a new dataset",
        "operationId": "datasetCreateOne",
        "description": "Creates a new dataset for the current tenant. Requires `label`, `key`, and `dataSource`. Set `localized: true` and provide `availableLocales` for datasets whose items are locale-specific. The `key` must be unique within the tenant. Use the `datasetAtomicOperations` endpoint to add items after creation.",
        "tags": [
          "Datasets"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${fieldHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDatasetRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDatasetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/datasets/{datasetId}": {
      "get": {
        "summary": "Get a dataset",
        "operationId": "datasetFindOne",
        "description": "Retrieves a single dataset by its unique ID. The response includes the dataset's attributes, such as `label`, `key`, `localized`, `allowCustomItems`, and a link to its items.",
        "tags": [
          "Datasets"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${fieldHttpApi}"
        },
        "parameters": [
          {
            "name": "datasetId",
            "description": "The ID of the dataset to retrieve",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDatasetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "patch": {
        "summary": "Update a dataset and its items",
        "operationId": "datasetUpdateOne",
        "description": "Partially updates a dataset's attributes. Only the attributes provided in the request body are modified. Currently supports updating `label`. To add, update, or remove items, use the `datasetAtomicOperations` endpoint.",
        "tags": [
          "Datasets"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${fieldHttpApi}"
        },
        "parameters": [
          {
            "name": "datasetId",
            "description": "The ID of the dataset to update",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchDatasetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDatasetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "delete": {
        "summary": "Delete a dataset and its items",
        "operationId": "datasetDeleteOne",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WriteMetaOnlyRequest"
              }
            }
          }
        },
        "description": "Deletes a dataset and all of its associated items. Returns `409 Conflict` if the dataset is currently referenced by one or more fields. To delete, first unlink the dataset from any fields.",
        "tags": [
          "Datasets"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${fieldHttpApi}"
        },
        "parameters": [
          {
            "name": "datasetId",
            "description": "The ID of the dataset to delete",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict - Dataset in use",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/datasets/{datasetId}/items": {
      "get": {
        "summary": "Get a dataset's items",
        "operationId": "datasetItemFindMany",
        "description": "Returns all items in a dataset. Items are the individual entries in a controlled vocabulary list (for example, individual genres or ratings). Use `filter.locale` to filter items by language for localized datasets. Use `filter.searchTerm` to perform a text search within items.",
        "tags": [
          "Datasets"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${fieldHttpApi}"
        },
        "parameters": [
          {
            "name": "datasetId",
            "description": "The ID of the dataset to retrieve",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter.locale",
            "description": "The locale to use for the response",
            "in": "query",
            "example": "fr",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "filter.searchTerm",
            "in": "query",
            "required": false,
            "style": "form",
            "example": "My Search Term",
            "explode": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter datasets by search term."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDatasetItemsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/datasets/{datasetId}/operations": {
      "post": {
        "summary": "Execute an atomic operation on a dataset",
        "operationId": "datasetAtomicOperations",
        "description": "Adds, updates, or removes items in a dataset using a single atomic request. All operations in the array are applied together — either all succeed or none are applied. Supports up to 99 operations per request. Only datasets with `allowCustomItems: true` accept modifications. Operations: `add` to create a new item, `update` to change an existing item's display value, `remove` to delete an item.",
        "tags": [
          "Datasets"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${fieldHttpApiVpc}"
        },
        "parameters": [
          {
            "name": "datasetId",
            "description": "The ID of the dataset to execute the operation on",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecuteDatasetOperationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Accepted"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/fields": {
      "get": {
        "summary": "Get fields",
        "operationId": "fieldFindMany",
        "description": "Returns all metadata fields available to the current tenant, including both system-provisioned fields (shared across all tenants) and tenant-specific custom fields. Use `filter.workType` to retrieve fields with layout position context. Use `include=dataset` or `include=dataset.items` to embed the linked controlled-vocabulary dataset in the response.",
        "tags": [
          "Fields"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${fieldHttpApi}"
        },
        "parameters": [
          {
            "name": "filter.key",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "example": "my_custom_field_key,another_custom_field_key",
            "schema": {
              "type": "string"
            },
            "description": "Filter fields by one or more keys."
          },
          {
            "name": "filter.dataSource",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "example": "custom",
            "schema": {
              "type": "string"
            },
            "description": "Filter fields by data source."
          },
          {
            "name": "filter.workType",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "example": "Movie",
            "schema": {
              "type": "string"
            },
            "description": "Filter fields by workType. When provided, fields are filtered based on record layout structure and include recordLayout relationship with group/section info."
          },
          {
            "name": "filter.id",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "example": "0bdcd5be2b10801f",
            "schema": {
              "type": "string"
            },
            "description": "Filter fields by one or more IDs (separated by commas). This filter takes precedence over all other filters."
          },
          {
            "name": "filter.label",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "string",
              "example": "My Label"
            },
            "description": "Filter fields by label."
          },
          {
            "name": "include",
            "description": "Include related resources. Supports multiple values separated by commas.",
            "in": "query",
            "required": false,
            "style": "form",
            "example": "dataset,dataset.items",
            "explode": false,
            "schema": {
              "type": "string",
              "enum": [
                "dataset",
                "dataset.items",
                "dataset,dataset.items"
              ]
            }
          },
          {
            "name": "tenantId",
            "description": "The ID of the tenant to retrieve fields for. If not provided, fields for the current tenant will be returned.",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "example": "bc3db7c2bdca76fd",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldFindManyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "post": {
        "summary": "Create a new field",
        "operationId": "fieldCreateOne",
        "description": "Creates a new custom metadata field for the current tenant. Requires `label`, `key`, and `dataType`. The `key` must be unique within the tenant and must not collide with the key of a system-provisioned field (`dataSource: fabric`) for the tenant; such keys are reserved and the request is rejected with a 400 BadRequestError. The `key` cannot be changed after creation. Tenants may create up to 250 custom fields. Optionally link a dataset relationship to constrain the field to a controlled vocabulary.",
        "tags": [
          "Fields"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${fieldHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FieldCreateOneRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldFindOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/fields/{fieldId}": {
      "get": {
        "summary": "Get a field by ID",
        "operationId": "fieldFindOne",
        "description": "Retrieves a single metadata field by its unique ID. Use `include=dataset` or `include=dataset.items` to embed the linked dataset or its items in the response.",
        "tags": [
          "Fields"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${fieldHttpApi}"
        },
        "parameters": [
          {
            "name": "fieldId",
            "description": "The ID of the field to retrieve",
            "in": "path",
            "required": true,
            "example": "0bdcd5be2b10801f",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include",
            "description": "Include related resources. Supports multiple values separated by commas.",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "example": "dataset,dataset.items",
            "schema": {
              "type": "string",
              "enum": [
                "dataset",
                "dataset.items",
                "dataset,dataset.items"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldFindOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "patch": {
        "summary": "Update a field by ID",
        "operationId": "fieldUpdateOne",
        "description": "Partially updates a metadata field. Only the attributes included in the request body are modified. Updatable attributes include `label`, `supportsInheritance`, `supportsKeywordSearch`, and `dataValidation` constraints. The `key`, `dataType`, `localized`, and `list` attributes cannot be changed after creation.",
        "tags": [
          "Fields"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${fieldHttpApiVpc}"
        },
        "parameters": [
          {
            "name": "fieldId",
            "description": "The ID of the field to update",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FieldUpdateOneRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldFindOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "delete": {
        "summary": "Delete field",
        "operationId": "fieldDeleteOne",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WriteMetaOnlyRequest"
              }
            }
          }
        },
        "description": "Deletes a custom metadata field by its unique ID. System-provisioned fields (with `dataSource: fabric`) cannot be deleted. Only tenant-created custom fields can be removed.",
        "tags": [
          "Fields"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${fieldHttpApiVpc}"
        },
        "parameters": [
          {
            "name": "fieldId",
            "description": "The ID of the field to delete",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/recordLayouts": {
      "get": {
        "summary": "Get record layouts",
        "operationId": "recordLayoutFindMany",
        "description": "Returns all record layouts for the current tenant. Each layout defines the editing UI structure (groups, sections, and field order) for a specific work type. Use `filter.workType` to retrieve the layout for a single work type such as `Movie` or `Series`.",
        "tags": [
          "Fields"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${fieldHttpApi}"
        },
        "parameters": [
          {
            "name": "tenantId",
            "description": "The ID of the tenant to retrieve the record layouts for. If not provided, record layouts for the current tenant will be returned.",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter.workType",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "example": "Movie",
            "schema": {
              "type": "string"
            },
            "description": "Filter record layouts by the workType."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordLayoutFindManyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "post": {
        "summary": "Create a new record layout",
        "operationId": "recordLayoutCreateOne",
        "description": "Creates a new record layout for a specific work type. The layout defines the editing UI structure as an ordered hierarchy of groups, sections, and field references. The request must include a valid `workType` (`Movie`, `Series`, `Season`, `Episode`, or `Compilation`), a `name`, and the `groups` hierarchy. All field IDs referenced in the layout must belong to the tenant.",
        "tags": [
          "Fields"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${fieldHttpApi}"
        },
        "parameters": [
          {
            "name": "tenantId",
            "description": "The ID of the tenant to create the record layout for. If not provided, the current tenant will be used.",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordLayoutCreateOneRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordLayoutFindOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/recordLayouts/{recordLayoutId}": {
      "get": {
        "summary": "Get a record layout by ID",
        "operationId": "recordLayoutFindOne",
        "description": "Retrieves a single record layout by its unique ID. The response includes the full layout structure: groups, sections, and the ordered list of field references.",
        "tags": [
          "Fields"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${fieldHttpApi}"
        },
        "parameters": [
          {
            "name": "recordLayoutId",
            "description": "The ID of the record layout to retrieve",
            "in": "path",
            "required": true,
            "example": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "description": "The ID of the tenant to retrieve the record layout for. If not provided, the current tenant will be used.",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordLayoutFindOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "patch": {
        "summary": "Update a record layout by ID",
        "operationId": "recordLayoutUpdateOne",
        "description": "Partially updates a record layout. Only the attributes provided are modified. Supports updating `name`, `description`, and the full `groups` hierarchy. When updating `groups`, the complete desired structure must be provided — the server replaces the existing hierarchy. All field IDs referenced must belong to the tenant, and required system groups (such as the origination group) must remain present.",
        "tags": [
          "Fields"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${fieldHttpApi}"
        },
        "parameters": [
          {
            "name": "recordLayoutId",
            "description": "The ID of the record layout to update",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "description": "The ID of the tenant to update the record layout for. If not provided, the current tenant will be used.",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordLayoutUpdateOneRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordLayoutFindOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "delete": {
        "summary": "Delete a record layout by ID",
        "operationId": "recordLayoutDeleteOne",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WriteMetaOnlyRequest"
              }
            }
          }
        },
        "description": "Deletes a record layout by its unique ID. Deleting a layout removes the UI structure definition for the associated work type but does not delete the underlying fields.",
        "tags": [
          "Fields"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${fieldHttpApi}"
        },
        "parameters": [
          {
            "name": "recordLayoutId",
            "description": "The ID of the record layout to delete",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "description": "The ID of the tenant to delete the record layout for. If not provided, the current tenant will be used.",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/global/licensedMetadataConfigs": {
      "get": {
        "summary": "List a tenant's licensed metadata provider configs",
        "operationId": "licensedMetadataConfigFindMany",
        "description": "Returns the caller's tenant's licensed metadata provider configs. Filter to one provider with `filter.provider`, or omit it to list every provider configured for the tenant. A provider with no config is not enabled.",
        "tags": [
          "Licensed Metadata"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${globalMetadataHttpApi}"
        },
        "parameters": [
          {
            "name": "filter.provider",
            "description": "Restrict the result to one provider's config.",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "gracenote"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LicensedMetadataConfigFindManyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "post": {
        "summary": "Enable a licensed metadata provider for a tenant",
        "operationId": "licensedMetadataConfigCreateOne",
        "description": "Enable a licensed third-party metadata provider (e.g. Gracenote) for the caller's tenant, using the tenant's own API key. A tenant may only have one config per provider.",
        "tags": [
          "Licensed Metadata"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${globalMetadataHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLicensedMetadataConfigRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LicensedMetadataConfigCreateOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict — a config already exists for this tenant and provider",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/global/licensedMetadataConfigs/{licensedMetadataConfigId}": {
      "patch": {
        "summary": "Update a licensed metadata provider config (e.g. rotate the API key)",
        "operationId": "licensedMetadataConfigUpdateOne",
        "description": "Update an existing licensed metadata provider config by its ID, scoped to the caller's tenant. Use this to rotate the tenant's provider API key (write-only) or change the polling cadence WITHOUT tearing down the existing cache, cursors, or bucket. Only the attributes supplied are changed; omitted attributes are left as-is.",
        "tags": [
          "Licensed Metadata"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${globalMetadataHttpApi}"
        },
        "parameters": [
          {
            "name": "licensedMetadataConfigId",
            "description": "The ID of the licensed metadata config to update.",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLicensedMetadataConfigRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LicensedMetadataConfigCreateOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "delete": {
        "summary": "Disable a licensed metadata provider config",
        "operationId": "licensedMetadataConfigDeleteOne",
        "description": "Disable a licensed metadata provider config by its ID, scoped to the caller's tenant. The stored API key is deleted immediately. Previously cached data for this provider is not deleted by this call.",
        "tags": [
          "Licensed Metadata"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${globalMetadataHttpApi}"
        },
        "parameters": [
          {
            "name": "licensedMetadataConfigId",
            "description": "The ID of the licensed metadata config to disable.",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/global/licensedMetadataConfigs/{licensedMetadataConfigId}/seedJob": {
      "post": {
        "summary": "Start a licensed metadata config's initial data seed",
        "operationId": "licensedMetadataConfigSeedJobCreateOne",
        "description": "Starts the initial data seed for a licensed metadata provider config as a background job. This can take a long time to complete depending on the provider's entitlement size. Ongoing polling for new updates only begins once the seed finishes successfully. Only one seed job may run at a time per config.",
        "tags": [
          "Licensed Metadata"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${globalMetadataHttpApi}"
        },
        "parameters": [
          {
            "name": "licensedMetadataConfigId",
            "description": "The ID of the licensed metadata config to seed.",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "maxIterations",
            "description": "Testing/diagnostic use only. Hard-stops the seed after this many pages regardless of end-of-stream, instead of draining the full entitlement. Omit for normal use.",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackgroundJobFindOneResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict — a seed job is already running for this config",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/media/storage": {
      "get": {
        "summary": "Get media storage for tenant",
        "operationId": "mediaStorageFindOne",
        "description": "Get the media storage information for a tenant, including committed bytes and limit.",
        "tags": [
          "Media"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${mediaHttpApi}"
        },
        "parameters": [
          {
            "name": "tenantId",
            "description": "The ID of the tenant to get storage info for. If not provided, the tenant ID is extracted from the token.",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved media storage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaStorageFindOneResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "post": {
        "summary": "Create a media storage for tenant",
        "operationId": "mediaStorageCreateOne",
        "description": "Create a media storage for tenant.",
        "tags": [
          "Media"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${mediaHttpApi}"
        },
        "parameters": [
          {
            "name": "tenantId",
            "description": "The ID of the tenant to provision storage for.",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/records/{recordId}/media": {
      "get": {
        "summary": "Get many media for a record",
        "operationId": "mediaFindMany",
        "description": "Get many media for a record.",
        "tags": [
          "Media"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${mediaHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The ID of the record to get the media for",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter.mediaType",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/MediaAttributeMediaType"
            },
            "description": "Filter media by mediaType. Example: filter.mediaType=image"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved media",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaFindManyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type. The media type is not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/records/{recordId}/media/poster": {
      "get": {
        "summary": "Get poster image for a record",
        "operationId": "mediaFindPoster",
        "description": "Get the poster image for a record. Returns only media items with imageType=Poster.",
        "tags": [
          "Media"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${mediaHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The ID of the record to get the poster for",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved poster",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaFindManyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/records/{recordId}/media/archives": {
      "post": {
        "summary": "Archive many media",
        "operationId": "mediaArchiveMany",
        "description": "Archive multiple media items. Provide a list of media IDs. The service validates each item and ensures the combined size does not exceed 2 GB. It then downloads all media, creates a ZIP, and returns a presigned URL to download it. The ZIP file is named tenantId_recordId_uuid.zip.",
        "tags": [
          "Media"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${mediaHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The ID of the record to archive the media for",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaArchiveManyRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaArchiveManyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/records/{recordId}/media/operations": {
      "post": {
        "summary": "Execute an atomic operation on a media",
        "operationId": "mediaAtomicOperations",
        "description": "Execute an atomic operation on a media.",
        "tags": [
          "Media"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${mediaHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The ID of the record to execute the operation on",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaAtomicOperationsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully executed the atomic operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaAtomicOperationsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/records": {
      "post": {
        "summary": "Create a new record",
        "operationId": "newRecordCreateOne",
        "description": "Create a new record from scratch with associated metadata and relationships. All writes are executed atomically — the request either succeeds entirely or has no effect. Requests are limited to 100 total write operations: 1 for the record itself, plus 1 per compilation linkage, plus 1 per non-localized field value and 1 per localized field value per locale. Requests that exceed this limit will be rejected with a 400 error.",
        "tags": [
          "Records"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${recordHttpApi}"
        },
        "requestBody": {
          "description": "JSON payload defining the record to create, including core metadata, relationships, and custom field data.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewRecordCreateRequest"
              },
              "examples": {
                "movieMinimal": {
                  "summary": "Movie — minimal",
                  "description": "Smallest valid payload: only the required `workType` and `primaryTitle`. `parentId` is never set for a Movie — it is always standalone.",
                  "value": {
                    "data": {
                      "type": "records",
                      "attributes": {
                        "workType": "Movie",
                        "primaryTitle": "The Last Voyage"
                      }
                    }
                  }
                },
                "movieFull": {
                  "summary": "Movie — full metadata",
                  "description": "A Movie with locale-scoped genres, release info, and external system identifiers populated alongside the core attributes.",
                  "value": {
                    "data": {
                      "type": "records",
                      "attributes": {
                        "workType": "Movie",
                        "primaryTitle": "The Last Voyage",
                        "workTypeDetail": "Feature Film",
                        "releaseYear": 2025,
                        "releaseDate": "2025-11-14",
                        "runLength": 118,
                        "countriesOfOrigin": [
                          "US",
                          "GB"
                        ],
                        "primarySpokenLanguage": "en",
                        "genres": {
                          "en": [
                            "Drama",
                            "Thriller"
                          ],
                          "fr": [
                            "Drame",
                            "Thriller"
                          ]
                        },
                        "imdbId": "tt1234567",
                        "eidrId": "10.5240/1234-5678-9ABC-DEF0-1234-5",
                        "tmdbId": "987654"
                      }
                    }
                  }
                },
                "movieEditVariation": {
                  "summary": "MovieEdit — variation of an existing Movie",
                  "description": "`MovieEdit` represents an alternate cut (e.g. director's cut, TV edit) of a Movie. Like Movie it is standalone — `MovieEdit` is not a hierarchical child of the Movie it varies; the relationship between them is tracked outside `parentId`.",
                  "value": {
                    "data": {
                      "type": "records",
                      "attributes": {
                        "workType": "MovieEdit",
                        "primaryTitle": "The Last Voyage (Director's Cut)",
                        "workTypeDetail": "Director's Cut",
                        "runLength": 142
                      }
                    }
                  }
                },
                "series": {
                  "summary": "Series — top level",
                  "description": "A Series is always top-level: `relationships.parent` must be omitted. Seasons and/or Episodes are created afterward as separate requests, each pointing back at this Series as their parent.",
                  "value": {
                    "data": {
                      "type": "records",
                      "attributes": {
                        "workType": "Series",
                        "primaryTitle": "Northern Skies",
                        "genres": {
                          "en": [
                            "Drama"
                          ]
                        },
                        "countriesOfOrigin": [
                          "CA"
                        ]
                      }
                    }
                  }
                },
                "seasonUnderSeries": {
                  "summary": "Season — standard 3-level hierarchy",
                  "description": "Standard TV hierarchy: a Season's parent must be a `Series` (never a `Movie` or `Episode`). `sequenceNumber` carries the season number.",
                  "value": {
                    "data": {
                      "type": "records",
                      "attributes": {
                        "workType": "Season",
                        "primaryTitle": "Northern Skies — Season 1",
                        "sequenceNumber": 1
                      },
                      "relationships": {
                        "parent": {
                          "data": {
                            "id": "8f14e45fceea167a",
                            "type": "records"
                          }
                        }
                      }
                    }
                  }
                },
                "episodeUnderSeason": {
                  "summary": "Episode — under a Season (standard hierarchy)",
                  "description": "In the standard 3-level hierarchy an Episode's parent is the Season. `sequenceNumber` carries the episode number within that season.",
                  "value": {
                    "data": {
                      "type": "records",
                      "attributes": {
                        "workType": "Episode",
                        "primaryTitle": "Northern Skies — S1E1 — Arrival",
                        "sequenceNumber": 1
                      },
                      "relationships": {
                        "parent": {
                          "data": {
                            "id": "5f4dcc3b5aa765d6",
                            "type": "records"
                          }
                        }
                      }
                    }
                  }
                },
                "episodeUnderSeriesLimited": {
                  "summary": "Episode — under a Series directly (limited series / miniseries)",
                  "description": "Limited series / miniseries skip the Season level entirely: the Episode's parent is the Series itself. This is the only case where an Episode's `relationships.parent` points at a `Series` instead of a `Season`.",
                  "value": {
                    "data": {
                      "type": "records",
                      "attributes": {
                        "workType": "Episode",
                        "primaryTitle": "Cold Case Files — Part One",
                        "sequenceNumber": 1
                      },
                      "relationships": {
                        "parent": {
                          "data": {
                            "id": "9c3c1c6f2a4b4e2f",
                            "type": "records"
                          }
                        }
                      }
                    }
                  }
                },
                "episodeEditVariation": {
                  "summary": "EpisodeEdit — variation of an existing Episode",
                  "description": "Analogous to `MovieEdit` but for an Episode (e.g. an extended cut). Standalone like `MovieEdit` — not linked via `parentId`.",
                  "value": {
                    "data": {
                      "type": "records",
                      "attributes": {
                        "workType": "EpisodeEdit",
                        "primaryTitle": "Northern Skies — S1E1 — Arrival (Extended Cut)",
                        "workTypeDetail": "Extended Cut"
                      }
                    }
                  }
                },
                "compilation": {
                  "summary": "Compilation — created empty, members added afterward",
                  "description": "A Compilation is standalone (no `parentId`, no `relationships.parent`). Its members are linked, not nested as hierarchy children — add them after creation via `POST /records/{recordId}/compilationMembers/operations`, or seed the initial members inline with `relationships.compilationMembers` as shown in the `compilationCreatedWithMembers` example.",
                  "value": {
                    "data": {
                      "type": "records",
                      "attributes": {
                        "workType": "Compilation",
                        "primaryTitle": "Best of Northern Skies"
                      }
                    }
                  }
                },
                "compilationCreatedWithMembers": {
                  "summary": "Compilation — created with initial members",
                  "description": "Links member records at creation time via `relationships.compilationMembers`, each counted toward the 100 write-operation limit for this request (1 for the record + 1 per member).",
                  "value": {
                    "data": {
                      "type": "records",
                      "attributes": {
                        "workType": "Compilation",
                        "primaryTitle": "Best of Northern Skies"
                      },
                      "relationships": {
                        "compilationMembers": [
                          {
                            "data": {
                              "type": "records",
                              "id": "5f4dcc3b5aa765d6",
                              "ranking": 1
                            }
                          },
                          {
                            "data": {
                              "type": "records",
                              "id": "9c3c1c6f2a4b4e2f",
                              "ranking": 2
                            }
                          }
                        ]
                      }
                    }
                  }
                },
                "linkedToExistingCompilations": {
                  "summary": "Movie — linked to existing Compilation(s) at creation",
                  "description": "Instead of adding this record to a Compilation afterward, `relationships.compilations` links it to one or more already-existing Compilation records as part of the same atomic write.",
                  "value": {
                    "data": {
                      "type": "records",
                      "attributes": {
                        "workType": "Movie",
                        "primaryTitle": "The Last Voyage"
                      },
                      "relationships": {
                        "compilations": [
                          {
                            "data": {
                              "type": "records",
                              "id": "1f3870be274f6c49"
                            }
                          }
                        ]
                      }
                    }
                  }
                },
                "withCustomFields": {
                  "summary": "Movie — with tenant-defined custom fields",
                  "description": "Alongside the fixed set of core attributes, a tenant can define its own custom fields; their values are sent as additional keys under `attributes`. Custom fields may be a plain string, number, boolean, a list of strings, or — for a localized custom field — an object keyed by locale.",
                  "value": {
                    "data": {
                      "type": "records",
                      "attributes": {
                        "workType": "Movie",
                        "primaryTitle": "The Last Voyage",
                        "tagline": "Every ending is a beginning.",
                        "internalPriority": 3,
                        "isAwardEligible": true,
                        "keywords": [
                          "ocean",
                          "survival",
                          "redemption"
                        ],
                        "synopsis": {
                          "en": "A gripping tale of survival at sea.",
                          "fr": "Une histoire poignante de survie en mer."
                        }
                      }
                    }
                  }
                },
                "withSecurityTags": {
                  "summary": "Movie — created with explicit security tags",
                  "description": "Assigns one or more security tags at creation via `relationships.securityTags`. If omitted, the tenant's default security tag is applied instead.",
                  "value": {
                    "data": {
                      "type": "records",
                      "attributes": {
                        "workType": "Movie",
                        "primaryTitle": "The Last Voyage"
                      },
                      "relationships": {
                        "securityTags": {
                          "data": [
                            {
                              "id": "0d61f8370cad1d40",
                              "type": "securityTags"
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "withClientProvidedId": {
                  "summary": "Movie — with a caller-supplied ID",
                  "description": "`data.id` is optional and normally omitted so the server auto-generates it; set it explicitly only when the ID must be predictable (e.g. import/migration tooling coordinating IDs across systems).",
                  "value": {
                    "data": {
                      "id": "c1a2b3d4e5f60718",
                      "type": "records",
                      "attributes": {
                        "workType": "Movie",
                        "primaryTitle": "The Last Voyage"
                      }
                    }
                  }
                },
                "withAuditMeta": {
                  "summary": "Movie — with audit metadata",
                  "description": "Optional `meta.audit` records why/from-where the write was made (e.g. a bulk-import job). Both `source` and `reason` are optional and free text.",
                  "value": {
                    "meta": {
                      "audit": {
                        "source": "studio-web",
                        "reason": "Bulk import from catalog spreadsheet"
                      }
                    },
                    "data": {
                      "type": "records",
                      "attributes": {
                        "workType": "Movie",
                        "primaryTitle": "The Last Voyage"
                      }
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NewRecordFindOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request — validation failure (e.g. invalid parent `workType` for the given child `workType`, or the 100 write-operation limit exceeded)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/records/{recordId}": {
      "get": {
        "summary": "Find a record by its unique Studio ID",
        "operationId": "newRecordFindOne",
        "description": "Find a record by its unique Studio ID.",
        "tags": [
          "Records"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${recordHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The unique Studio ID of the record to retrieve",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "description": "Overrides which tenant to retrieve the record from, instead of the caller's own tenant. Overriding is subject to the caller's own access-control permissions in the target tenant.",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "8f14e45fceea167a"
          },
          {
            "name": "meta.viewingLocale",
            "description": "The locale currently being viewed. This does NOT select which data is returned (the response always carries all locales); it only sets the perspective used to evaluate which sections/fields are hidden (meta.redactions), so unauthorized sections are hidden even for locales that have no data yet. The resolved value is echoed back in meta.viewingLocale. Defaults to 'en'.",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "string"
            },
            "example": "en"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NewRecordFindOneResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "patch": {
        "summary": "Update a record's core metadata or its relationships using its unique Studio ID",
        "operationId": "newRecordUpdateOne",
        "description": "Update a record's core metadata, field values, or relationships using its unique Studio ID. Field value and core metadata writes are executed atomically — the request either succeeds entirely or has no effect. Requests are limited to 99 total field write operations (1 per non-localized field value and 1 per localized field value per locale). Requests that exceed this limit will be rejected with a 400 error.",
        "tags": [
          "Records"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${recordHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The unique Studio ID of the record to update",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Partial update payload describing the metadata or relationships to modify for the specified record.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewRecordUpdateOneRequest"
              },
              "examples": {
                "updateCoreMetadata": {
                  "summary": "Update core metadata fields",
                  "description": "Only the attributes included are changed; any attribute omitted is left untouched. `data.id` and `data.type` are always required.",
                  "value": {
                    "data": {
                      "id": "5f4dcc3b5aa765d6",
                      "type": "records",
                      "attributes": {
                        "primaryTitle": "The Last Voyage (2025)",
                        "releaseYear": 2025,
                        "runLength": 121
                      }
                    }
                  }
                },
                "updateLocalizedGenres": {
                  "summary": "Replace locale-scoped genres",
                  "description": "`genres` is an object keyed by locale; each key's value fully replaces that locale's genre list — locales omitted from the object are left untouched. Set a locale's value to `null` to clear it.",
                  "value": {
                    "data": {
                      "id": "5f4dcc3b5aa765d6",
                      "type": "records",
                      "attributes": {
                        "genres": {
                          "en": [
                            "Drama",
                            "Thriller",
                            "Mystery"
                          ],
                          "fr": null
                        }
                      }
                    }
                  }
                },
                "clearOptionalField": {
                  "summary": "Clear an optional field",
                  "description": "Set a nullable attribute to `null` explicitly to clear it — omitting the key instead would leave the existing value untouched.",
                  "value": {
                    "data": {
                      "id": "5f4dcc3b5aa765d6",
                      "type": "records",
                      "attributes": {
                        "workTypeDetail": null
                      }
                    }
                  }
                },
                "updateCustomFields": {
                  "summary": "Update tenant custom field values",
                  "description": "Custom field keys are sent alongside core attributes; a localized custom field is an object keyed by locale, same as `genres`.",
                  "value": {
                    "data": {
                      "id": "5f4dcc3b5aa765d6",
                      "type": "records",
                      "attributes": {
                        "internalPriority": 1,
                        "isAwardEligible": true,
                        "synopsis": {
                          "en": "A gripping tale of survival at sea, now with a director's commentary."
                        }
                      }
                    }
                  }
                },
                "replaceSecurityTags": {
                  "summary": "Replace security tag relationships",
                  "description": "`relationships.securityTags` fully replaces the record's current set of security tags (unlike POST .../relationships/securityTags, which only appends). At least one tag must remain.",
                  "value": {
                    "data": {
                      "id": "5f4dcc3b5aa765d6",
                      "type": "records",
                      "relationships": {
                        "securityTags": {
                          "data": [
                            {
                              "id": "0d61f8370cad1d40",
                              "type": "securityTags"
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "withAuditMeta": {
                  "summary": "Update with audit metadata",
                  "description": "Optional `meta.audit` records why/from-where the write was made. Both `source` and `reason` are optional and free text.",
                  "value": {
                    "meta": {
                      "audit": {
                        "source": "studio-web",
                        "reason": "Correcting release year after distributor confirmation"
                      }
                    },
                    "data": {
                      "id": "5f4dcc3b5aa765d6",
                      "type": "records",
                      "attributes": {
                        "releaseYear": 2025
                      }
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NewRecordFindOneResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/records/search": {
      "post": {
        "summary": "Search for records in tenant library",
        "operationId": "searchTenantLibraryRecords",
        "description": "Search and filter for records in your tenant library.",
        "tags": [
          "Records"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${recordVpcHttpApi}"
        },
        "parameters": [
          {
            "name": "page.size",
            "description": "The number of results to return per page, default is 25, maximum is 25",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 25,
              "maximum": 25
            }
          },
          {
            "name": "page.number",
            "description": "The page number to return, default is 0",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "includeChildrenCount",
            "description": "Include the total number of results in the response",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "filter.locale",
            "description": "BCP 47 language tag, e.g. 'en', 'fr', 'pt-br'. Defaults to 'en' when omitted. Selects the locale for anything that varies by locale: any `where` condition on a localized field is matched against that locale's value, and localized fields in the response reflect that locale. Non-localized fields are unaffected and are always returned as-is.",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "description": "Comma-separated list of fields to sort by. Use '-' prefix for descending order",
            "in": "query",
            "required": false,
            "example": "-updated,-created",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Search criteria, filters, and query groups used to retrieve tenant library records.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantLibrarySearchRequest"
              },
              "examples": {
                "exactMatch": {
                  "summary": "Exact match on a system field",
                  "description": "Single condition, single field. `operator` values are case-sensitive against the stored data — e.g. `workType` is PascalCase (`Movie`, `Series`).",
                  "value": {
                    "data": {
                      "type": "searchQueries",
                      "attributes": {
                        "group": {
                          "operator": "AND",
                          "conditions": [
                            {
                              "field": "workType",
                              "operator": "eq",
                              "value": "Movie"
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "numericRange": {
                  "summary": "Numeric range",
                  "description": "Two conditions on the same field, ANDed together, to express a range (`gte`/`lte` also work for dates).",
                  "value": {
                    "data": {
                      "type": "searchQueries",
                      "attributes": {
                        "group": {
                          "operator": "AND",
                          "conditions": [
                            {
                              "field": "releaseYear",
                              "operator": "gte",
                              "value": 2020
                            },
                            {
                              "field": "releaseYear",
                              "operator": "lte",
                              "value": 2024
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "excludeValue": {
                  "summary": "Exclude a value (ne)",
                  "description": "`ne` treats a record with NO value for the field as satisfying the negation too (Salesforce SOQL-style) — this also matches records where `lifecyclePhase` was never set, not just records with a different phase. Use `not_exists` instead when you only want records that are missing the field entirely.",
                  "value": {
                    "data": {
                      "type": "searchQueries",
                      "attributes": {
                        "group": {
                          "operator": "AND",
                          "conditions": [
                            {
                              "field": "lifecyclePhase",
                              "operator": "ne",
                              "value": "drafting"
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "orAcrossSameField": {
                  "summary": "OR across the same field (match any of several values)",
                  "description": "`genres` is automatically scoped to `filter.locale` on this request (defaults to 'en'), the same way a localized tenant custom field is.",
                  "value": {
                    "data": {
                      "type": "searchQueries",
                      "attributes": {
                        "group": {
                          "operator": "OR",
                          "conditions": [
                            {
                              "field": "genres",
                              "operator": "eq",
                              "value": "sci_fi"
                            },
                            {
                              "field": "genres",
                              "operator": "eq",
                              "value": "action"
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "excludeSubGroup": {
                  "summary": "Exclude records matching a sub-group (NOT)",
                  "description": "A top-level AND of a leaf condition plus a nested NOT group — Series that are not currently in drafting.",
                  "value": {
                    "data": {
                      "type": "searchQueries",
                      "attributes": {
                        "group": {
                          "operator": "AND",
                          "conditions": [
                            {
                              "field": "workType",
                              "operator": "eq",
                              "value": "Series"
                            }
                          ],
                          "groups": [
                            {
                              "operator": "NOT",
                              "conditions": [
                                {
                                  "field": "lifecyclePhase",
                                  "operator": "eq",
                                  "value": "drafting"
                                }
                              ]
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "tenantCustomField": {
                  "summary": "Tenant custom field filter",
                  "description": "Any field name not in the system-field enum is treated as a tenant custom field key — fetch valid keys via GET /fields. Use `contains` for list/array custom fields (see `listCustomFieldMembership`).",
                  "value": {
                    "data": {
                      "type": "searchQueries",
                      "attributes": {
                        "group": {
                          "operator": "AND",
                          "conditions": [
                            {
                              "field": "myRating",
                              "operator": "gte",
                              "value": 8
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "listCustomFieldMembership": {
                  "summary": "List/array custom field membership",
                  "description": "`contains` on a list-type tenant custom field checks whether the list includes the given value.",
                  "value": {
                    "data": {
                      "type": "searchQueries",
                      "attributes": {
                        "group": {
                          "operator": "AND",
                          "conditions": [
                            {
                              "field": "tags",
                              "operator": "contains",
                              "value": "featured"
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "prefixMatch": {
                  "summary": "Prefix match (starts_with)",
                  "value": {
                    "data": {
                      "type": "searchQueries",
                      "attributes": {
                        "group": {
                          "operator": "AND",
                          "conditions": [
                            {
                              "field": "primaryTitle",
                              "operator": "starts_with",
                              "value": "The"
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "securityTagFilter": {
                  "summary": "Security tag filter with resolved IDs",
                  "description": "An array `value` with operator `eq` means 'matches any of these' (OR/IN semantics on a single field), not 'equals this exact array'. Resolve permission group names to IDs first.",
                  "value": {
                    "data": {
                      "type": "searchQueries",
                      "attributes": {
                        "group": {
                          "operator": "AND",
                          "conditions": [
                            {
                              "field": "securityTagIds",
                              "operator": "eq",
                              "value": [
                                "0d61f8370cad1d40",
                                "1f3870be274f6c49"
                              ]
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "fullNestedCompound": {
                  "summary": "Full nested compound query",
                  "description": "(workType AND releaseYear>=1999) AND (genre sci_fi OR action) AND NOT lifecyclePhase drafting — demonstrates arbitrary AND/OR/NOT nesting via `groups`.",
                  "value": {
                    "data": {
                      "type": "searchQueries",
                      "attributes": {
                        "group": {
                          "operator": "AND",
                          "conditions": [
                            {
                              "field": "workType",
                              "operator": "eq",
                              "value": "Movie"
                            },
                            {
                              "field": "releaseYear",
                              "operator": "gte",
                              "value": 1999
                            }
                          ],
                          "groups": [
                            {
                              "operator": "OR",
                              "conditions": [
                                {
                                  "field": "genres",
                                  "operator": "eq",
                                  "value": "sci_fi"
                                },
                                {
                                  "field": "genres",
                                  "operator": "eq",
                                  "value": "action"
                                }
                              ]
                            },
                            {
                              "operator": "NOT",
                              "conditions": [
                                {
                                  "field": "lifecyclePhase",
                                  "operator": "eq",
                                  "value": "drafting"
                                }
                              ]
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "directChildren": {
                  "summary": "One level under a known parent",
                  "description": "`parentId` matches only the immediate parent (e.g. a Season's parentId is its Series) — returns only the direct Seasons of the given Series, not any Episodes beneath them.",
                  "value": {
                    "data": {
                      "type": "searchQueries",
                      "attributes": {
                        "group": {
                          "operator": "AND",
                          "conditions": [
                            {
                              "field": "parentId",
                              "operator": "eq",
                              "value": "8f14e45fceea167a"
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "entireSubtreeFromRoot": {
                  "summary": "Entire subtree under a root-level ancestor, any depth",
                  "description": "`path` is the full ancestor chain including the record's own ID, joined with '|'. For a root-level ancestor (a Series with no parent) its own path IS just its recordId, so a bare recordId works directly here to match every Season AND every Episode under it in one call.",
                  "value": {
                    "data": {
                      "type": "searchQueries",
                      "attributes": {
                        "group": {
                          "operator": "AND",
                          "conditions": [
                            {
                              "field": "path",
                              "operator": "starts_with",
                              "value": "8f14e45fceea167a"
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "entireSubtreeFromNonRoot": {
                  "summary": "Entire subtree under a non-root ancestor",
                  "description": "To scope to only one Season's Episodes, use that Season's FULL joined path ('<seriesId>|<seasonId>'), not its bare recordId — path always starts with the Series ID first, so the bare Season ID alone matches nothing.",
                  "value": {
                    "data": {
                      "type": "searchQueries",
                      "attributes": {
                        "group": {
                          "operator": "AND",
                          "conditions": [
                            {
                              "field": "path",
                              "operator": "starts_with",
                              "value": "8f14e45fceea167a|5f4dcc3b5aa765d6"
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantLibrarySearchResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/record-jobs": {
      "post": {
        "summary": "Create a new record job",
        "operationId": "createRecordJob",
        "description": "Create a new record job.",
        "tags": [
          "Records"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${recordVpcHttpApi}"
        },
        "requestBody": {
          "description": "Definition of the record background job to enqueue, including job type, tenant context, and job-specific parameters.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRecordJobRequest"
              },
              "examples": {
                "deleteRecord": {
                  "summary": "Delete a record",
                  "description": "WARNING: deletes the target record's entire hierarchy recursively — e.g. deleting a Series also deletes all of its Seasons and Episodes, not just the Series itself. Also used for `restoreRecord` (restores the same hierarchy) and `permanentlyDeleteRecord` (irreversible) — same `recordId`-only shape, different `type`.",
                  "value": {
                    "data": {
                      "type": "recordJobs",
                      "attributes": {
                        "type": "deleteRecord",
                        "parameters": {
                          "recordId": "5f4dcc3b5aa765d6"
                        }
                      }
                    }
                  }
                },
                "createRecordFromScratch": {
                  "summary": "Create a Series with seasons and episodes in one job",
                  "description": "Creates a full hierarchy in one background job instead of separate POST /records calls per Season/Episode.",
                  "value": {
                    "data": {
                      "type": "recordJobs",
                      "attributes": {
                        "type": "createRecordFromScratch",
                        "parameters": {
                          "workType": "Series",
                          "primaryTitle": "Northern Skies",
                          "releaseYear": 2025,
                          "seasons": [
                            {
                              "primaryTitle": "Northern Skies — Season 1",
                              "workType": "Season"
                            }
                          ],
                          "episodes": [
                            {
                              "primaryTitle": "Northern Skies — S1E1 — Arrival",
                              "workType": "Episode"
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "createMediaFromUrl": {
                  "summary": "Attach media to a record from external URLs",
                  "value": {
                    "data": {
                      "type": "recordJobs",
                      "attributes": {
                        "type": "createMediaFromUrl",
                        "parameters": {
                          "recordId": "5f4dcc3b5aa765d6",
                          "urls": [
                            "https://example.com/poster.jpg"
                          ],
                          "imageType": "Poster"
                        }
                      }
                    }
                  }
                },
                "migrateRecordLifecycleStatus": {
                  "summary": "Bulk-migrate all records of a workType to a new lifecycle status",
                  "description": "Moves every record of the given `workType` currently at `oldLifecycleStatus` to `newLifecycleStatus`. Use when a tenant renames or restructures a lifecycle status and existing records need to move to the replacement status.",
                  "value": {
                    "data": {
                      "type": "recordJobs",
                      "attributes": {
                        "type": "migrateRecordLifecycleStatus",
                        "parameters": {
                          "workType": "Movie",
                          "oldLifecycleStatus": "in-review",
                          "newLifecycleStatus": "pending-approval"
                        }
                      }
                    }
                  }
                },
                "importSeriesOriginNexus": {
                  "summary": "Import a Series (with seasons/episodes) from Origin",
                  "description": "Imports a Series and its hierarchy by its Origin ID. `importOptions` is optional — omit it to import the full hierarchy with credits and images.",
                  "value": {
                    "data": {
                      "type": "recordJobs",
                      "attributes": {
                        "type": "importSeriesOriginNexus",
                        "parameters": {
                          "seriesId": "origin-series-123",
                          "importOptions": {
                            "seriesOnly": false,
                            "importCredits": true,
                            "importImages": true
                          }
                        }
                      }
                    }
                  }
                },
                "importMoviesOriginNexus": {
                  "summary": "Import a Movie from Origin",
                  "description": "Imports a Movie by its Origin ID. `importOptions` is optional — omit it to import with credits and images.",
                  "value": {
                    "data": {
                      "type": "recordJobs",
                      "attributes": {
                        "type": "importMoviesOriginNexus",
                        "parameters": {
                          "movieId": "origin-movie-456",
                          "importOptions": {
                            "importCredits": true,
                            "importImages": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created record job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateRecordJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/records/{recordId}/ancestors": {
      "get": {
        "summary": "List ancestors of a record",
        "operationId": "recordGetDeletedAncestors",
        "description": "Walks the parentId chain of the target record and returns its ancestors, ordered top-down (root first). By default all ancestors are returned; pass filter.status to narrow by record status (e.g. filter.status=DELETED, used by the restore confirmation dialog to preview which parent records will be restored alongside the target). The target record itself is not included.",
        "tags": [
          "Records"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${recordHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The ID of the record whose ancestors should be listed",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter.status",
            "description": "Narrow the returned ancestors by record status. Omit to return all ancestors. The restore confirmation dialog uses filter.status=DELETED.",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "string",
              "enum": [
                "ACTIVE",
                "DELETED"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved ancestors (may be empty)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordGetDeletedAncestorsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Target record not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/records/{recordId}/children": {
      "get": {
        "summary": "List direct child record identifiers",
        "operationId": "recordChildrenFindMany",
        "description": "Returns the identifiers of direct child records for the parent record. Only active children in the record hierarchy are included (for example, Seasons under a Series, or Episodes under a Season or Series). Does not include compilation members; use GET /records/{recordId}/compilationMembers for those. Returns an empty list when the parent has no children (for example, a Movie).",
        "tags": [
          "Records"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${recordHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The ID of the parent record whose direct children should be listed",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved child record identifiers (may be empty)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordChildrenFindManyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Parent record not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/records/{recordId}/compilationMembers": {
      "get": {
        "summary": "Get many compilation members for a given record",
        "operationId": "recordCompilationMemberFindMany",
        "description": "Get many compilation members for a given record.",
        "tags": [
          "Records"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${recordHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The ID of the record to get the compilation members for",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved compilation members",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordCompilationMemberFindManyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/records/{recordId}/compilations": {
      "get": {
        "summary": "Get many compilations for a given record",
        "operationId": "recordCompilationFindMany",
        "description": "Get many compilations for a given record.",
        "tags": [
          "Records"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${recordHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The ID of the record to get the compilations for",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved compilations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordCompilationFindManyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/records/{recordId}/compilationMembers/operations": {
      "post": {
        "summary": "Execute an atomic operation on compilation members",
        "operationId": "compilationMembersAtomicOperations",
        "description": "Execute an atomic operation on compilation members.",
        "tags": [
          "Records"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${recordHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The ID of the record of type Compilation to execute the operation on",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "List of atomic operations (add, update, remove) to apply to the compilation members of the specified record. Use update, not remove+add, to reorder existing members — see ICompilationMembersAtomicOperationsRequest for the full semantics.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompilationMembersAtomicOperationsRequest"
              },
              "examples": {
                "addMembers": {
                  "summary": "Add new members",
                  "description": "Each `add` op links one record as a new compilation member with an explicit ranking. Fails if a `recordId` is already a member — use `update` instead of remove+add to change an existing member's ranking.",
                  "value": {
                    "atomic:operations": [
                      {
                        "op": "add",
                        "data": {
                          "type": "compilationLinkageItems",
                          "attributes": {
                            "ranking": 1
                          },
                          "relationships": {
                            "record": {
                              "data": {
                                "type": "records",
                                "id": "5f4dcc3b5aa765d6"
                              }
                            }
                          }
                        }
                      },
                      {
                        "op": "add",
                        "data": {
                          "type": "compilationLinkageItems",
                          "attributes": {
                            "ranking": 2
                          },
                          "relationships": {
                            "record": {
                              "data": {
                                "type": "records",
                                "id": "9c3c1c6f2a4b4e2f"
                              }
                            }
                          }
                        }
                      }
                    ]
                  }
                },
                "reorderMembers": {
                  "summary": "Reorder existing members",
                  "description": "`update` changes an existing member's `ranking` by its own linkage-item id (`ref.id`, not the record's own id) — the correct, atomic-safe way to reorder, instead of removing and re-adding.",
                  "value": {
                    "atomic:operations": [
                      {
                        "op": "update",
                        "ref": {
                          "type": "compilationLinkageItems",
                          "id": "cli_01hxyz"
                        },
                        "data": {
                          "attributes": {
                            "ranking": 2
                          }
                        }
                      },
                      {
                        "op": "update",
                        "ref": {
                          "type": "compilationLinkageItems",
                          "id": "cli_02hxyz"
                        },
                        "data": {
                          "attributes": {
                            "ranking": 1
                          }
                        }
                      }
                    ]
                  }
                },
                "removeMember": {
                  "summary": "Remove a member",
                  "description": "`remove` takes the member's own linkage-item id (`ref.id`), not the underlying record's id.",
                  "value": {
                    "atomic:operations": [
                      {
                        "op": "remove",
                        "ref": {
                          "type": "compilationLinkageItems",
                          "id": "cli_01hxyz"
                        }
                      }
                    ]
                  }
                },
                "mixedBatch": {
                  "summary": "Add, reorder, and remove in one atomic batch",
                  "description": "All operations in the array are applied atomically — either all succeed or none are applied.",
                  "value": {
                    "atomic:operations": [
                      {
                        "op": "add",
                        "data": {
                          "type": "compilationLinkageItems",
                          "attributes": {
                            "ranking": 3
                          },
                          "relationships": {
                            "record": {
                              "data": {
                                "type": "records",
                                "id": "1f3870be274f6c49"
                              }
                            }
                          }
                        }
                      },
                      {
                        "op": "update",
                        "ref": {
                          "type": "compilationLinkageItems",
                          "id": "cli_01hxyz"
                        },
                        "data": {
                          "attributes": {
                            "ranking": 1
                          }
                        }
                      },
                      {
                        "op": "remove",
                        "ref": {
                          "type": "compilationLinkageItems",
                          "id": "cli_02hxyz"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Accepted"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/recordLifecycles": {
      "get": {
        "summary": "Get all record lifecycles for a tenant",
        "operationId": "recordLifecycleFindMany",
        "description": "Get all record lifecycles for a tenant, optionally filtered by workType.",
        "tags": [
          "Record Lifecycles"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${recordHttpApi}"
        },
        "parameters": [
          {
            "name": "filter.workType",
            "description": "Filter lifecycles by workType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "Movie",
                "MovieEdit",
                "Series",
                "Season",
                "Episode",
                "EpisodeEdit",
                "Compilation"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved lifecycles",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordLifecycleFindManyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "post": {
        "summary": "Create a new record lifecycle",
        "operationId": "recordLifecycleCreateOne",
        "description": "Create a new record lifecycle for a specific workType. The tenant ID can optionally be provided as a query parameter.",
        "tags": [
          "Record Lifecycles"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${recordHttpApi}"
        },
        "parameters": [
          {
            "name": "tenantId",
            "description": "Optional tenant ID. If not provided, the tenant is inferred from the caller's authentication.",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Complete lifecycle definition including nodes, transitions, and metadata.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordLifecycleCreateRequest"
              },
              "examples": {
                "simpleMovieLifecycle": {
                  "summary": "Movie — minimal 3-status lifecycle",
                  "description": "Drafting statuses come before a single published status, with a straight-line forward path and one backward transition to send a published Movie back to review.",
                  "value": {
                    "data": {
                      "type": "recordLifecycles",
                      "attributes": {
                        "workType": "Movie",
                        "statuses": [
                          {
                            "id": "draft",
                            "label": "Draft",
                            "phase": "drafting",
                            "positionX": 0,
                            "positionY": 0
                          },
                          {
                            "id": "in_review",
                            "label": "In Review",
                            "phase": "drafting",
                            "positionX": 200,
                            "positionY": 0
                          },
                          {
                            "id": "published",
                            "label": "Published",
                            "phase": "published",
                            "positionX": 400,
                            "positionY": 0
                          }
                        ],
                        "transitions": [
                          {
                            "id": "submit_for_review",
                            "label": "Submit for Review",
                            "fromStatusId": "draft",
                            "toStatusId": "in_review",
                            "direction": "forward"
                          },
                          {
                            "id": "publish",
                            "label": "Publish",
                            "fromStatusId": "in_review",
                            "toStatusId": "published",
                            "direction": "forward"
                          },
                          {
                            "id": "unpublish",
                            "label": "Send Back to Review",
                            "fromStatusId": "published",
                            "toStatusId": "in_review",
                            "direction": "backward"
                          }
                        ]
                      }
                    }
                  }
                },
                "seriesLifecycleWithRejection": {
                  "summary": "Series — with a rejection branch back to Draft",
                  "description": "Demonstrates a non-linear graph: In Review can go forward to Published, or backward to Draft if rejected.",
                  "value": {
                    "data": {
                      "type": "recordLifecycles",
                      "attributes": {
                        "workType": "Series",
                        "statuses": [
                          {
                            "id": "draft",
                            "label": "Draft",
                            "phase": "drafting"
                          },
                          {
                            "id": "in_review",
                            "label": "In Review",
                            "phase": "drafting"
                          },
                          {
                            "id": "published",
                            "label": "Published",
                            "phase": "published"
                          }
                        ],
                        "transitions": [
                          {
                            "id": "submit_for_review",
                            "label": "Submit for Review",
                            "fromStatusId": "draft",
                            "toStatusId": "in_review",
                            "direction": "forward"
                          },
                          {
                            "id": "reject",
                            "label": "Reject",
                            "fromStatusId": "in_review",
                            "toStatusId": "draft",
                            "direction": "backward"
                          },
                          {
                            "id": "publish",
                            "label": "Publish",
                            "fromStatusId": "in_review",
                            "toStatusId": "published",
                            "direction": "forward"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordLifecycleFindOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/recordLifecycles/{recordLifecycleId}": {
      "get": {
        "summary": "Get a record lifecycle by ID",
        "operationId": "recordLifecycleFindOne",
        "description": "Get a specific record lifecycle by its unique ID.",
        "tags": [
          "Record Lifecycles"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${recordHttpApi}"
        },
        "parameters": [
          {
            "name": "recordLifecycleId",
            "description": "The unique ID of the lifecycle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordLifecycleFindOneResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "patch": {
        "summary": "Update a record lifecycle",
        "operationId": "recordLifecycleUpdateOne",
        "description": "Update an existing record lifecycle by its unique ID.",
        "tags": [
          "Record Lifecycles"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${recordHttpApi}"
        },
        "parameters": [
          {
            "name": "recordLifecycleId",
            "description": "The unique ID of the lifecycle to update",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Fields to update on the existing lifecycle, such as node attributes, transitions, or status metadata.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordLifecycleUpdateRequest"
              },
              "examples": {
                "renameStatusLabel": {
                  "summary": "Rename a status label",
                  "description": "`statuses` fully replaces the lifecycle's status list, so every existing status must be included, not just the one being changed — omitting a status here would remove it.",
                  "value": {
                    "data": {
                      "id": "8f14e45fceea167a",
                      "type": "recordLifecycles",
                      "attributes": {
                        "statuses": [
                          {
                            "id": "draft",
                            "label": "Draft",
                            "phase": "drafting"
                          },
                          {
                            "id": "in_review",
                            "label": "Pending Approval",
                            "phase": "drafting"
                          },
                          {
                            "id": "published",
                            "label": "Published",
                            "phase": "published"
                          }
                        ]
                      }
                    }
                  }
                },
                "addTransition": {
                  "summary": "Add a new transition",
                  "description": "`transitions` fully replaces the lifecycle's transition list, same as `statuses` — include every existing transition alongside the new one.",
                  "value": {
                    "data": {
                      "id": "8f14e45fceea167a",
                      "type": "recordLifecycles",
                      "attributes": {
                        "transitions": [
                          {
                            "id": "submit_for_review",
                            "label": "Submit for Review",
                            "fromStatusId": "draft",
                            "toStatusId": "in_review",
                            "direction": "forward"
                          },
                          {
                            "id": "publish",
                            "label": "Publish",
                            "fromStatusId": "in_review",
                            "toStatusId": "published",
                            "direction": "forward"
                          },
                          {
                            "id": "archive",
                            "label": "Archive",
                            "fromStatusId": "published",
                            "toStatusId": "draft",
                            "direction": "backward"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordLifecycleFindOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "delete": {
        "summary": "Delete a record lifecycle",
        "operationId": "recordLifecycleDeleteOne",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WriteMetaOnlyRequest"
              }
            }
          }
        },
        "description": "Delete an existing record lifecycle by its unique ID.",
        "tags": [
          "Record Lifecycles"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${recordHttpApi}"
        },
        "parameters": [
          {
            "name": "recordLifecycleId",
            "description": "The unique ID of the lifecycle to delete",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content - Lifecycle deleted successfully"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/records/{recordId}/externalData": {
      "get": {
        "summary": "Get external field data for a record",
        "operationId": "externalDataFieldsFindMany",
        "description": "Retrieve field data (synopses, alternate titles, primary title, release metadata, runtime, countries of origin, languages, genres, keywords/tag fields, etc.) for a record from an external data provider — Origin, IMDB, or EIDR — matched using the record's corresponding system identifier (origin ID, IMDB ID, or EIDR ID). Read-only; requires Studio authentication. Returns all field groups by default; narrow the response to one group with `fields.externalData`.",
        "tags": [
          "Records"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${recordHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The unique Studio ID of the record",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter.provider",
            "description": "The external data provider to query for this record.",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "OriginNexus",
                "IMDB",
                "EIDR",
                "Gracenote"
              ]
            }
          },
          {
            "name": "fields.externalData",
            "description": "Optional sparse fieldset to retrieve only a specific field group. If not provided, returns all field groups.",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "synopses",
                "titles",
                "primaryTitle",
                "releaseYear",
                "releaseDate",
                "runLength",
                "countriesOfOrigin",
                "primarySpokenLanguage",
                "originalLanguage",
                "genres",
                "keywords"
              ]
            }
          },
          {
            "name": "filter.locale",
            "description": "Optional locale filter to return data for a specific language (e.g., 'en-US')",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK - External field data retrieved successfully (JSON:API 1.1 document)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalDataFieldsFindManyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid provider ID or field group",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - User does not have access to External Data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found - Record not found or record has no origin ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/records/{recordId}/relationships/securityTags": {
      "post": {
        "summary": "Add security tags to a record",
        "operationId": "recordAddSecurityTagsRelationship",
        "description": "Appends security tags to the record's securityTags relationship without removing existing ones. Maximum 100 security tags per record. Server will not add duplicates if a tag is already present.",
        "tags": [
          "Records"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${recordHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The ID of the record",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordAddSecurityTagsRelationshipRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "delete": {
        "summary": "Remove security tags from a record",
        "operationId": "recordDeleteSecurityTagsRelationship",
        "description": "Removes the specified security tags from the record's securityTags relationship. Tags not present on the record are silently ignored. At least one security tag must remain; the request will be rejected if it would leave the record with no tags.",
        "tags": [
          "Records"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${recordHttpApi}"
        },
        "parameters": [
          {
            "name": "recordId",
            "description": "The ID of the record",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordDeleteSecurityTagsRelationshipRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/tenants": {
      "get": {
        "summary": "Get all tenants",
        "description": "Returns a paginated list of all tenants in the system. Results are ordered by creation date. Use the `page.cursor` query parameter to paginate through results.",
        "operationId": "tenantFindMany",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "page.cursor",
            "in": "query",
            "description": "The cursor to use for pagination",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/GetTenantResponse"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "cursor": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "post": {
        "summary": "Create a new tenant",
        "operationId": "tenantCreateOne",
        "description": "Create a new tenant in the system. When `organizationId` is omitted, an Auth0 organization is created using the tenant `key` as the organization name and `fullName` as the display name, unless that name is already taken.",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantCreateOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/tenants/{tenantId}": {
      "get": {
        "summary": "Get a tenant by ID",
        "description": "Returns a single tenant by its unique ID. The special value `me` can be used as the `tenantId` to retrieve the tenant associated with the caller's JWT token.",
        "operationId": "tenantFindOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "description": "The tenant ID",
            "required": true,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "string",
                  "enum": [
                    "me"
                  ]
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetTenantResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "patch": {
        "summary": "Update a tenant by ID",
        "description": "Updates an existing tenant by its unique ID. Only the fields provided in the request body are modified. The updated tenant is returned in the response.",
        "operationId": "tenantUpdateOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "tenantId",
            "description": "The ID of the tenant to update",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTenantRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetTenantResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/features": {
      "get": {
        "summary": "Get the feature entitlements for a tenant",
        "description": "Returns every entitlement-governed feature for the tenant: whether the tenant's plan grants it, whether the tenant has activated it, and the effective result. Features the plan does not grant are returned flagged rather than omitted, so they can be surfaced as an upsell. Features absent from the registry are not governed by entitlements, never appear here, and are simply available.",
        "operationId": "tenantFeatureFindMany",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantFeatureFindManyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/features/{featureKey}": {
      "patch": {
        "summary": "Activate a feature for a tenant",
        "description": "Activates a released feature for the tenant. Activation is forward-only in v1: `enabled` may only be `true` and there is no deactivation path. Re-activating an already active feature succeeds without a second write. Rejected when the tenant's plan does not grant the feature.",
        "operationId": "tenantFeatureUpdateOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "featureKey",
            "description": "The registry key of the feature to activate",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTenantFeatureRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantFeatureFindOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - deactivation is not supported in v1",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - the tenant's plan does not grant this feature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found - unknown feature key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/policyTemplates": {
      "get": {
        "summary": "List policy templates",
        "operationId": "policyTemplateFindMany",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "filter.label",
            "description": "Filter by display label",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter.resourceType",
            "description": "Filter by resource type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "record",
                "contributor",
                "delivery",
                "bulkActions"
              ]
            }
          },
          {
            "name": "filter.lifecycleStatusId",
            "description": "Only templates whose workTypeLifecycleAccess references this lifecycle status id, for any work type. Used to find the policies blocking a status deletion, and to deep-link the Policies screen from that flow.",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyTemplateFindManyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "post": {
        "summary": "Create a policy template",
        "operationId": "policyTemplateCreateOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePolicyTemplateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyTemplateCreateOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/policyTemplates/{templateId}": {
      "get": {
        "summary": "Get a policy template by ID",
        "operationId": "policyTemplateFindOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "templateId",
            "description": "The ID of the policy template",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyTemplateFindOneResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "patch": {
        "summary": "Update a policy template",
        "operationId": "policyTemplateUpdateOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "templateId",
            "description": "The ID of the policy template to update",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicyTemplateUpdateOneRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyTemplateUpdateOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "delete": {
        "summary": "Delete a policy template",
        "operationId": "policyTemplateDeleteOne",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WriteMetaOnlyRequest"
              }
            }
          }
        },
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "templateId",
            "description": "The ID of the policy template to delete",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict — template has active policies",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/policyTemplates/{templateId}/policies": {
      "post": {
        "summary": "Create policies from a template (cartesian product of roles x security tags)",
        "operationId": "policyTemplatePoliciesCreate",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "templateId",
            "description": "The ID of the policy template",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignPolicyTemplateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyFindManyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "get": {
        "summary": "List policies for a policy template",
        "operationId": "policyTemplatePoliciesFindMany",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "templateId",
            "description": "The ID of the policy template",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyFindManyResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/policies": {
      "get": {
        "summary": "Get all policies for a tenant",
        "description": "Returns Security Policies belonging to the caller's tenant. Security Policies define what actions a Role can perform on specific resources (Records, Contributors, etc.) optionally scoped to a Security Tag. Results can be filtered by policy label, role ID, or security tag ID and paginated using `page.cursor`. Result ordering follows the underlying index order for deterministic cursor continuation.",
        "operationId": "policyFindMany",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "page.cursor",
            "description": "The cursor to use for pagination",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page.size",
            "description": "The number of policies to return per page, default is 50, maximum is 200",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "filter.role.id",
            "description": "Filter by role ID",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter.resourceType",
            "description": "Filter by resource type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "record",
                "contributor",
                "delivery",
                "bulkActions"
              ]
            }
          },
          {
            "name": "filter.template.id",
            "description": "Filter by template ID",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter.securityTag.id",
            "description": "Filter by security tag ID",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter.lifecycleStatusId",
            "description": "Only assignments whose policy template grants this lifecycle status, for any work type.",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyFindManyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/policies/{policyId}": {
      "get": {
        "summary": "Get a policy by ID",
        "description": "Returns a single Security Policy by its unique ID, scoped to the caller's tenant.",
        "operationId": "policyFindOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "policyId",
            "description": "The ID of the policy",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyFindOneResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "delete": {
        "summary": "Delete a policy by ID",
        "description": "Permanently deletes a Security Policy by its unique ID. This action is irreversible. Users whose access depended on this policy will immediately lose the associated permissions.",
        "operationId": "policyDeleteOne",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WriteMetaOnlyRequest"
              }
            }
          }
        },
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "policyId",
            "description": "The ID of the policy to delete",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/policies/operations": {
      "post": {
        "summary": "Execute atomic operations on policies",
        "operationId": "policyAtomicOperations",
        "description": "Execute one or more atomic remove operations on policies. All specified policies are deleted in a single call.",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "requestBody": {
          "description": "List of atomic remove operations to apply to the specified policies.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicyAtomicOperationsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/securityTags": {
      "get": {
        "summary": "Get all security tags for a tenant",
        "description": "Returns all Security Tags belonging to the caller's tenant. Security Tags are labels that can be applied to Records to scope access control: a Security Policy can restrict access to only Records that carry a specific Security Tag. Results can be filtered by tag name.",
        "operationId": "securityTagFindMany",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "filter.name",
            "description": "Filter security tags by name",
            "example": "Main Catalog",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityTagFindManyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "post": {
        "summary": "Create a new security tag for a tenant",
        "description": "Creates a new Security Tag for the caller's tenant. Once created, the tag can be assigned to Records and referenced in Security Policies to restrict record-level access.",
        "operationId": "securityTagCreateOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSecurityTagRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityTagCreateOneResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/securityTags/{securityTagId}": {
      "get": {
        "summary": "Get a security tag by ID",
        "description": "Returns a single Security Tag by its unique ID, scoped to the caller's tenant.",
        "operationId": "securityTagFindOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "securityTagId",
            "description": "The ID of the security tag to retrieve",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityTagFindOneResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "patch": {
        "summary": "Update a security tag by ID",
        "description": "Updates an existing Security Tag by its unique ID. Only the fields provided in the request body are modified. The updated tag is returned in the response.",
        "operationId": "securityTagUpdateOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "securityTagId",
            "description": "The ID of the security tag to update",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSecurityTagRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityTagFindOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "delete": {
        "summary": "Delete a security tag by ID",
        "description": "Permanently deletes a Security Tag by its unique ID. This action is irreversible. Any Records that were tagged with this Security Tag and any Policies that referenced it will no longer have the tag association.",
        "operationId": "securityTagDeleteOne",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WriteMetaOnlyRequest"
              }
            }
          }
        },
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApiVpc}"
        },
        "parameters": [
          {
            "name": "securityTagId",
            "description": "The ID of the security tag to delete",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/apiKeys": {
      "get": {
        "summary": "Get all api keys for a tenant",
        "description": "Returns all API Keys belonging to the caller's tenant. API Keys enable machine-to-machine (M2M) authentication against the Origin Studio API and are associated with one or more Roles that determine their permissions. Note: the secret key value is only returned at creation time and cannot be retrieved later.",
        "operationId": "apiKeyFindMany",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyFindManyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "post": {
        "summary": "Create a new api key for a tenant",
        "description": "Creates a new API Key for the caller's tenant. The secret key value is only returned once in this response and cannot be retrieved again — store it securely. The key can be assigned to one or more Roles to define its permissions within the tenant.",
        "operationId": "apiKeyCreateOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyCreateOneResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/apiKeys/{apiKeyId}": {
      "get": {
        "summary": "Get an api key by ID",
        "description": "Returns metadata for a single API Key by its unique ID, scoped to the caller's tenant. The secret key value is not included in the response.",
        "operationId": "apiKeyFindOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "apiKeyId",
            "description": "The ID of the api key to retrieve",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyFindOneResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "delete": {
        "summary": "Delete an api key by ID",
        "description": "Permanently revokes and deletes an API Key by its unique ID. Any clients using this key will immediately lose access to the API. This action is irreversible.",
        "operationId": "apiKeyDeleteOne",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WriteMetaOnlyRequest"
              }
            }
          }
        },
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "apiKeyId",
            "description": "The ID of the api key to delete",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/aiAssistantConfigs": {
      "get": {
        "summary": "Get all AI assistant configs for a tenant",
        "description": "Returns all AI assistant configurations for the caller's tenant. Shows which model provider and model are selected, and whether an API key is configured.",
        "operationId": "aiAssistantConfigFindMany",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAssistantConfigFindManyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "post": {
        "summary": "Create the AI assistant config for a tenant",
        "description": "Create the AI assistant configuration for the caller's tenant. Choose 'bedrock' for a Fabric-provided model or 'custom' to bring your own model and API key. A tenant may only have one configuration.",
        "operationId": "aiAssistantConfigCreateOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAiAssistantConfigRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAssistantConfigCreateOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict — a config already exists for this tenant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/aiAssistantConfigs/{aiAssistantConfigId}": {
      "get": {
        "summary": "Get an AI assistant configuration by ID",
        "description": "Returns a single AI assistant configuration by its unique ID, scoped to the caller's tenant.",
        "operationId": "aiAssistantConfigFindOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "aiAssistantConfigId",
            "description": "The ID of the AI assistant config to retrieve",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAssistantConfigFindOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "patch": {
        "summary": "Update an AI assistant configuration",
        "description": "Update the AI assistant configuration for the caller's tenant. Only the fields provided are modified. You can change the model provider, model, API key, or endpoint URL. Stored API keys are rotated automatically when a new key is provided.",
        "operationId": "aiAssistantConfigUpdateOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "aiAssistantConfigId",
            "description": "The ID of the AI assistant config to update",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAiAssistantConfigRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAssistantConfigFindOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "delete": {
        "summary": "Delete an AI assistant configuration",
        "description": "Permanently delete the AI assistant configuration for the caller's tenant. Any stored API key is also removed.",
        "operationId": "aiAssistantConfigDeleteOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "aiAssistantConfigId",
            "description": "The ID of the AI assistant config to delete",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/eventSubscriptions": {
      "get": {
        "summary": "Get all event subscriptions for a tenant",
        "description": "Returns all Event Subscriptions registered for the caller's tenant. Event Subscriptions configure webhook endpoints to receive real-time notifications when specific platform events occur (e.g., record created, job completed).",
        "operationId": "eventSubscriptionFindMany",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventSubscriptionFindManyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "post": {
        "summary": "Create a new event subscription for a tenant",
        "description": "Creates a new Event Subscription for the caller's tenant. Specify the event types to subscribe to and the URL of the webhook endpoint that should receive the notifications.",
        "operationId": "eventSubscriptionCreateOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEventSubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventSubscriptionCreateOneResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/eventSubscriptions/{eventSubscriptionId}": {
      "get": {
        "summary": "Get an event subscription by ID",
        "description": "Returns a single Event Subscription by its unique ID, scoped to the caller's tenant.",
        "operationId": "eventSubscriptionFindOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "eventSubscriptionId",
            "description": "The ID of the event subscription to retrieve",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventSubscriptionFindOneResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "delete": {
        "summary": "Delete an event subscription by ID",
        "description": "Permanently deletes an Event Subscription by its unique ID. The webhook endpoint will no longer receive notifications for the subscribed event types.",
        "operationId": "eventSubscriptionDeleteOne",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WriteMetaOnlyRequest"
              }
            }
          }
        },
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "eventSubscriptionId",
            "description": "The ID of the event subscription to delete",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/tenantJobs": {
      "post": {
        "summary": "Create a new tenant job",
        "description": "Initiates a new long-running Tenant Job for the caller's tenant. The job type is specified in the request body. Returns a job ID that can be used to poll the job status via `GET /backgroundJobs/{jobId}`.",
        "operationId": "tenantJobCreateOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantJobCreateOneRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantJobCreateOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/usagePlans": {
      "post": {
        "summary": "Create the usage plan for a tenant",
        "description": "Create the usage plan configuration for the provided tenant.",
        "operationId": "usagePlanCreateOne",
        "tags": [
          "Tenants"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "tenantId",
            "description": "The ID of the tenant to create the usage plan for.",
            "in": "query",
            "required": true,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict — a usage plan already exists for this tenant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/users": {
      "get": {
        "summary": "Get multiple users",
        "description": "Returns a paginated list of users for the caller's tenant. Results can be filtered by name, role, or status. The `filter.status` values are: `active` (verified and not blocked), `pending` (not yet verified), or `deactivated` (blocked). System users can additionally filter by a specific `tenantId` to retrieve users across tenants.",
        "operationId": "userFindMany",
        "tags": [
          "Users"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${userHttpApi}"
        },
        "parameters": [
          {
            "name": "page.size",
            "description": "The number of results to return per page, default is 50",
            "in": "query",
            "required": false,
            "example": 50,
            "schema": {
              "type": "integer",
              "default": 50
            }
          },
          {
            "name": "page.number",
            "description": "The page number to return, default is 0",
            "in": "query",
            "required": false,
            "example": 0,
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "filter.name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter users by name. Example: filter.name=John Doe",
            "example": "John Doe"
          },
          {
            "name": "filter.roles",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "example": "Admin,Viewer",
            "schema": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              ]
            },
            "description": "Filter users by roles. Example: filter.roles=Admin,Viewer"
          },
          {
            "name": "filter.status",
            "in": "query",
            "required": false,
            "example": "active",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "pending",
                "deactivated"
              ]
            },
            "description": "Filter users by status. 'active' = verified and not blocked, 'pending' = not verified and not blocked, 'deactivated' = blocked. Example: filter.status=active"
          },
          {
            "name": "filter.tenant.id",
            "in": "query",
            "required": false,
            "example": "abc123def456",
            "schema": {
              "type": "string"
            },
            "description": "Filter by tenant ID. Only available for system users."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetUsersResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "post": {
        "summary": "Create users",
        "description": "Create one or more users",
        "operationId": "userCreateMany",
        "tags": [
          "Users"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${userHttpApi}"
        },
        "parameters": [
          {
            "name": "tenantId",
            "description": "The ID of the tenant to create users for",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUsersRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateUsersResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/users/{userId}": {
      "get": {
        "summary": "Get a user by ID",
        "description": "Returns a single user's profile and role assignments by their unique ID, scoped to the caller's tenant.",
        "operationId": "userFindOne",
        "tags": [
          "Users"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${userHttpApi}"
        },
        "parameters": [
          {
            "name": "userId",
            "description": "The ID of the user to retrieve",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetUserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "patch": {
        "summary": "Update a user",
        "description": "Updates an existing user's profile or role assignments. Supports partial updates via JSON:API patch semantics — only the fields included in the request are changed. Returns the updated user in the response.",
        "operationId": "userUpdateOne",
        "tags": [
          "Users"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${userHttpApi}"
        },
        "parameters": [
          {
            "name": "userId",
            "description": "The ID of the user to update",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetUserResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "delete": {
        "summary": "Delete a user",
        "description": "Delete a user by ID",
        "operationId": "userDeleteOne",
        "tags": [
          "Users"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${userHttpApi}"
        },
        "parameters": [
          {
            "name": "userId",
            "description": "The ID of the user to delete",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/users/{userId}/roles": {
      "get": {
        "summary": "Get a user's roles",
        "description": "Returns the roles assigned to the specified user as a related-resource collection. Supports the `me` alias for the current caller. You can always read your own roles; reading another user requires permission to read that user, and that user must belong to your tenant.",
        "operationId": "userRolesFindMany",
        "tags": [
          "Users"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${userHttpApi}"
        },
        "parameters": [
          {
            "name": "userId",
            "description": "The ID of the user whose roles to retrieve, or `me` for the current caller",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleFindManyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/users/{userId}/permissions": {
      "get": {
        "summary": "Get a user's effective permissions",
        "description": "Returns a descriptive, human-readable summary of what the specified user is allowed to do, aggregated across all of their roles. Synthesised from the static system-role baseline plus the custom policies assigned to those roles (no live authorization evaluation). Supports the `me` alias for the current caller. You can always read your own permissions; reading another user requires permission to read that user, and that user must belong to your tenant.",
        "operationId": "userPermissionsFindOne",
        "tags": [
          "Users"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "userId",
            "description": "The ID of the user whose permissions to retrieve, or `me` for the current caller",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EffectivePermissionsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/roles": {
      "get": {
        "summary": "Get the roles for a tenant",
        "description": "Returns all Roles defined for the caller's tenant, including system-provisioned roles (Admin, Editor, Viewer) and any user-created custom roles. Results can be filtered by role name.",
        "operationId": "roleFindMany",
        "tags": [
          "Users"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${userHttpApi}"
        },
        "parameters": [
          {
            "name": "filter.name",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "example": "filter.name=Viewer",
            "schema": {
              "type": "string"
            },
            "description": "Filter roles by name. Example: filter.name=MyRole"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleFindManyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "post": {
        "summary": "Create a role",
        "description": "Creates a new custom Role for the caller's tenant. Custom roles can be assigned Security Policies to define granular access control. System roles (Admin, Editor, Viewer) are pre-provisioned and cannot be created via this endpoint.",
        "operationId": "roleCreateOne",
        "tags": [
          "Users"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${userHttpApi}"
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRoleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleFindOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/roles/{roleId}/permissions": {
      "get": {
        "summary": "Get a role's effective permissions",
        "description": "Returns a descriptive, human-readable summary of what a role is allowed to do, synthesised from the static system-role baseline plus the custom policies assigned to the role. Intended for admins previewing a role's access. Requires permission to read policies.",
        "operationId": "rolePermissionsFindOne",
        "tags": [
          "Users"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${tenantHttpApi}"
        },
        "parameters": [
          {
            "name": "roleId",
            "description": "The ID of the role",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EffectivePermissionsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/roles/{roleId}": {
      "get": {
        "summary": "Get a role",
        "description": "Returns a single Role by its unique ID, scoped to the caller's tenant. Includes the role's name, description, and associated security policies.",
        "operationId": "roleFindOne",
        "tags": [
          "Users"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${userHttpApi}"
        },
        "parameters": [
          {
            "name": "roleId",
            "description": "The ID of the role to get",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleFindOneResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "patch": {
        "summary": "Update a role",
        "description": "Updates an existing Role by its unique ID. Supports partial updates — only the fields included in the request body are modified. System roles cannot be renamed. The updated role is returned in the response.",
        "operationId": "roleUpdateOne",
        "tags": [
          "Users"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${userHttpApi}"
        },
        "parameters": [
          {
            "name": "roleId",
            "description": "The ID of the role to update",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoleUpdateOneRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleUpdateOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      },
      "delete": {
        "summary": "Delete a role",
        "description": "Permanently deletes a custom Role by its unique ID. Users who had this role assigned will lose the associated permissions. System roles (Admin, Editor, Viewer) cannot be deleted.",
        "operationId": "roleDeleteOne",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WriteMetaOnlyRequest"
              }
            }
          }
        },
        "tags": [
          "Users"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${userHttpApi}"
        },
        "parameters": [
          {
            "name": "roleId",
            "description": "The ID of the role to delete",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/utilization": {
      "get": {
        "summary": "Get current utilization for a tenant",
        "description": "Returns the current utilization data for a tenant including current counts, peak values for the current month, and plan information if set. The tenant ID is extracted from the authorization token.",
        "operationId": "utilizationFindOne",
        "tags": [
          "Utilization"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${utilizationHttpApi}"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UtilizationFindOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/utilization/snapshots": {
      "get": {
        "summary": "List utilization snapshots for a tenant",
        "description": "Returns a list of monthly utilization snapshots for a tenant, sorted by month in descending order (most recent first). The tenant ID is extracted from the authorization token.",
        "operationId": "utilizationSnapshotFindMany",
        "tags": [
          "Utilization"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${utilizationHttpApi}"
        },
        "parameters": [
          {
            "name": "page.limit",
            "in": "query",
            "description": "Maximum number of snapshots to return (default: 12)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 12
            }
          },
          {
            "name": "page.cursor",
            "in": "query",
            "description": "Cursor for pagination",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UtilizationSnapshotFindManyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    },
    "/utilization/snapshots/{snapshotId}": {
      "get": {
        "summary": "Get a specific utilization snapshot",
        "description": "Returns a single utilization snapshot by its ID. The tenant ID is extracted from the authorization token.",
        "operationId": "utilizationSnapshotFindOne",
        "tags": [
          "Utilization"
        ],
        "x-amazon-apigateway-integration": {
          "credentials": "${apiGatewayRoleArn}",
          "payloadFormatVersion": "2.0",
          "type": "aws_proxy",
          "httpMethod": "POST",
          "uri": "${utilizationHttpApi}"
        },
        "parameters": [
          {
            "name": "snapshotId",
            "in": "path",
            "required": true,
            "description": "The snapshot ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UtilizationSnapshotFindOneResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "jwt-apikey-authorizer": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "WriteRequestMeta": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IWriteRequestMeta",
        "description": "Optional audit metadata for a write request. `audit.source` is the issuing surface/channel (e.g. studio-web, mcp, api, system); `audit.reason` is a free-text justification. Both are optional and length-capped.",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "audit": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "source": {
                "type": "string",
                "maxLength": 64
              },
              "reason": {
                "type": "string",
                "maxLength": 256
              }
            }
          }
        }
      },
      "AuditQueryCreateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IAuditQueryCreateOneRequest",
        "description": "JSON:API request body to start a new audit query.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "attributes"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "auditQueries"
                ]
              },
              "attributes": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "dateFrom",
                  "dateTo"
                ],
                "properties": {
                  "dateFrom": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Start of the date range (inclusive), YYYY-MM-DD"
                  },
                  "dateTo": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "End of the date range (inclusive), YYYY-MM-DD"
                  },
                  "resourceTypes": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^KS::[A-Za-z]+$"
                    },
                    "description": "Optional list of KS:: resource type keys to filter by (OR semantics)"
                  },
                  "search": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Optional search string — matched against resourceName (LIKE) or rootEntityId (exact)"
                  }
                }
              }
            }
          }
        }
      },
      "AuditQueryCreateOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IAuditQueryCreateOneResponse",
        "description": "202 response returned when an audit query is successfully started. Poll GET /auditQueries/{id} for results.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "Query execution ID — use as path param to poll results"
              },
              "type": {
                "type": "string",
                "enum": [
                  "auditQueries"
                ]
              },
              "attributes": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "status"
                ],
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "RUNNING"
                    ],
                    "description": "Always RUNNING for a freshly started query"
                  }
                }
              }
            }
          }
        }
      },
      "Error": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IError",
        "description": "A single JSON:API error object. `status` is the HTTP status code as a string. `title` is a short, human-readable summary. `detail` provides optional context. `meta` may include structured conflict or authorization details.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "title"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "source": {
            "type": "object",
            "description": "A JSON Pointer to the request field that caused the error (e.g. `/data/attributes/title`).",
            "properties": {
              "pointer": {
                "type": "string"
              }
            }
          },
          "meta": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "stack": {
                "type": "string",
                "description": "Error stack trace. Only present in non-production environments."
              },
              "conflictItems": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  }
                }
              },
              "unauthorizedItems": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "ErrorResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IErrorResponse",
        "description": "Standard JSON:API error response returned when a request fails. Contains an `errors` array with one or more error objects (status, title, and optional detail).",
        "type": "object",
        "required": [
          "errors"
        ],
        "additionalProperties": false,
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "examples": [
          {
            "errors": [
              {
                "status": "400",
                "title": "Bad Request",
                "detail": "The request body is invalid."
              }
            ]
          },
          {
            "errors": [
              {
                "status": "422",
                "title": "Unprocessable Entity",
                "detail": "The value of primaryTitle is invalid.",
                "source": {
                  "pointer": "/data/attributes/primaryTitle"
                }
              }
            ]
          }
        ]
      },
      "AuditEventAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IAuditEventAttributes",
        "description": "Attributes of a single audit event captured from a Keystone entity change",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "rootEntityId",
          "tenantId",
          "timestamp",
          "actorId",
          "actorName",
          "actorType",
          "action",
          "resourceType",
          "resourceId",
          "resourceName"
        ],
        "properties": {
          "rootEntityId": {
            "type": "string",
            "description": "ID of the root entity this event is grouped under"
          },
          "tenantId": {
            "type": "string",
            "description": "Tenant that owns this event"
          },
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp of when the event occurred"
          },
          "actorId": {
            "type": "string",
            "description": "ID of the user or system that triggered the change"
          },
          "actorName": {
            "type": "string",
            "description": "Display name of the actor"
          },
          "actorType": {
            "type": "string",
            "description": "Type of actor (e.g. user, system)"
          },
          "action": {
            "type": "string",
            "description": "Cedar action that was performed (e.g. updateRecord)"
          },
          "changeSource": {
            "type": "string",
            "description": "Source system or surface that triggered the change"
          },
          "changeReason": {
            "type": "string",
            "description": "Optional free-text reason provided by the actor"
          },
          "resourceType": {
            "type": "string",
            "description": "KS:: prefixed entity type (e.g. KS::Record)"
          },
          "resourceId": {
            "type": "string",
            "description": "ID of the specific resource that changed"
          },
          "resourceName": {
            "type": "string",
            "description": "Display name of the resource at the time of the event"
          },
          "changesJson": {
            "type": "string",
            "description": "JSON-encoded diff of the changes made"
          }
        }
      },
      "AuditEvent": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IAuditEvent",
        "description": "JSON:API resource object for a single audit event",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "type",
          "attributes"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event ID"
          },
          "type": {
            "type": "string",
            "enum": [
              "auditEvents"
            ]
          },
          "attributes": {
            "$ref": "#/components/schemas/AuditEventAttributes"
          }
        }
      },
      "AuditQueryFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IAuditQueryFindOneResponse",
        "description": "Response when polling an audit query. 202 while RUNNING or FAILED; 200 with events in data[] when SUCCEEDED.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditEvent"
            },
            "description": "Audit event resources. Populated only when status is SUCCEEDED."
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status"
            ],
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "QUEUED",
                  "RUNNING",
                  "SUCCEEDED",
                  "FAILED"
                ],
                "description": "Current query execution state"
              },
              "hasMore": {
                "type": "boolean",
                "description": "True when the result set exceeds 1,000 events. Refine filters to see all results."
              }
            }
          }
        }
      },
      "BaseResourceAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IBaseResourceAttributes",
        "description": "Common timestamps present on all resource attribute objects. `created` is the ISO 8601 date-time when the resource was first created; `updated` is the date-time of the most recent modification.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "created",
          "updated"
        ],
        "properties": {
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "updated": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BackgroundJobStatus": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IBackgroundJobStatus",
        "description": "Status of a background job: ABORTED, FAILED, PENDING_REDRIVE, RUNNING, SUCCEEDED, or TIMED_OUT.",
        "type": "string",
        "enum": [
          "ABORTED",
          "FAILED",
          "PENDING_REDRIVE",
          "RUNNING",
          "SUCCEEDED",
          "TIMED_OUT"
        ]
      },
      "BackgroundJobAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IBackgroundJobAttributes",
        "description": "Attributes for a background job. Background jobs represent long-running asynchronous operations (e.g. contributor deletion, tenant data export). Includes current status, job type, parameters, optional output on completion, optional error details on failure, and optional item progress counts for batch jobs.",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseResourceAttributes"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "parameters": {
                "type": "object"
              },
              "status": {
                "$ref": "#/components/schemas/BackgroundJobStatus"
              },
              "output": {
                "type": "object"
              },
              "totalItemsCount": {
                "type": "integer",
                "minimum": 0,
                "description": "Total number of items in a batch job, when applicable."
              },
              "successItemsCount": {
                "type": "integer",
                "minimum": 0,
                "description": "Number of items processed successfully in a batch job, when applicable."
              },
              "failedItemsCount": {
                "type": "integer",
                "minimum": 0,
                "description": "Number of items that failed in a batch job, when applicable."
              },
              "error": {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  }
                },
                "required": [
                  "message",
                  "code"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "parameters",
              "status"
            ],
            "additionalProperties": false
          }
        ],
        "additionalProperties": false
      },
      "LinksRelated": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ILinks",
        "description": "A JSON:API links object with an absolute or relative 'related' link",
        "type": "object",
        "required": [
          "related"
        ],
        "properties": {
          "related": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "TenantRelationship": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantRelationship",
        "description": "A relationship to a tenant",
        "type": "object",
        "properties": {
          "data": {
            "additionalProperties": false,
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "tenants"
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          "links": {
            "$ref": "#/components/schemas/LinksRelated"
          }
        },
        "required": [
          "data",
          "links"
        ],
        "additionalProperties": false
      },
      "UserRelationship": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IUserRelationship",
        "description": "A relationship to the actor behind a write (e.g. `author`, `updatedBy`). `data.meta.type` is the actor type — a human user, an API key, or an internal service — and `links.related` is only present for human users, since API keys and services have no user resource to link to.",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "users"
                ]
              },
              "meta": {
                "type": "object",
                "properties": {
                  "tenantId": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string"
                  }
                },
                "required": [
                  "tenantId",
                  "type",
                  "displayName"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "type",
              "meta"
            ],
            "additionalProperties": false
          },
          "links": {
            "$ref": "#/components/schemas/LinksRelated"
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "BackgroundJobFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IBackgroundJobFindManyResponse",
        "description": "JSON:API response for listing background jobs for the caller's tenant.",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "backgroundJobs"
                  ]
                },
                "attributes": {
                  "$ref": "#/components/schemas/BackgroundJobAttributes"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                },
                "relationships": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "$ref": "#/components/schemas/TenantRelationship"
                    },
                    "author": {
                      "$ref": "#/components/schemas/UserRelationship"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "required": [
                "id",
                "type",
                "attributes"
              ],
              "additionalProperties": false
            }
          },
          "meta": {
            "type": "object",
            "properties": {
              "cursor": {
                "type": "string",
                "description": "The cursor to use to get the next page of results"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "BackgroundJobFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IBackgroundJobFindOneResponse",
        "description": "JSON:API response for a single background job.",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "backgroundJobs"
                ]
              },
              "attributes": {
                "$ref": "#/components/schemas/BackgroundJobAttributes"
              },
              "links": {
                "type": "object",
                "properties": {
                  "self": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              },
              "relationships": {
                "type": "object",
                "properties": {
                  "tenant": {
                    "$ref": "#/components/schemas/TenantRelationship"
                  },
                  "author": {
                    "$ref": "#/components/schemas/UserRelationship"
                  }
                },
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "BackgroundJobGetErrorsResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IBackgroundJobGetErrorsResponse",
        "description": "Response containing a presigned URL to download a zipped archive of a background job's per-item error files",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "url",
              "expiresInSeconds"
            ],
            "additionalProperties": false,
            "properties": {
              "url": {
                "type": "string",
                "format": "uri",
                "description": "Presigned S3 URL to download the zipped error archive"
              },
              "expiresInSeconds": {
                "type": "integer",
                "description": "Number of seconds until the presigned URL expires"
              }
            }
          }
        }
      },
      "relationship": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "id"
            ],
            "properties": {
              "type": {
                "type": "string"
              },
              "id": {
                "type": "string"
              }
            }
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "related": {
                "type": "string"
              }
            }
          }
        }
      },
      "BackgroundJobItemFailure": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IBackgroundJobItemFailure",
        "description": "One failed item of a background job, as a JSON:API resource. `id` is the producer's item key: the source index for data ingress (also the S3 error-file name), the record id for bulk edit. Each `errors` entry is one cause, shaped after the JSON:API error object: the underlying error's `status`/`title`/`detail` written verbatim (bulk edit), plus an optional `code` where the producer has a real vocabulary (ingress: IngressErrorType). Only `detail` is always present. `stage` names the pipeline stage that stopped the item for multi-stage producers (ingress: enumeration | mapping | recordWrite); single-stage producers omit it.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "definitions": {
          "relationship": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "data"
            ],
            "properties": {
              "data": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "type",
                  "id"
                ],
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "id": {
                    "type": "string"
                  }
                }
              },
              "links": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "related": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "backgroundJobItemFailures"
            ]
          },
          "id": {
            "type": "string"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "timestamp",
              "errors"
            ],
            "properties": {
              "label": {
                "type": "string",
                "description": "Optional human-readable handle for the item (e.g. the upstream id)"
              },
              "timestamp": {
                "type": "string",
                "description": "ISO 8601 timestamp of when the failure was recorded"
              },
              "stage": {
                "type": "string",
                "description": "Pipeline stage that stopped the item; omitted by single-stage producers"
              },
              "errors": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "detail"
                  ],
                  "properties": {
                    "status": {
                      "type": "integer",
                      "description": "HTTP status code of the underlying error, when the failure came from one"
                    },
                    "code": {
                      "type": "string",
                      "description": "Machine-readable code, where the producer has a real vocabulary (ingress: IngressErrorType)"
                    },
                    "title": {
                      "type": "string",
                      "description": "Short human-readable summary of the error class"
                    },
                    "detail": {
                      "type": "string",
                      "description": "Human-readable explanation of the failure"
                    }
                  }
                }
              }
            }
          },
          "relationships": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "job": {
                "$ref": "#/components/schemas/relationship"
              },
              "tenant": {
                "$ref": "#/components/schemas/relationship"
              },
              "record": {
                "$ref": "#/components/schemas/relationship"
              }
            }
          }
        }
      },
      "BackgroundJobFailuresFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IBackgroundJobFailuresFindManyResponse",
        "description": "JSON:API listing of a background job's per-item failures — the S3 error files' data members with their resource meta omitted (the per-item debug detail travels via the downloadable archive, not the listing). Cursor-paginated via meta.cursor, matching the background-jobs listing; there is no backwards cursor (the underlying S3 listing cannot page backwards).",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BackgroundJobItemFailure"
            }
          },
          "meta": {
            "type": "object",
            "properties": {
              "cursor": {
                "type": "string",
                "description": "The cursor to use to get the next page of results"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "ContributorResourceType": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorResourceType",
        "description": "JSON:API type discriminator for contributor resources. The `type` field is always `\"contributors\"`. Used as a base for contributor request and response shapes to enforce correct JSON:API resource typing.",
        "type": "object",
        "required": [
          "type"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "contributors"
            ]
          }
        }
      },
      "ContributorAttributeName": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorAttributeName",
        "description": "The contributor's display name. For most contributors this is their full name (e.g., 'John Doe'). Required when creating a contributor.",
        "type": "string"
      },
      "ContributorAttributeGender": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorAttributeGender",
        "description": "The contributor's gender. Sourced from the external metadata provider when the contributor originates from Origin.",
        "type": "string",
        "enum": [
          "male",
          "female"
        ]
      },
      "ContributorAttributeOriginRating": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorAttributeOriginRating",
        "description": "A normalized popularity or relevance score for the contributor as provided by the Origin metadata provider. Higher values indicate greater prominence.",
        "type": "number"
      },
      "ContributorAttributeBirthDate": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorAttributeBirthDate",
        "description": "The contributor's date of birth. Stored as a string to accommodate partial dates (year-only or year-month) as well as full ISO 8601 dates.",
        "type": "string"
      },
      "ContributorAttributeBirthName": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorAttributeBirthName",
        "description": "The contributor's birth name or legal name, if different from their primary display name (e.g., a stage name or alias is used as the primary name).",
        "type": "string"
      },
      "ContributorAttributeImage": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorAttributeImage",
        "description": "A profile image for the contributor. Contains the image URL and its pixel dimensions.",
        "type": "object",
        "required": [
          "url",
          "width",
          "height"
        ],
        "additionalProperties": false,
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The fully qualified URL of the profile image.",
            "example": "https://cdn.example.com/contributors/6883cdbce189e1b8/profile.jpg"
          },
          "width": {
            "type": "number",
            "description": "The image width in pixels."
          },
          "height": {
            "type": "number",
            "description": "The image height in pixels."
          }
        }
      },
      "ContributorAttributeOriginNexusId": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorAttributeOriginNexusId",
        "description": "The contributor's unique identifier in Origin Nexus. Used to link Origin Studio contributors to their corresponding Origin Nexus records and to sync updates.",
        "type": "string"
      },
      "ContributorAttributeImdbId": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorAttributeImdbId",
        "description": "The contributor's IMDb person ID (e.g., 'nm0000093'). Used for cross-referencing with the Internet Movie Database.",
        "type": "string"
      },
      "ContributorAttributeDataSource": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorAttributeDataSource",
        "description": "Indicates the origin of the contributor's data. `originNexus` means the record was ingested from Origin Nexus and may be updated by automated sync jobs. `custom` means the record was created manually by the tenant and is not subject to automated overwrites.",
        "type": "string",
        "enum": [
          "originNexus",
          "custom"
        ]
      },
      "ContributorAttributesInput": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorAttributesInput",
        "description": "Editable attributes for a contributor, used as the base for both create and update request bodies. All fields are optional to support partial updates. Includes personal metadata (name, gender, birth details), cross-platform identifiers (IMDb, TMDB, Origin, Wikidata, social handles), profile image, localized descriptions, and data source indicator.",
        "type": "object",
        "required": [],
        "additionalProperties": false,
        "properties": {
          "name": {
            "$ref": "#/components/schemas/ContributorAttributeName"
          },
          "gender": {
            "$ref": "#/components/schemas/ContributorAttributeGender"
          },
          "originRating": {
            "$ref": "#/components/schemas/ContributorAttributeOriginRating"
          },
          "birthDate": {
            "$ref": "#/components/schemas/ContributorAttributeBirthDate"
          },
          "deathDate": {
            "type": "string",
            "description": "The contributor's date of death, if applicable. Stored as a string to accommodate partial dates (year-only or year-month) as well as full ISO 8601 dates."
          },
          "birthName": {
            "$ref": "#/components/schemas/ContributorAttributeBirthName"
          },
          "image": {
            "$ref": "#/components/schemas/ContributorAttributeImage"
          },
          "altNames": {
            "type": "array",
            "description": "A list of alternative names or known aliases for the contributor (e.g., stage names, maiden names, transliterations). Each value must be unique within the array.",
            "items": {
              "type": "string"
            },
            "uniqueItems": true
          },
          "originNexusId": {
            "$ref": "#/components/schemas/ContributorAttributeOriginNexusId"
          },
          "tmdbId": {
            "type": "string",
            "description": "The contributor's ID in The Movie Database (TMDB). Used for cross-referencing with TMDB person records."
          },
          "imdbId": {
            "$ref": "#/components/schemas/ContributorAttributeImdbId"
          },
          "facebookId": {
            "type": "string",
            "description": "The contributor's Facebook profile identifier or username."
          },
          "instagramId": {
            "type": "string",
            "description": "The contributor's Instagram handle or profile identifier."
          },
          "twitterId": {
            "type": "string",
            "description": "The contributor's Twitter/X handle or profile identifier."
          },
          "freebaseMidId": {
            "type": "string",
            "description": "The contributor's Freebase machine ID (MID), a stable identifier from the Freebase knowledge graph."
          },
          "freebaseId": {
            "type": "string",
            "description": "The contributor's Freebase topic ID, a human-readable identifier from the Freebase knowledge graph."
          },
          "tvRageId": {
            "type": "string",
            "description": "The contributor's ID on the TVRage database."
          },
          "tvMediaId": {
            "type": "string",
            "description": "The contributor's ID in the TV Media database."
          },
          "wikiDataId": {
            "type": "string",
            "description": "The contributor's Wikidata entity ID (e.g., `Q12345`). Used for cross-referencing with the Wikidata knowledge base."
          },
          "wikiMediaId": {
            "type": "string",
            "description": "The contributor's Wikimedia Commons identifier, typically used for linking to media files hosted on Wikimedia."
          },
          "handIdentityId": {
            "type": "string",
            "description": "The contributor's identifier in the HAND (Hollywood Accounting Network Database) system."
          },
          "descriptions": {
            "type": "array",
            "description": "A list of localized biographical descriptions for the contributor, sourced from external providers. Each entry is keyed by a unique identifier and scoped to a locale.",
            "items": {
              "type": "object",
              "required": [
                "key",
                "value",
                "locale",
                "attribution"
              ],
              "additionalProperties": false,
              "properties": {
                "key": {
                  "type": "string",
                  "description": "A unique key identifying this description entry, typically the locale code or a provider-specific identifier."
                },
                "value": {
                  "type": "string",
                  "description": "The biographical text content for this description."
                },
                "locale": {
                  "type": "string",
                  "description": "BCP 47 language tag for the description's language (e.g., `en`, `fr`, `es`).",
                  "example": "en"
                },
                "attribution": {
                  "type": "string",
                  "description": "The name or identifier of the source providing this description (e.g., a data provider name)."
                }
              }
            }
          },
          "dataSource": {
            "$ref": "#/components/schemas/ContributorAttributeDataSource"
          }
        }
      },
      "ContributorCreateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorCreateOneRequest",
        "description": "Request body for creating a new contributor. Follows the JSON:API resource creation format with `type: 'contributors'` and an `attributes` object. The `name` field is required; all other attributes are optional. Set `dataSource` to `'custom'` for manually created contributors.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ContributorResourceType"
              },
              {
                "type": "object",
                "required": [
                  "attributes"
                ],
                "additionalProperties": false,
                "properties": {
                  "attributes": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/ContributorAttributesInput"
                      },
                      {
                        "type": "object",
                        "required": [
                          "name"
                        ],
                        "additionalProperties": false,
                        "properties": {
                          "name": {
                            "$ref": "#/components/schemas/ContributorAttributeName"
                          },
                          "dataSource": {
                            "$ref": "#/components/schemas/ContributorAttributeDataSource"
                          }
                        }
                      }
                    ]
                  }
                }
              }
            ]
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "ContributorAttributeStatus": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorAttributeStatus",
        "description": "Lifecycle status of the contributor. `active` means the contributor is available for use. `pendingDeletion` means a delete job has been initiated and the contributor will be removed once all associated credits are cleaned up.",
        "type": "string",
        "enum": [
          "active",
          "pendingDeletion"
        ]
      },
      "ContributorAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorAttributes",
        "description": "Full set of attributes for a stored contributor, combining all editable input fields with system-managed fields (status, dataSource) and base resource timestamps. Returned in contributor read and write responses.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ContributorAttributesInput"
          },
          {
            "$ref": "#/components/schemas/BaseResourceAttributes"
          },
          {
            "type": "object",
            "required": [
              "status"
            ],
            "additionalProperties": false,
            "properties": {
              "status": {
                "$ref": "#/components/schemas/ContributorAttributeStatus"
              },
              "dataSource": {
                "$ref": "#/components/schemas/ContributorAttributeDataSource"
              }
            }
          }
        ]
      },
      "ContributorRelationships": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorRelationships",
        "description": "JSON:API relationship links for a contributor resource. Currently contains the owning tenant relationship.",
        "type": "object",
        "properties": {
          "tenant": {
            "$ref": "#/components/schemas/TenantRelationship"
          }
        },
        "required": [
          "tenant"
        ],
        "additionalProperties": false
      },
      "LinksSelf": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ILinksSelf",
        "description": "A JSON:API links object with an absolute or relative 'self' link",
        "type": "object",
        "required": [
          "self"
        ],
        "properties": {
          "self": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "ContributorCreateOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorCreateOneResponse",
        "description": "Response returned after successfully creating a contributor. Contains the new contributor's ID, type, full attribute set, and relationship links to the owning tenant.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ContributorResourceType"
              },
              {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "attributes",
                  "relationships"
                ],
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "attributes": {
                    "$ref": "#/components/schemas/ContributorAttributes"
                  },
                  "relationships": {
                    "$ref": "#/components/schemas/ContributorRelationships"
                  },
                  "links": {
                    "$ref": "#/components/schemas/LinksSelf"
                  }
                }
              }
            ]
          }
        }
      },
      "ContributorFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorFindOneResponse",
        "description": "Response returned when retrieving a single contributor by ID. Contains the full contributor resource including all attributes (name, identifiers, biography descriptions, image) and relationship links to the owning tenant.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes",
              "relationships"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "$ref": "#/components/schemas/ContributorResourceType"
              },
              "attributes": {
                "$ref": "#/components/schemas/ContributorAttributes"
              },
              "relationships": {
                "$ref": "#/components/schemas/ContributorRelationships"
              }
            }
          },
          "links": {
            "$ref": "#/components/schemas/LinksSelf"
          }
        }
      },
      "ContributorUpdateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorUpdateOneRequest",
        "description": "Request body for partially updating an existing contributor. All attribute fields are optional; only the fields present in the request body are modified. Follows the JSON:API PATCH format with `type: 'contributors'`.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ContributorResourceType"
              },
              {
                "type": "object",
                "required": [
                  "attributes"
                ],
                "additionalProperties": false,
                "properties": {
                  "attributes": {
                    "$ref": "#/components/schemas/ContributorAttributesInput"
                  }
                }
              }
            ]
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "IContributorOperator": {
        "type": "string",
        "description": "The operator to use for a search condition. eq — exact match. ne — exact exclusion; a record with NO value for the field satisfies ne. contains — substring/token match. not_contains — negation of contains, with the same 'no value satisfies the negation' semantics as ne. starts_with — prefix match. lt/lte/gt/gte — numeric or date range comparisons. exists — field has any non-null value. not_exists — field is absent or null.",
        "enum": [
          "eq",
          "ne",
          "contains",
          "not_contains",
          "starts_with",
          "lt",
          "lte",
          "gt",
          "gte",
          "exists",
          "not_exists"
        ]
      },
      "IContributorCondition": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "enum": [
              "id",
              "name",
              "gender",
              "originRating",
              "birthDate",
              "birthName",
              "originNexusId",
              "imdbId",
              "status",
              "dataSource"
            ]
          },
          "operator": {
            "$ref": "#/components/schemas/IContributorOperator"
          },
          "value": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ]
          }
        },
        "required": [
          "field",
          "operator"
        ],
        "additionalProperties": false
      },
      "IContributorQueryGroup": {
        "type": "object",
        "properties": {
          "operator": {
            "type": "string",
            "enum": [
              "AND",
              "OR",
              "NOT"
            ]
          },
          "conditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IContributorCondition"
            }
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IContributorQueryGroup"
            }
          }
        },
        "required": [
          "operator"
        ],
        "anyOf": [
          {
            "required": [
              "conditions"
            ]
          },
          {
            "required": [
              "groups"
            ]
          }
        ],
        "additionalProperties": false
      },
      "ContributorSearchRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorSearchRequest",
        "description": "Request body for searching contributors. Queries are expressed as a tree of condition groups combined with boolean operators (AND, OR, NOT). Each leaf condition targets a specific contributor field using a comparison operator and value. Nested groups allow for arbitrarily complex query logic.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "searchQueries"
                ]
              },
              "attributes": {
                "type": "object",
                "properties": {
                  "group": {
                    "$ref": "#/components/schemas/IContributorQueryGroup"
                  }
                },
                "required": [
                  "group"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "definitions": {
          "IContributorOperator": {
            "type": "string",
            "description": "The operator to use for a search condition. eq — exact match. ne — exact exclusion; a record with NO value for the field satisfies ne. contains — substring/token match. not_contains — negation of contains, with the same 'no value satisfies the negation' semantics as ne. starts_with — prefix match. lt/lte/gt/gte — numeric or date range comparisons. exists — field has any non-null value. not_exists — field is absent or null.",
            "enum": [
              "eq",
              "ne",
              "contains",
              "not_contains",
              "starts_with",
              "lt",
              "lte",
              "gt",
              "gte",
              "exists",
              "not_exists"
            ]
          },
          "IContributorCondition": {
            "type": "object",
            "properties": {
              "field": {
                "type": "string",
                "enum": [
                  "id",
                  "name",
                  "gender",
                  "originRating",
                  "birthDate",
                  "birthName",
                  "originNexusId",
                  "imdbId",
                  "status",
                  "dataSource"
                ]
              },
              "operator": {
                "$ref": "#/components/schemas/IContributorOperator"
              },
              "value": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  }
                ]
              }
            },
            "required": [
              "field",
              "operator"
            ],
            "additionalProperties": false
          },
          "IContributorQueryGroup": {
            "type": "object",
            "properties": {
              "operator": {
                "type": "string",
                "enum": [
                  "AND",
                  "OR",
                  "NOT"
                ]
              },
              "conditions": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/IContributorCondition"
                }
              },
              "groups": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/IContributorQueryGroup"
                }
              }
            },
            "required": [
              "operator"
            ],
            "anyOf": [
              {
                "required": [
                  "conditions"
                ]
              },
              {
                "required": [
                  "groups"
                ]
              }
            ],
            "additionalProperties": false
          }
        }
      },
      "ContributorAttributesOpenSearchResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorAttributesOpenSearchResponse",
        "description": "Contributor attribute fields returned in search results. Contains the core contributor metadata fields (name, gender, dates, identifiers, status) as indexed by the search engine. Used as the `attributes` object within each search result item.",
        "allOf": [
          {
            "type": "object",
            "required": [
              "name",
              "status",
              "dataSource"
            ],
            "additionalProperties": false,
            "properties": {
              "name": {
                "$ref": "#/components/schemas/ContributorAttributeName"
              },
              "gender": {
                "$ref": "#/components/schemas/ContributorAttributeGender"
              },
              "originRating": {
                "$ref": "#/components/schemas/ContributorAttributeOriginRating"
              },
              "birthDate": {
                "$ref": "#/components/schemas/ContributorAttributeBirthDate"
              },
              "birthName": {
                "$ref": "#/components/schemas/ContributorAttributeBirthName"
              },
              "originNexusId": {
                "$ref": "#/components/schemas/ContributorAttributeOriginNexusId"
              },
              "imdbId": {
                "$ref": "#/components/schemas/ContributorAttributeImdbId"
              },
              "status": {
                "$ref": "#/components/schemas/ContributorAttributeStatus"
              },
              "dataSource": {
                "$ref": "#/components/schemas/ContributorAttributeDataSource"
              },
              "image": {
                "$ref": "#/components/schemas/ContributorAttributeImage"
              }
            }
          }
        ]
      },
      "ContributorSearchResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorSearchResponse",
        "description": "Response returned by the contributor search endpoint. Contains a paginated array of JSON:API contributor resources with their search-indexed attributes and relationships. The `meta` object includes pagination details (total count, current page, per-page size) and optional relevance scoring metadata.",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/ContributorResourceType"
                },
                {
                  "type": "object",
                  "required": [
                    "id",
                    "attributes",
                    "relationships"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "attributes": {
                      "$ref": "#/components/schemas/ContributorAttributesOpenSearchResponse"
                    },
                    "relationships": {
                      "$ref": "#/components/schemas/ContributorRelationships"
                    }
                  }
                }
              ],
              "additionalProperties": false
            },
            "additionalProperties": false
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "string"
              },
              "next": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "prev": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "additionalProperties": false
          },
          "meta": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "page": {
                "type": "integer"
              },
              "perPage": {
                "type": "integer"
              },
              "openSearch": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "_id": {
                    "type": "string"
                  },
                  "_index": {
                    "type": "string"
                  },
                  "_score": {
                    "type": "number"
                  }
                }
              }
            },
            "required": [
              "total",
              "page",
              "perPage"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "data",
          "meta"
        ],
        "additionalProperties": false
      },
      "BaseCreateRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IBaseCreateRequest",
        "description": "Base JSON:API shape for create requests. The `type` field is required and must match the target resource type. The `id` field is optional; if omitted, the server generates a unique ID for the new resource.",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "type"
        ]
      },
      "ContributorDeleteJobParameters": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorDeleteJobParameters",
        "description": "Parameters for the `deleteContributor` background job. Specifies the unique ID of the contributor to be permanently deleted along with all associated credits.",
        "type": "object",
        "properties": {
          "contributorId": {
            "type": "string"
          }
        },
        "required": [
          "contributorId"
        ],
        "additionalProperties": false
      },
      "ContributorJobCreateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorJobCreateOneRequest",
        "description": "Request body for creating a new contributor background job. Currently supports only the `deleteContributor` job type, which accepts the target contributor's ID as a parameter.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseCreateRequest"
              },
              {
                "type": "object",
                "properties": {
                  "attributes": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "deleteContributor"
                        ]
                      },
                      "parameters": {
                        "$ref": "#/components/schemas/ContributorDeleteJobParameters"
                      }
                    },
                    "required": [
                      "type",
                      "parameters"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "attributes"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "ContributorJobAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorJobAttributes",
        "description": "Attributes of a contributor background job. Currently the only supported job type is `deleteContributor`, which asynchronously removes a contributor and all associated credit records. Extends base background job attributes with job type and parameters.",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/BackgroundJobAttributes"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "deleteContributor"
                ]
              },
              "parameters": {
                "type": "object",
                "properties": {
                  "contributorId": {
                    "type": "string",
                    "description": "The ID of the contributor being deleted."
                  },
                  "tenantId": {
                    "type": "string",
                    "description": "The ID of the tenant that owns the contributor."
                  },
                  "subject": {
                    "type": "string",
                    "description": "Human-readable label for the job's target contributor (its name), captured server-side at job creation so the UI can display it even after the contributor is deleted. Purely presentational — not used by job processing."
                  }
                },
                "required": [
                  "contributorId",
                  "tenantId"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "parameters"
            ],
            "additionalProperties": false
          }
        ],
        "required": [
          "status",
          "created",
          "updated",
          "type",
          "parameters"
        ],
        "additionalProperties": false
      },
      "ContributorJobCreateOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorJobCreateOneResponse",
        "description": "Response returned after successfully creating a contributor background job. Contains the new job's ID and its initial attributes (status, ARN, type, parameters). Poll the job status using the returned ID.",
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseCreateRequest"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "attributes": {
                    "$ref": "#/components/schemas/ContributorJobAttributes"
                  }
                },
                "required": [
                  "id",
                  "attributes"
                ]
              }
            ]
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "CreditsListAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreditsListAttributes",
        "description": "Attributes of a credits list. A credits list is a named, ordered collection of credit entries for a specific record. `name` is the display name. `ranking` controls ordering when multiple lists exist. `isDefault` identifies the primary credits list for the record.",
        "type": "object",
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "description": "Display name for the credit list. For example, `\"Main Credits\"` or `\"International Credits\"`.",
            "example": "Main Credits"
          },
          "ranking": {
            "type": "number",
            "description": "Numeric ordering value used to sort credit lists when a record has more than one. Lower values appear first. If omitted, the list is appended after existing lists."
          },
          "isDefault": {
            "type": "boolean",
            "description": "When `true`, this credit list is treated as the primary credits for the record. Only one credit list per record should be designated as the default."
          }
        }
      },
      "CreditsListRelationships": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreditsListRelationships",
        "description": "JSON:API relationship links for a credits list resource. Contains links to the owning tenant and the record this credits list is associated with.",
        "type": "object",
        "properties": {
          "tenant": {
            "$ref": "#/components/schemas/TenantRelationship"
          },
          "record": {
            "type": "object",
            "properties": {
              "data": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "records"
                    ]
                  },
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "id"
                ],
                "additionalProperties": false
              },
              "links": {
                "$ref": "#/components/schemas/LinksRelated"
              }
            },
            "required": [
              "data",
              "links"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "tenant",
          "record"
        ],
        "additionalProperties": false
      },
      "CreditsListFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreditsListFindOneResponse",
        "description": "Response returned when retrieving a single credit list by ID. Contains the list's attributes (name, ranking, isDefault) combined with base timestamps (created, updated), plus relationship links to the owning tenant and parent record.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes",
              "relationships"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "creditsLists"
                ]
              },
              "attributes": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BaseResourceAttributes"
                  },
                  {
                    "$ref": "#/components/schemas/CreditsListAttributes",
                    "required": [
                      "name"
                    ]
                  }
                ]
              },
              "relationships": {
                "$ref": "#/components/schemas/CreditsListRelationships"
              }
            }
          },
          "links": {
            "$ref": "#/components/schemas/LinksRelated"
          }
        }
      },
      "CreditsListUpdateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreditsListUpdateOneRequest",
        "description": "Request body for partially updating a credits list. Only the attributes included in the request are modified. Supports updating the list's `name`, `ranking`, and `isDefault` flag.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "allOf": [
              {
                "type": "object",
                "required": [
                  "type"
                ],
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "creditsLists"
                    ]
                  }
                }
              },
              {
                "type": "object",
                "required": [
                  "attributes"
                ],
                "additionalProperties": false,
                "properties": {
                  "attributes": {
                    "$ref": "#/components/schemas/CreditsListAttributes"
                  }
                }
              }
            ]
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "CreditsListCreateOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreditsListCreateOneResponse",
        "description": "Response returned after successfully creating a credit list. Contains the new resource's ID, type, and relationship links to the owning tenant and parent record. Use the returned ID to fetch the full credit list with its attributes.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "relationships"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "creditsLists"
                ]
              },
              "relationships": {
                "additionalProperties": false,
                "required": [
                  "tenant",
                  "record"
                ],
                "properties": {
                  "tenant": {
                    "type": "object",
                    "required": [
                      "data",
                      "links"
                    ],
                    "properties": {
                      "data": {
                        "type": "object",
                        "required": [
                          "id",
                          "type"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "tenants"
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      "links": {
                        "$ref": "#/components/schemas/LinksRelated"
                      }
                    },
                    "additionalProperties": false
                  },
                  "record": {
                    "type": "object",
                    "required": [
                      "data",
                      "links"
                    ],
                    "properties": {
                      "data": {
                        "type": "object",
                        "required": [
                          "id",
                          "type"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "records"
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      "links": {
                        "$ref": "#/components/schemas/LinksRelated"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "links": {
            "$ref": "#/components/schemas/LinksRelated"
          }
        }
      },
      "CreditsListFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreditsListFindManyResponse",
        "description": "Response returned when listing all credit lists for a record. The `data` array contains zero or more credit list resources, each with its name, ranking, and isDefault flag. The `meta.filters` object echoes back the applied `isDefault` filter value. Use `links` for pagination navigation.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta",
          "links"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "type",
                "attributes",
                "relationships"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "creditsLists"
                  ]
                },
                "attributes": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/BaseResourceAttributes"
                    },
                    {
                      "$ref": "#/components/schemas/CreditsListAttributes"
                    }
                  ]
                },
                "relationships": {
                  "$ref": "#/components/schemas/CreditsListRelationships"
                },
                "links": {
                  "$ref": "#/components/schemas/LinksRelated"
                }
              }
            }
          },
          "meta": {
            "type": "object",
            "properties": {
              "filters": {
                "type": "object",
                "required": [
                  "isDefault"
                ],
                "properties": {
                  "isDefault": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "links": {
            "$ref": "#/components/schemas/LinksRelated"
          }
        }
      },
      "CreditsListCreateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreditsListCreateOneRequest",
        "description": "Request body for creating a new credit list for a record. Requires a `name` for the list. Optionally provide a client-generated `id` (16 lowercase hex characters) to control the list's identifier; re-sending the same `id` for the same record is rejected as a duplicate rather than creating a second list. Omit it to have the server generate one. Optionally set `ranking` to control sort order among multiple lists, and `isDefault` to designate this as the primary credit list for the record. The record association is determined by the `recordId` path parameter.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "allOf": [
              {
                "type": "object",
                "required": [
                  "type"
                ],
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "creditsLists"
                    ]
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{16}$",
                    "description": "Optional client-generated identifier. Must be 16 lowercase hexadecimal characters. When provided, re-sending the same `id` for the same record is rejected as a duplicate. If omitted, the server generates one."
                  }
                }
              },
              {
                "type": "object",
                "required": [
                  "attributes"
                ],
                "additionalProperties": false,
                "properties": {
                  "attributes": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/CreditsListAttributes",
                        "required": [
                          "name"
                        ]
                      }
                    ]
                  }
                }
              }
            ]
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "dataObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "credits"
            ]
          },
          "attributes": {
            "type": "object",
            "properties": {
              "job": {
                "type": "string",
                "enum": [
                  "Actor",
                  "Director",
                  "Executive Producer",
                  "Producer",
                  "Creator",
                  "Writer",
                  "Editor"
                ]
              },
              "ranking": {
                "type": "number",
                "minimum": 0
              },
              "characters": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "job"
            ],
            "additionalProperties": false
          },
          "relationships": {
            "type": "object",
            "properties": {
              "contributor": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "contributors"
                        ]
                      },
                      "id": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "data"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "contributor"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "attributes",
          "relationships"
        ],
        "additionalProperties": false
      },
      "updateRefObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "credits"
            ]
          },
          "relationship": {
            "type": "string",
            "enum": [
              "contributors"
            ]
          }
        },
        "required": [
          "id",
          "type",
          "relationship"
        ],
        "additionalProperties": false
      },
      "removeRefObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "credits"
            ]
          }
        },
        "required": [
          "id",
          "type"
        ],
        "additionalProperties": false
      },
      "CreditsListAtomicOperationsRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreditsListAtomicOperationsRequest",
        "description": "JSON:API Atomic Operations request for managing credits within a credits list. Supports `add` (create a new credit for a contributor), `update` (modify an existing credit's attributes), and `remove` (delete a credit) operations in a single transactional call.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "atomic:operations": {
            "type": "array",
            "description": "An ordered list of credit operations to apply atomically. Each operation specifies an `op` code (`add`, `update`, or `remove`) and the relevant data or reference. All operations succeed or fail together — no partial updates are applied.",
            "items": {
              "type": "object",
              "oneOf": [
                {
                  "description": "Add a new credit entry to the list. Provide the contributor relationship, job role, and optional ranking and character names.",
                  "properties": {
                    "op": {
                      "const": "add"
                    },
                    "data": {
                      "$ref": "#/components/schemas/dataObject"
                    }
                  },
                  "required": [
                    "op",
                    "data"
                  ],
                  "additionalProperties": false
                },
                {
                  "description": "Update an existing credit entry. Identify the credit to update via `ref` (by ID and type) and supply the new attribute values in `data`.",
                  "properties": {
                    "op": {
                      "const": "update"
                    },
                    "ref": {
                      "$ref": "#/components/schemas/updateRefObject"
                    },
                    "data": {
                      "$ref": "#/components/schemas/dataObject"
                    }
                  },
                  "required": [
                    "op",
                    "data"
                  ],
                  "additionalProperties": false
                },
                {
                  "description": "Remove an existing credit entry from the list. Identify the credit to delete via `ref` using its ID.",
                  "properties": {
                    "op": {
                      "const": "remove"
                    },
                    "ref": {
                      "$ref": "#/components/schemas/removeRefObject"
                    }
                  },
                  "required": [
                    "op",
                    "ref"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          }
        },
        "required": [
          "atomic:operations"
        ],
        "additionalProperties": false,
        "definitions": {
          "dataObject": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "credits"
                ]
              },
              "attributes": {
                "type": "object",
                "properties": {
                  "job": {
                    "type": "string",
                    "enum": [
                      "Actor",
                      "Director",
                      "Executive Producer",
                      "Producer",
                      "Creator",
                      "Writer",
                      "Editor"
                    ]
                  },
                  "ranking": {
                    "type": "number",
                    "minimum": 0
                  },
                  "characters": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "job"
                ],
                "additionalProperties": false
              },
              "relationships": {
                "type": "object",
                "properties": {
                  "contributor": {
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "contributors"
                            ]
                          },
                          "id": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "type",
                          "id"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "data"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "contributor"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "attributes",
              "relationships"
            ],
            "additionalProperties": false
          },
          "updateRefObject": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "credits"
                ]
              },
              "relationship": {
                "type": "string",
                "enum": [
                  "contributors"
                ]
              }
            },
            "required": [
              "id",
              "type",
              "relationship"
            ],
            "additionalProperties": false
          },
          "removeRefObject": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "credits"
                ]
              }
            },
            "required": [
              "id",
              "type"
            ],
            "additionalProperties": false
          }
        }
      },
      "CreditsAttributeJob": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreditsAttributeJob",
        "description": "The role or function a contributor performed in the production of a work. Defines the supported credit job types in Origin Studio.",
        "type": "string",
        "enum": [
          "Actor",
          "Director",
          "Executive Producer",
          "Producer",
          "Creator",
          "Writer",
          "Editor"
        ]
      },
      "CreditsAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreditsAttributes",
        "description": "Attributes of a single credit entry representing a contributor's involvement in a record. `job` is the contributor's role (e.g., Actor, Director). `ranking` is the billing order within the credits list. `characters` lists character names for acting credits.",
        "type": "object",
        "required": [
          "job"
        ],
        "additionalProperties": false,
        "properties": {
          "job": {
            "$ref": "#/components/schemas/CreditsAttributeJob"
          },
          "ranking": {
            "type": "number",
            "minimum": 0,
            "description": "Billing order of this credit within its job category. Lower values indicate higher prominence (e.g., top-billed Actor). Must be zero or greater."
          },
          "characters": {
            "type": "array",
            "description": "List of character names this contributor portrays in the title. Only relevant for acting credits (e.g., Actor). May be empty for crew roles.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      },
      "ContributorRelationship": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IContributorRelationship",
        "description": "A relationship to a contributor",
        "type": "object",
        "properties": {
          "data": {
            "additionalProperties": false,
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "contributors"
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          "links": {
            "$ref": "#/components/schemas/LinksRelated"
          }
        },
        "required": [
          "data",
          "links"
        ],
        "additionalProperties": false
      },
      "CreditsListRelationship": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreditsListRelationship",
        "description": "A JSON:API relationship reference to a credit list resource. Contains the credit list's `id` and `type` (always `\"creditsLists\"`), plus a `links.related` URL to fetch the full credit list.",
        "type": "object",
        "properties": {
          "data": {
            "additionalProperties": false,
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "creditsLists"
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          "links": {
            "$ref": "#/components/schemas/LinksRelated"
          }
        },
        "required": [
          "data",
          "links"
        ],
        "additionalProperties": false
      },
      "CreditsRelationships": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreditsRelationships",
        "description": "JSON:API relationship links for a credit resource. Contains links to the owning tenant, the record the credit belongs to, the credits list it appears in, and the contributor being credited.",
        "type": "object",
        "properties": {
          "tenant": {
            "$ref": "#/components/schemas/TenantRelationship"
          },
          "record": {
            "type": "object",
            "properties": {
              "data": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "records"
                    ]
                  },
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "id"
                ],
                "additionalProperties": false
              },
              "links": {
                "$ref": "#/components/schemas/LinksRelated"
              }
            },
            "required": [
              "data",
              "links"
            ],
            "additionalProperties": false
          },
          "contributor": {
            "$ref": "#/components/schemas/ContributorRelationship"
          },
          "creditsList": {
            "$ref": "#/components/schemas/CreditsListRelationship"
          }
        },
        "required": [
          "tenant",
          "record",
          "contributor",
          "creditsList"
        ],
        "additionalProperties": false
      },
      "CreditsFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreditsFindManyResponse",
        "description": "Response returned when listing credits for a credit list. The `data` array contains credit entries for the requested job role, each with ranking, character names (for acting credits), and relationship links to the contributor, record, credit list, and tenant. The `meta.filters` object echoes back the applied job filter. Supports cursor-based pagination via `meta.filters.cursor`.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta",
          "links"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "type",
                "attributes",
                "relationships"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "credits"
                  ]
                },
                "attributes": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/BaseResourceAttributes"
                    },
                    {
                      "$ref": "#/components/schemas/CreditsAttributes",
                      "required": [
                        "job"
                      ]
                    }
                  ]
                },
                "relationships": {
                  "$ref": "#/components/schemas/CreditsRelationships"
                },
                "links": {
                  "$ref": "#/components/schemas/LinksRelated"
                }
              }
            }
          },
          "meta": {
            "type": "object",
            "required": [
              "filters"
            ],
            "properties": {
              "filters": {
                "type": "object",
                "description": "Pagination and filter state for the current result set.",
                "required": [
                  "job"
                ],
                "properties": {
                  "job": {
                    "$ref": "#/components/schemas/CreditsAttributeJob"
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Opaque cursor value to pass as `page.cursor` in the next request to retrieve the following page of results. Absent when there are no more pages."
                  },
                  "numberOfItems": {
                    "type": "number",
                    "description": "Total number of credits matching the filter, if available."
                  },
                  "perPage": {
                    "type": "number",
                    "description": "Maximum number of results returned per page."
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "links": {
            "$ref": "#/components/schemas/LinksRelated"
          }
        }
      },
      "DataDeliveryResourceType": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataDeliveryResourceType",
        "description": "JSON:API type discriminator for data delivery resources. The `type` field is always `\"dataDeliveries\"`. Used as a base to enforce correct JSON:API resource typing in request bodies.",
        "type": "object",
        "required": [
          "type"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "dataDeliveries"
            ]
          }
        }
      },
      "DataDeliveryAttributesInput": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataDeliveryAttributesInput",
        "description": "Editable input attributes for a data delivery. Currently only `name` is user-editable, with a maximum length enforced by the service.",
        "type": "object",
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 250,
            "description": "Must be kept in sync with MAX_DATA_DELIVERY_NAME_LENGTH in services/data-delivery-service/src/constants/index.ts"
          }
        }
      },
      "DataDeliveryAttributeStatus": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataDeliveryAttributeStatus",
        "description": "Data Delivery Package Status. Must be kept in sync with DataDeliveryStatusValues in services/data-delivery-service/src/constants/index.ts",
        "type": "string",
        "enum": [
          "IN_PROGRESS",
          "COMPLETED",
          "DELETING"
        ]
      },
      "DataDeliveryState": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataDeliveryState",
        "description": "Export/delete job status. PENDING indicates the job is ready to start. RUNNING means the job (export or delete) is in progress. SUCCEEDED, PARTIALLY_SUCCEEDED, FAILED, TIMED_OUT, and ABORTED are terminal states. PARTIALLY_SUCCEEDED means the export completed but at least one record had errors. PENDING_REDRIVE indicates the job is queued for retry.",
        "type": "string",
        "enum": [
          "PENDING",
          "RUNNING",
          "SUCCEEDED",
          "PARTIALLY_SUCCEEDED",
          "FAILED",
          "TIMED_OUT",
          "ABORTED",
          "PENDING_REDRIVE"
        ]
      },
      "DataDeliveryAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataDeliveryAttributes",
        "description": "Full attributes of a data delivery. Extends the input attributes with system-managed fields: `recordCount` (number of records in the package), `status` (the delivery's lifecycle state), `exportJobStatus` (the current status of the most recent export job), and timestamps.",
        "allOf": [
          {
            "$ref": "#/components/schemas/DataDeliveryAttributesInput"
          },
          {
            "$ref": "#/components/schemas/BaseResourceAttributes"
          },
          {
            "type": "object",
            "required": [
              "recordCount",
              "status",
              "exportJobStatus"
            ],
            "additionalProperties": false,
            "properties": {
              "recordCount": {
                "type": "number",
                "description": "Total number of records linked to the data delivery package."
              },
              "status": {
                "$ref": "#/components/schemas/DataDeliveryAttributeStatus"
              },
              "exportJobStatus": {
                "$ref": "#/components/schemas/DataDeliveryState"
              },
              "archiveParts": {
                "type": "array",
                "description": "Ordered ZIP archive part results for the exported package.",
                "items": {
                  "type": "object",
                  "required": [
                    "partNumber",
                    "fileName",
                    "status"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "partNumber": {
                      "type": "number",
                      "description": "One-based archive part number."
                    },
                    "fileName": {
                      "type": "string",
                      "description": "Archive file name (for example delivery_package1.zip)."
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "READY",
                        "FAILED"
                      ],
                      "description": "Part generation status."
                    },
                    "url": {
                      "type": "string",
                      "description": "Download URL for READY parts."
                    },
                    "expiresAt": {
                      "type": "string",
                      "description": "ISO 8601 date-time when the archive expires (7 days after export)."
                    },
                    "error": {
                      "type": "string",
                      "description": "Failure reason for FAILED parts."
                    },
                    "format": {
                      "type": "string",
                      "enum": [
                        "csv",
                        "json"
                      ],
                      "description": "Which representation this archive holds. A record-export produces one archive per format so the package can be downloaded as CSV or JSON; single-format deliveries tag their one archive. Absent for legacy/manifest archives."
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "data": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "records"
            ]
          }
        },
        "required": [
          "id",
          "type"
        ]
      },
      "DataDeliveryRelationships": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataDeliveryRelationships",
        "description": "JSON:API relationship links for a data delivery resource. Contains links to the owning tenant and the collection of records included in the delivery package.",
        "type": "object",
        "properties": {
          "tenant": {
            "$ref": "#/components/schemas/TenantRelationship"
          },
          "records": {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/data"
                }
              },
              "links": {
                "$ref": "#/components/schemas/LinksRelated"
              }
            },
            "required": [],
            "additionalProperties": false
          },
          "author": {
            "type": "object",
            "properties": {
              "data": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "users"
                    ]
                  }
                },
                "required": [
                  "id",
                  "type"
                ]
              },
              "links": {
                "$ref": "#/components/schemas/LinksRelated"
              }
            },
            "required": [
              "data"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "tenant",
          "records",
          "author"
        ],
        "additionalProperties": false
      },
      "DataDeliveryFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataDeliveryFindManyResponse",
        "description": "The response for a data delivery find many request.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/DataDeliveryResourceType"
                },
                {
                  "type": "object",
                  "required": [
                    "id",
                    "type",
                    "attributes",
                    "relationships"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "attributes": {
                      "$ref": "#/components/schemas/DataDeliveryAttributes"
                    },
                    "relationships": {
                      "$ref": "#/components/schemas/DataDeliveryRelationships"
                    },
                    "links": {
                      "$ref": "#/components/schemas/LinksSelf"
                    }
                  }
                }
              ]
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              },
              "next": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "additionalProperties": false
          },
          "meta": {
            "type": "object",
            "properties": {
              "cursor": {
                "type": "string"
              },
              "filters": {
                "type": "object",
                "properties": {
                  "status": {
                    "$ref": "#/components/schemas/DataDeliveryAttributeStatus"
                  },
                  "exportJobStatus": {
                    "$ref": "#/components/schemas/DataDeliveryState"
                  },
                  "createdAfter": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "createdBefore": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        }
      },
      "DataDeliveryCreateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataDeliveryCreateOneRequest",
        "description": "Request body for creating a new data delivery package. Requires a `name` for the delivery. Records can be added to the delivery after creation via the relationship endpoints.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "dataDeliveries"
                ]
              },
              "attributes": {
                "$ref": "#/components/schemas/DataDeliveryAttributesInput"
              },
              "relationships": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "records": {
                    "type": "object",
                    "required": [
                      "data"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "data": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/data"
                        },
                        "minItems": 1,
                        "maxItems": 50000
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "DataDeliveryCreateOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataDeliveryCreateOneResponse",
        "description": "The response for a data delivery create one request.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DataDeliveryResourceType"
              },
              {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "attributes",
                  "relationships"
                ],
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "attributes": {
                    "$ref": "#/components/schemas/DataDeliveryAttributes"
                  },
                  "relationships": {
                    "$ref": "#/components/schemas/DataDeliveryRelationships"
                  },
                  "links": {
                    "$ref": "#/components/schemas/LinksSelf"
                  }
                }
              }
            ]
          }
        }
      },
      "DataDeliveryFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataDeliveryFindOneResponse",
        "description": "The response for a data delivery find one request.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DataDeliveryResourceType"
              },
              {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "attributes",
                  "relationships"
                ],
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "attributes": {
                    "$ref": "#/components/schemas/DataDeliveryAttributes"
                  },
                  "relationships": {
                    "$ref": "#/components/schemas/DataDeliveryRelationships"
                  },
                  "links": {
                    "$ref": "#/components/schemas/LinksSelf"
                  }
                }
              }
            ]
          }
        }
      },
      "DataDeliveryUpdateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataDeliveryUpdateOneRequest",
        "description": "Request body for updating an existing data delivery. Currently supports updating the delivery `name`. The `data.id` must match the `dataDeliveryId` path parameter.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DataDeliveryResourceType"
              },
              {
                "type": "object",
                "required": [
                  "attributes"
                ],
                "additionalProperties": false,
                "properties": {
                  "attributes": {
                    "$ref": "#/components/schemas/DataDeliveryAttributesInput"
                  }
                }
              }
            ]
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "DataDeliveryFindRecordsRelationshipResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataDeliveryFindRecordsRelationshipResponse",
        "description": "JSON:API response for GET dataDeliveries/:id/relationships/records - linkage record resource identifiers",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "description": "Resource identifier objects for each record in the relationship",
            "items": {
              "type": "object",
              "required": [
                "type",
                "id"
              ],
              "additionalProperties": false,
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "records"
                  ]
                },
                "id": {
                  "type": "string"
                }
              }
            }
          },
          "links": {
            "type": "object",
            "description": "JSON:API links",
            "properties": {
              "self": {
                "type": "string",
                "description": "Link to this relationship"
              }
            },
            "additionalProperties": false
          },
          "meta": {
            "type": "object",
            "description": "Non-standard meta (e.g. total count)",
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0,
                "description": "Total number of records in the relationship"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "DataDeliveryAddRecordsRelationshipRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataDeliveryAddRecordsRelationshipRequest",
        "description": "Request to add records to a data delivery relationship",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/data"
            },
            "minItems": 1
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "DataDeliveryRemoveRecordsRelationshipRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataDeliveryRemoveRecordsRelationshipRequest",
        "description": "Request to remove records from a data delivery relationship",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/data"
            },
            "minItems": 1
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "DataDeliveryExportJobParameters": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataDeliveryExportJobParameters",
        "description": "Parameters for a data delivery export job. `dataDeliveryId` specifies the delivery to export. `exportOptions` is an array of content categories (what to export): `metadata` (record fields), `contributors` (cast and crew), `images` (poster and photo assets), and `files` (associated documents and media files). `outputFormats` is the set of representations to produce for the record metadata: `json` (per-record JSON) and/or `csv` (a single flat, re-importable CSV for the bulk-update flow). A record-export requests both so the completed package can be downloaded as either; the pipeline produces one format-tagged archive per entry. Defaults to `[\"json\"]`.",
        "type": "object",
        "properties": {
          "dataDeliveryId": {
            "type": "string"
          },
          "exportOptions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "metadata",
                "contributors",
                "images",
                "files"
              ]
            }
          },
          "outputFormats": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        },
        "required": [
          "dataDeliveryId"
        ],
        "additionalProperties": false
      },
      "DataDeliveryExportJobCreateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataDeliveryExportJobCreateOneRequest",
        "description": "Request body for creating a data delivery export or delete job. Specify the job type (`exportDataDelivery` or `deleteDataDelivery`) and the target delivery ID in the parameters.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseCreateRequest"
              },
              {
                "type": "object",
                "properties": {
                  "attributes": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "exportDataDelivery",
                          "deleteDataDelivery"
                        ]
                      },
                      "parameters": {
                        "$ref": "#/components/schemas/DataDeliveryExportJobParameters"
                      }
                    },
                    "required": [
                      "type",
                      "parameters"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "attributes"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "DataDeliveryExportJobAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataDeliveryExportJobAttributes",
        "description": "Attributes for a data delivery background job. Extends the base background job with data delivery-specific job types: `exportDataDelivery` (packages and exports all records in the delivery) and `deleteDataDelivery` (permanently removes the delivery and its associated data).",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/BackgroundJobAttributes"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "exportDataDelivery",
                  "deleteDataDelivery"
                ]
              },
              "parameters": {
                "type": "object",
                "properties": {
                  "dataDeliveryId": {
                    "type": "string"
                  },
                  "tenantId": {
                    "type": "string"
                  },
                  "exportOptions": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "metadata",
                        "contributors",
                        "images",
                        "files"
                      ]
                    }
                  },
                  "outputFormats": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "json",
                        "csv"
                      ]
                    }
                  }
                },
                "required": [
                  "dataDeliveryId",
                  "tenantId"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "parameters"
            ],
            "additionalProperties": false
          }
        ],
        "required": [
          "arn",
          "status",
          "created",
          "updated",
          "type",
          "parameters"
        ],
        "additionalProperties": false
      },
      "DataDeliveryExportJobCreateOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataDeliveryExportJobCreateOneResponse",
        "description": "Response returned after successfully creating a data delivery background job. Contains the new job's ID and initial status attributes. Poll the job status to track export progress.",
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseCreateRequest"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "attributes": {
                    "$ref": "#/components/schemas/DataDeliveryExportJobAttributes"
                  }
                },
                "required": [
                  "id",
                  "attributes"
                ]
              }
            ]
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "DataIngressAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataIngressAttributes",
        "description": "Attributes for a data ingress execution",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "sourceAdapterType",
          "totalItems",
          "successCount",
          "failedCount"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "IN_PROGRESS",
              "COMPLETED",
              "FAILED"
            ],
            "description": "Current status of the ingress execution"
          },
          "name": {
            "type": "string",
            "description": "Optional name for the data ingress execution, useful for identification and tracking purposes"
          },
          "sourceAdapterType": {
            "type": "string",
            "description": "Identifier of the source adapter used (e.g., 'origin-studio-api', 'generic-file')"
          },
          "payload": {
            "type": "object",
            "description": "Adapter-specific configuration payload",
            "additionalProperties": true
          },
          "totalItems": {
            "type": "integer",
            "description": "Total number of items identified for import"
          },
          "successCount": {
            "type": "integer",
            "description": "Number of items successfully imported"
          },
          "failedCount": {
            "type": "integer",
            "description": "Number of items that failed to import"
          },
          "executionArn": {
            "type": "string",
            "description": "Internal execution reference for the workflow processing this data ingress. Provided for diagnostic purposes."
          },
          "backgroundJobId": {
            "type": "string",
            "description": "ID of the background job tracking this data ingress execution. Use it to retrieve the execution's error archive via GET /backgroundJobs/{jobId}/errors."
          },
          "output": {
            "type": "object",
            "description": "Output data including errors and results",
            "additionalProperties": true
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the execution completed"
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "description": "Creation timestamp"
          },
          "updated": {
            "type": "string",
            "format": "date-time",
            "description": "Last update timestamp"
          }
        }
      },
      "DataIngressFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataIngressFindManyResponse",
        "description": "Response for listing data ingress executions",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "type",
                "attributes"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Data ingress execution ID"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "dataIngress"
                  ]
                },
                "attributes": {
                  "$ref": "#/components/schemas/DataIngressAttributes"
                }
              }
            }
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "cursor": {
                "type": "string",
                "description": "Cursor for pagination"
              }
            }
          }
        }
      },
      "DataIngressCreateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataIngressCreateOneRequest",
        "description": "Request body for creating a new data ingress execution",
        "type": "object",
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "dataIngress"
                ]
              },
              "attributes": {
                "type": "object",
                "required": [
                  "sourceAdapterType",
                  "importType",
                  "payload"
                ],
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Optional name for the data ingress execution, useful for identification and tracking purposes"
                  },
                  "sourceAdapterType": {
                    "type": "string",
                    "description": "Identifier of the source adapter to use (e.g., 'origin-studio-api', 'generic-file')"
                  },
                  "importType": {
                    "type": "string",
                    "enum": [
                      "file",
                      "api"
                    ],
                    "description": "Determines the import strategy: 'file' reads items from an S3 file (CSV/JSON/JSONL) using ItemReader, 'api' paginates through an external API in a loop"
                  },
                  "importFileType": {
                    "type": "string",
                    "enum": [
                      "csv",
                      "json",
                      "jsonl"
                    ],
                    "description": "Specifies the file format when 'importType' is 'file'. Required if 'importType' is 'file', ignored otherwise."
                  },
                  "payload": {
                    "type": "object",
                    "description": "Adapter-specific configuration payload",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        }
      },
      "DataIngressCreateOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataIngressCreateOneResponse",
        "description": "Response for creating a new data ingress execution",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "description": "Data ingress execution ID"
              },
              "type": {
                "type": "string",
                "enum": [
                  "dataIngress"
                ]
              },
              "attributes": {
                "$ref": "#/components/schemas/DataIngressAttributes"
              }
            }
          }
        }
      },
      "DataIngressFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataIngressFindOneResponse",
        "description": "Response for getting a single data ingress execution",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "description": "Data ingress execution ID"
              },
              "type": {
                "type": "string",
                "enum": [
                  "dataIngress"
                ]
              },
              "attributes": {
                "$ref": "#/components/schemas/DataIngressAttributes"
              }
            }
          }
        }
      },
      "DataIngressGetUploadUrlRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataIngressGetUploadUrlRequest",
        "description": "Request body for generating a presigned S3 upload URL for data ingress file imports",
        "type": "object",
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "dataIngress"
                ]
              },
              "attributes": {
                "type": "object",
                "required": [
                  "fileName"
                ],
                "additionalProperties": false,
                "properties": {
                  "fileName": {
                    "type": "string",
                    "description": "Name of the file to upload"
                  },
                  "contentType": {
                    "type": "string",
                    "description": "MIME content type of the file (e.g., 'text/csv', 'application/json')",
                    "nullable": true
                  }
                }
              }
            }
          }
        }
      },
      "DataIngressGetUploadUrlResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataIngressGetUploadUrlResponse",
        "description": "Response containing a presigned S3 URL for uploading a data ingress file",
        "type": "object",
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "dataIngressUploadUrl"
                ]
              },
              "attributes": {
                "type": "object",
                "required": [
                  "url",
                  "key",
                  "expiresInSeconds"
                ],
                "additionalProperties": false,
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Presigned S3 URL for uploading the file via HTTP PUT"
                  },
                  "key": {
                    "type": "string",
                    "description": "S3 object key where the file will be stored"
                  },
                  "expiresInSeconds": {
                    "type": "integer",
                    "description": "Number of seconds until the presigned URL expires"
                  }
                }
              }
            }
          }
        }
      },
      "DataIngressGetDownloadUrlRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataIngressGetDownloadUrlRequest",
        "description": "Request body for generating a presigned S3 download URL for a data ingress file",
        "type": "object",
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "dataIngress"
                ]
              },
              "attributes": {
                "type": "object",
                "required": [
                  "fileName"
                ],
                "additionalProperties": false,
                "properties": {
                  "fileName": {
                    "type": "string",
                    "description": "Name of the file to download"
                  }
                }
              }
            }
          }
        }
      },
      "DataIngressGetDownloadUrlResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataIngressGetDownloadUrlResponse",
        "description": "Response containing a presigned S3 URL for downloading a data ingress file",
        "type": "object",
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "dataIngressDownloadUrl"
                ]
              },
              "attributes": {
                "type": "object",
                "required": [
                  "url",
                  "key",
                  "expiresInSeconds"
                ],
                "additionalProperties": false,
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Presigned S3 URL for downloading the file via HTTP GET"
                  },
                  "key": {
                    "type": "string",
                    "description": "S3 object key of the file"
                  },
                  "expiresInSeconds": {
                    "type": "integer",
                    "description": "Number of seconds until the presigned URL expires"
                  }
                }
              }
            }
          }
        }
      },
      "DataIngressScanColumnsRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataIngressScanColumnsRequest",
        "description": "Request body for scanning an uploaded file to discover column names and unique categorical values",
        "type": "object",
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "dataIngress"
                ]
              },
              "attributes": {
                "type": "object",
                "required": [
                  "fileName"
                ],
                "additionalProperties": false,
                "properties": {
                  "fileName": {
                    "type": "string",
                    "minLength": 1,
                    "description": "File name only, without any path prefix. Must match the file name used when obtaining the upload URL."
                  }
                }
              }
            }
          }
        }
      },
      "DataIngressScanColumnsResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataIngressScanColumnsResponse",
        "description": "Response from scanning an uploaded file for column names and unique categorical values",
        "type": "object",
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "dataIngressScanColumns"
                ]
              },
              "attributes": {
                "type": "object",
                "required": [
                  "ok"
                ],
                "additionalProperties": false,
                "properties": {
                  "ok": {
                    "type": "boolean",
                    "description": "Whether the scan succeeded"
                  },
                  "fileType": {
                    "type": "string",
                    "enum": [
                      "csv",
                      "json",
                      "jsonl"
                    ],
                    "description": "Format of the uploaded file"
                  },
                  "columns": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "All column names found in the file header (CSV first row or JSON object keys)"
                  },
                  "uniqueValues": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "description": "Map of column name to sorted array of unique values found in that column"
                  },
                  "error": {
                    "type": "string",
                    "description": "Error message when ok is false"
                  }
                }
              }
            }
          }
        }
      },
      "DataWarehouseSettingsAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataWarehouseSettingsAttributes",
        "description": "Your data export settings",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "credentialType",
          "format",
          "schedule"
        ],
        "properties": {
          "credentialType": {
            "type": "string",
            "enum": [
              "iam-role",
              "access-key"
            ],
            "description": "How your exported data is accessed in the storage bucket"
          },
          "iamRoleArn": {
            "type": [
              "string",
              "null"
            ],
            "description": "The AWS IAM role allowed to read your exported data from the storage bucket. Used when credentialType is 'iam-role'. Removing it turns off exports."
          },
          "accessKeyId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The access key ID, shown when credentialType is 'access-key'. The matching secret is never shown here."
          },
          "format": {
            "type": "string",
            "enum": [
              "parquet",
              "csv"
            ],
            "description": "The file format for your exported data"
          },
          "schedule": {
            "type": "string",
            "enum": [
              "once-a-day",
              "twice-a-day"
            ],
            "description": "How often your data is exported"
          },
          "exportLocation": {
            "type": [
              "string",
              "null"
            ],
            "description": "The S3 URI your exported data is written to, e.g. s3://your-export-bucket/. Null when this deployment has no export storage configured."
          },
          "lastExportDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When your data was most recently exported"
          },
          "lastExportStatus": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "success",
              "failure",
              null
            ],
            "description": "Whether the most recent export succeeded or failed"
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "description": "When these settings were created"
          },
          "updated": {
            "type": "string",
            "format": "date-time",
            "description": "When these settings were last updated"
          }
        }
      },
      "DataWarehouseSettingsFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataWarehouseSettingsFindManyResponse",
        "description": "Your data export settings. Exports can only be set up once, so this contains at most one item.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "type",
                "attributes"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The export settings ID"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "dataWarehouseSettings"
                  ]
                },
                "attributes": {
                  "$ref": "#/components/schemas/DataWarehouseSettingsAttributes"
                }
              }
            }
          }
        }
      },
      "DataWarehouseSettingsCreateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataWarehouseSettingsCreateOneRequest",
        "description": "Request body for turning on data exports",
        "type": "object",
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "dataWarehouseSettings"
                ]
              },
              "attributes": {
                "type": "object",
                "required": [
                  "credentialType"
                ],
                "additionalProperties": false,
                "properties": {
                  "credentialType": {
                    "type": "string",
                    "enum": [
                      "iam-role",
                      "access-key"
                    ]
                  },
                  "iamRoleArn": {
                    "type": "string",
                    "description": "The AWS IAM role allowed to read your exported data. Required when credentialType is 'iam-role'."
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "parquet",
                      "csv"
                    ]
                  },
                  "schedule": {
                    "type": "string",
                    "enum": [
                      "once-a-day",
                      "twice-a-day"
                    ],
                    "description": "How often your data is exported. Defaults to once-a-day when omitted."
                  }
                }
              }
            }
          }
        }
      },
      "DataWarehouseSettingsResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataWarehouseSettingsResponse",
        "description": "Your data export settings",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "description": "The export settings ID"
              },
              "type": {
                "type": "string",
                "enum": [
                  "dataWarehouseSettings"
                ]
              },
              "attributes": {
                "$ref": "#/components/schemas/DataWarehouseSettingsAttributes"
              }
            }
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "description": "Included only when a new access key was issued by this request (turning on exports with credentialType 'access-key', or switching to it). The secret is shown once and never stored, so save it securely.",
            "properties": {
              "accessKeyId": {
                "type": "string",
                "description": "The access key ID for reading your exported data"
              },
              "accessKeySecret": {
                "type": "string",
                "description": "The secret for your access key. Shown once and never stored or shown again, so save it securely."
              }
            }
          }
        }
      },
      "DataWarehouseSettingsUpdateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataWarehouseSettingsUpdateOneRequest",
        "description": "Request body for updating your data export settings. Send only the fields you want to change.",
        "type": "object",
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "dataWarehouseSettings"
                ]
              },
              "attributes": {
                "type": "object",
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                  "credentialType": {
                    "type": "string",
                    "enum": [
                      "iam-role",
                      "access-key"
                    ]
                  },
                  "iamRoleArn": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Set to null to remove access and turn off exports"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "parquet",
                      "csv"
                    ]
                  },
                  "schedule": {
                    "type": "string",
                    "enum": [
                      "once-a-day",
                      "twice-a-day"
                    ]
                  }
                }
              }
            }
          }
        }
      },
      "DataWarehouseCredentialsResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataWarehouseCredentialsResponse",
        "description": "Returned when you turn on exports or replace your access key. Contains the new access key ID and secret. The secret is shown only once and is never stored or shown again, so save it securely.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "description": "The ID of the export settings these credentials belong to"
              },
              "type": {
                "type": "string",
                "enum": [
                  "dataWarehouseCredentials"
                ]
              },
              "attributes": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "accessKeyId",
                  "accessKeySecret"
                ],
                "properties": {
                  "accessKeyId": {
                    "type": "string",
                    "description": "The IAM access key ID for reading your exported data"
                  },
                  "accessKeySecret": {
                    "type": "string",
                    "description": "The secret for your access key. Shown only in this response and never stored or shown again, so save it securely."
                  }
                }
              }
            }
          }
        }
      },
      "DataWarehouseSchemaResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataWarehouseSchemaResponse",
        "description": "The current layout of your exported data. One entry per table, listing its columns and their data types.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "type",
                "attributes"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Table name"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "dataWarehouseSchemaTable"
                  ]
                },
                "attributes": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "table",
                    "columns"
                  ],
                  "properties": {
                    "table": {
                      "type": "string",
                      "description": "Table name"
                    },
                    "columns": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "name",
                          "type"
                        ],
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "Column name"
                          },
                          "type": {
                            "type": "string",
                            "description": "The column's data type as reported by information_schema"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "BaseResource": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IBaseResource",
        "description": "JSON:API resource identifier. All Origin Studio API resource objects include at least an `id` (unique string identifier) and a `type` (the JSON:API resource type name, e.g. records, contributors).",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "type"
        ],
        "additionalProperties": false
      },
      "DatasetAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDatasetAttributes",
        "description": "Attributes of a dataset. `key` is the machine-readable identifier. `label` is the human-readable display name. `localized` indicates whether items are keyed by locale. `availableLocales` lists the supported locales for localized datasets. `dataSource` indicates if the dataset is system-provisioned (`fabric`) or tenant-created (`custom`). `allowCustomItems` controls whether tenants can add, update, or delete items.",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "dataSource": {
            "type": "string",
            "description": "Data source of the dataset",
            "enum": [
              "fabric",
              "custom"
            ]
          },
          "label": {
            "type": "string",
            "description": "Label for the dataset"
          },
          "localized": {
            "type": "boolean",
            "description": "Indicates if the dataset is localized"
          },
          "availableLocales": {
            "type": "array",
            "description": "Available locales for the dataset",
            "items": {
              "type": "string"
            }
          },
          "key": {
            "type": "string",
            "description": "Key attribute of the dataset"
          },
          "tenantId": {
            "type": "string",
            "description": "Tenant ID of the dataset"
          },
          "allowCustomItems": {
            "type": "boolean",
            "description": "Indicates if customers can add, update, or delete items in this dataset. When false, the dataset is locked and no item modifications are allowed."
          }
        },
        "required": [
          "dataSource",
          "label",
          "key"
        ]
      },
      "Dataset": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDataset",
        "description": "A JSON:API dataset resource representing a controlled vocabulary or lookup list used to constrain field values. Datasets can be localized (items keyed by locale) or non-localized. When `allowCustomItems` is false, the dataset is locked — items may only be managed by Fabric.",
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseResource"
          },
          {
            "type": "object",
            "properties": {
              "attributes": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/DatasetAttributes"
                  },
                  {
                    "$ref": "#/components/schemas/BaseResourceAttributes"
                  }
                ],
                "additionalProperties": false
              },
              "meta": {
                "type": "object",
                "properties": {
                  "tenantId": {
                    "type": "string"
                  },
                  "allowCustomItems": {
                    "type": "boolean",
                    "description": "Indicates if users can add, update, or delete items in this dataset. When false, the dataset is locked and no item modifications are allowed."
                  }
                },
                "additionalProperties": false
              },
              "relationships": {
                "type": "object",
                "properties": {
                  "tenant": {
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ],
                        "additionalProperties": false
                      },
                      "links": {
                        "type": "object",
                        "properties": {
                          "related": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "related"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  },
                  "items": {
                    "type": "object",
                    "properties": {
                      "links": {
                        "type": "object",
                        "properties": {
                          "related": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "related"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "tenant"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "attributes",
              "meta"
            ],
            "additionalProperties": false
          }
        ]
      },
      "GetDatasetsResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IGetDatasetsResponse",
        "description": "Response for listing all datasets in a tenant. Returns an array of dataset resources with their attributes and relationship links.",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Dataset"
            },
            "additionalProperties": false
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "CreateDatasetRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDatasetCreateRequest",
        "description": "Request body for creating a new dataset. Requires `label`, `key`, and `localized`. Optionally accepts `availableLocales` for localized datasets and `allowCustomItems` to control whether tenants can manage the items.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "attributes": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "Unique key for the dataset"
                  },
                  "label": {
                    "type": "string",
                    "description": "Label of the dataset"
                  },
                  "dataSource": {
                    "type": "string",
                    "description": "Data source of the dataset",
                    "enum": [
                      "custom",
                      "fabric"
                    ]
                  },
                  "localized": {
                    "type": "boolean",
                    "description": "Indicates if the dataset is localized"
                  }
                },
                "required": [
                  "key",
                  "label",
                  "dataSource"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "CreateDatasetResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDatasetCreateResponse",
        "description": "Response returned after successfully creating a dataset. Contains the new dataset resource with its generated ID, attributes, and relationship links.",
        "type": "object",
        "required": [
          "data",
          "links"
        ],
        "additionalProperties": false,
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Dataset"
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "required": [
              "self"
            ]
          }
        }
      },
      "GetDatasetResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IGetDatasetResponse",
        "description": "Response for fetching a single dataset by ID. Contains the full dataset resource with attributes, relationship links, and a self link.",
        "type": "object",
        "required": [
          "data",
          "links"
        ],
        "additionalProperties": false,
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Dataset"
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "WriteMetaOnlyRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IWriteMetaOnlyRequest",
        "description": "Optional request body carrying only audit metadata, used by mutations that otherwise take no body (e.g. resource DELETEs). Lets clients attach meta.audit.source/reason to such operations. The body itself is optional; it is not otherwise required.",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          }
        }
      },
      "PatchDatasetRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IPatchDatasetRequest",
        "description": "Request body for partially updating a dataset's attributes. Only the fields present in `data.attributes` are modified. The `data.id` must match the `datasetId` path parameter.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseResource"
              },
              {
                "required": [
                  "id",
                  "attributes"
                ],
                "additionalProperties": false,
                "properties": {
                  "attributes": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "DatasetItemAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDatasetItemAttributes",
        "description": "Attributes of a single dataset item (a controlled vocabulary entry). `key` is the stable machine-readable identifier stored on records. `value` is the human-readable label displayed in the UI. `locale` scopes the item to a specific language/region for localized datasets. `dataSource` indicates whether the item was created by Fabric or by the tenant.",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "locale": {
            "type": "string",
            "description": "Locale of the dataset item"
          },
          "dataSource": {
            "type": "string",
            "description": "Data source of the dataset item"
          },
          "key": {
            "type": "string",
            "description": "Key attribute of the dataset item"
          },
          "value": {
            "type": "string",
            "description": "Value of the dataset item"
          }
        },
        "required": [
          "key",
          "value"
        ]
      },
      "DatasetRelationship": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDatasetRelationship",
        "description": "A JSON:API relationship object linking a resource to a dataset. Contains the dataset's `id` and `type`, plus a `links.related` URL for fetching the full dataset resource.",
        "type": "object",
        "properties": {
          "data": {
            "additionalProperties": false,
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "datasets"
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          "links": {
            "$ref": "#/components/schemas/LinksRelated"
          }
        },
        "required": [
          "data",
          "links"
        ],
        "additionalProperties": false
      },
      "DatasetItem": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IDatasetItem",
        "description": "A JSON:API dataset item resource representing a single entry in a controlled vocabulary dataset. Each item has a `key` (machine-readable identifier) and `value` (display label). For localized datasets, items also carry a `locale` code.",
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseResource"
          },
          {
            "type": "object",
            "properties": {
              "attributes": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/DatasetItemAttributes"
                  },
                  {
                    "$ref": "#/components/schemas/BaseResourceAttributes"
                  }
                ],
                "additionalProperties": false
              },
              "relationships": {
                "type": "object",
                "properties": {
                  "dataset": {
                    "$ref": "#/components/schemas/DatasetRelationship"
                  },
                  "tenant": {
                    "$ref": "#/components/schemas/TenantRelationship"
                  }
                },
                "additionalProperties": false
              }
            },
            "required": [
              "attributes",
              "relationships"
            ],
            "additionalProperties": false
          }
        ]
      },
      "GetDatasetItemsResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IGetDatasetItemsResponse",
        "description": "Paginated response for listing all items in a dataset. Returns an array of dataset item resources, each with key/value/locale attributes and relationship links to the parent dataset.",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DatasetItem"
            },
            "additionalProperties": false
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "data",
          "links"
        ],
        "additionalProperties": false
      },
      "AddDatasetItemOperation": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IAddDatasetItemOperation",
        "description": "The data payload for an `add` operation in a dataset atomic operations request. Specifies the type and attributes (`key`, `value`, and optionally `locale`) for the new dataset item to be created.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "attributes": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string"
              },
              "value": {
                "type": "string"
              },
              "locale": {
                "type": "string"
              }
            },
            "required": [
              "key",
              "value"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "attributes"
        ],
        "additionalProperties": false
      },
      "UpdateDatasetItemOperation": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IUpdateDatasetItemOperation",
        "description": "The data payload for an `update` operation on a dataset item. Specifies the item's ID, type, and the attributes to modify (currently `value`).",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "attributes": {
            "type": "object",
            "properties": {
              "value": {
                "type": "string"
              }
            },
            "required": [
              "value"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "attributes"
        ],
        "additionalProperties": false
      },
      "ExecuteDatasetOperationRequestData": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IExecuteDatasetOperationRequestData",
        "description": "A single operation within a dataset atomic operations request. `op` is the operation type (`add`, `update`, or `remove`). `ref` identifies the target item for update and remove operations. `data` carries the payload for add and update operations.",
        "type": "object",
        "properties": {
          "op": {
            "type": "string",
            "enum": [
              "add",
              "remove",
              "update"
            ]
          },
          "ref": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "relationship": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "id"
            ],
            "additionalProperties": false
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AddDatasetItemOperation"
              },
              {
                "$ref": "#/components/schemas/UpdateDatasetItemOperation"
              }
            ]
          }
        },
        "required": [
          "op",
          "ref"
        ],
        "additionalProperties": false
      },
      "ExecuteDatasetOperationRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IExecuteDatasetOperationRequest",
        "description": "JSON:API Atomic Operations request for managing items within a dataset. Supports `add`, `update`, and `remove` operations in a single request. All operations are applied atomically — either all succeed or none are applied. A maximum of 99 operations can be submitted per request. The same item cannot appear in conflicting operations (e.g. both `add` and `remove`) within the same request. Only datasets with `allowCustomItems: true` accept item modifications.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "atomic:operations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExecuteDatasetOperationRequestData"
            }
          }
        },
        "required": [
          "atomic:operations"
        ],
        "additionalProperties": false
      },
      "FieldAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IFieldAttributes",
        "description": "Attributes of a metadata field. `label` is the human-readable display name. `key` is the machine-readable identifier used in record data storage. `schema` is a JSON Schema object defining the structure and validation rules for the field's values. `localized` indicates whether the field stores separate values per locale. `dataSource` distinguishes system-provisioned fields (`fabric`) from tenant-created ones (`custom`).",
        "type": "object",
        "required": [
          "label",
          "dataSource",
          "key",
          "localized"
        ],
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string",
            "description": "Human-readable display name for the field shown in the UI. Example: `\"Release Year\"`, `\"Genre\"`, `\"Synopsis\"`."
          },
          "key": {
            "type": "string",
            "description": "Stable machine-readable identifier for the field used when reading and writing record data. Example: `\"release_year\"`, `\"genre\"`. Cannot be changed after creation."
          },
          "schema": {
            "type": "object",
            "description": "Generated JSON Schema fragment describing the shape and validation rules for this field's value. Derived automatically from `dataType`, `list`, `localized`, and `dataValidation` on create. Read-only on the response.",
            "properties": {
              "type": {
                "type": "string"
              },
              "required": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "properties": {
                "type": "object",
                "properties": {
                  "field": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      }
                    },
                    "required": [
                      "type"
                    ]
                  }
                }
              }
            },
            "additionalProperties": false
          },
          "dataSource": {
            "type": "string",
            "description": "Indicates who owns the field. `fabric` means it is a system-provisioned field shared across all tenants (read-only, cannot be deleted). `custom` means it was created by the tenant and can be modified or deleted. Example: `\"fabric\"`, `\"custom\"`."
          },
          "localized": {
            "type": "boolean",
            "description": "When `true`, the field stores a separate value per locale (e.g. one synopsis in English and another in French). When `false`, a single value is stored regardless of locale."
          },
          "supportsInheritance": {
            "type": "boolean",
            "description": "When `true`, this field's value can be inherited from a parent record (for example a Season inheriting from a Series). Authorization policies may use this flag to control inheritance behaviour."
          },
          "supportsKeywordSearch": {
            "type": "boolean",
            "description": "When `true`, this text field is mapped with a `.keyword` subfield in OpenSearch and `eq` queries use an exact-match term query on the keyword subfield instead of match_phrase. Typically enabled for identifier fields (e.g. Origin ID, EIDR ID)."
          },
          "list": {
            "type": "boolean",
            "description": "When `true`, the field stores multiple values (an array). When `false`, the field stores a single scalar value. For example, a `genre` field is typically a list while a `release_year` field is not."
          },
          "uiComponent": {
            "type": "string",
            "description": "Hint for the UI about which input component to render for this field. Common values: `TextInput`, `TextArea`, `NumberInput`, `ToggleSwitch`, `Date`, `DateTime`, `Time`, `Select`, `MultiSelect`, `Autocomplete`, `AutocompleteSelect`, `AutocompleteMultiSelect`, `DataGrid`, `Custom`."
          },
          "uiSpan": {
            "type": "number",
            "description": "Hint for the UI about how much horizontal space to allocate for this field when rendering forms."
          },
          "propertiesAttributes": {
            "type": "object",
            "description": "Extensible map of additional display or configuration metadata for the field. The structure is open-ended and used by the UI to carry extra rendering hints. Not validated by the API.",
            "additionalProperties": true
          }
        }
      },
      "Field": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IField",
        "description": "A JSON:API field resource representing a metadata field that can be attached to records within a tenant. Fields have a label (display name), a unique key, a JSON schema defining the value structure, and a dataset relationship that constrains the valid values. When retrieved with `filter.workType`, the `section` relationship indicates where the field appears in the record layout.",
        "allOf": [
          {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes",
              "meta",
              "relationships"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "fields"
                ]
              },
              "attributes": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/FieldAttributes"
                  },
                  {
                    "$ref": "#/components/schemas/BaseResourceAttributes"
                  }
                ],
                "additionalProperties": false
              },
              "meta": {
                "type": "object",
                "properties": {
                  "tenantId": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              },
              "relationships": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "tenant": {
                    "type": "object",
                    "required": [
                      "data",
                      "links"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "data": {
                        "type": "object",
                        "required": [
                          "id",
                          "type"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "tenants"
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      "links": {
                        "type": "object",
                        "required": [
                          "related"
                        ],
                        "properties": {
                          "related": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "dataset": {
                    "type": "object",
                    "required": [
                      "data"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "data": {
                        "type": "object",
                        "required": [
                          "id",
                          "type",
                          "meta"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "datasets"
                            ]
                          },
                          "meta": {
                            "type": "object",
                            "required": [
                              "tenantId"
                            ],
                            "properties": {
                              "tenantId": {
                                "type": "string"
                              },
                              "localized": {
                                "type": "boolean"
                              },
                              "validKeys": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                },
                                "description": "Valid dataset item keys for non-localized datasets or default keys for localized datasets"
                              },
                              "validKeysByLocale": {
                                "type": "object",
                                "additionalProperties": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "description": "Valid dataset item keys by locale for localized datasets"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "additionalProperties": false
                      },
                      "links": {
                        "type": "object",
                        "properties": {
                          "related": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "author": {
                    "type": "object",
                    "required": [
                      "data"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "data": {
                        "type": "object",
                        "required": [
                          "id",
                          "type",
                          "meta"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "users"
                            ]
                          },
                          "meta": {
                            "type": "object",
                            "required": [
                              "tenantId",
                              "type",
                              "displayName"
                            ],
                            "properties": {
                              "tenantId": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "displayName": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "additionalProperties": false
                      },
                      "links": {
                        "type": "object",
                        "properties": {
                          "related": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "section": {
                    "type": "object",
                    "additionalProperties": false,
                    "description": "Section relationship from the record layout. Only included when filter.workType is provided.",
                    "properties": {
                      "data": {
                        "type": "object",
                        "required": [
                          "id",
                          "key",
                          "label"
                        ],
                        "additionalProperties": false,
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "key": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "FieldFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IFieldFindManyResponse",
        "description": "Paginated response for listing metadata fields. The `data` array contains field resources matching the applied filters. When `include=dataset` or `include=dataset.items` is requested, the `included` array contains the related datasets and optionally their items. Pagination is cursor-based: use `meta.cursor` with a `next` link to retrieve the next page.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Field"
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              },
              "next": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "additionalProperties": false
          },
          "included": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Dataset"
                },
                {
                  "$ref": "#/components/schemas/DatasetItem"
                }
              ]
            }
          },
          "meta": {
            "type": "object",
            "properties": {
              "cursor": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "FieldCreateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IFieldCreateOneRequest",
        "description": "Request body for creating a new metadata field in a tenant. The `data.attributes` must include `label`, `key`, and `localized`. An optional dataset relationship can be provided to link the field to a valid-values dataset.",
        "type": "object",
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseCreateRequest"
              },
              {
                "type": "object",
                "required": [
                  "type"
                ],
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "fields"
                    ]
                  }
                }
              },
              {
                "type": "object",
                "required": [
                  "attributes",
                  "relationships"
                ],
                "additionalProperties": false,
                "properties": {
                  "attributes": {
                    "required": [
                      "label",
                      "key",
                      "dataType"
                    ],
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "label": {
                        "type": "string",
                        "description": "Human-readable display name for the field shown in the UI. Example: `\"Release Year\"`, `\"Genre\"`."
                      },
                      "key": {
                        "type": "string",
                        "description": "Stable machine-readable identifier for the field. Used when reading and writing record data. Must be unique within the tenant and must not match the key of a system-provisioned field (`dataSource: fabric`) for the tenant; system field keys are reserved. Cannot be changed after creation. Example: `\"release_year\"`, `\"custom_genre\"`."
                      },
                      "localized": {
                        "type": "boolean",
                        "description": "When `true`, the field stores a separate value per locale. When `false` (default), a single value is shared across all locales."
                      },
                      "supportsInheritance": {
                        "type": "boolean",
                        "nullable": true,
                        "description": "When `true`, this field's value can be inherited from a parent record (for example a Season from a Series). Defaults to `false`."
                      },
                      "supportsKeywordSearch": {
                        "type": "boolean",
                        "nullable": true,
                        "description": "When `true`, this text field uses a `.keyword` subfield in OpenSearch for exact-match `eq` queries. Defaults to `false`."
                      },
                      "uiComponent": {
                        "type": "string",
                        "description": "Hint for the UI about which input component to render. Common values: `TextInput`, `TextArea`, `NumberInput`, `ToggleSwitch`, `Date`, `DateTime`, `Select`, `Autocomplete`, `AutocompleteMultiSelect`."
                      },
                      "list": {
                        "type": "boolean",
                        "description": "When `true`, the field accepts multiple values (an array). When `false` (default), the field accepts a single value. Example: `genre` is a list; `release_year` is not."
                      },
                      "dataSource": {
                        "type": "string",
                        "description": "Indicates the origin of the field. Defaults to `custom` for tenant-created fields. Use `fabric` only when provisioning system fields."
                      },
                      "dataType": {
                        "type": "string",
                        "enum": [
                          "string",
                          "number",
                          "boolean",
                          "dataset"
                        ],
                        "default": "string",
                        "description": "The data type of the field's value. `string` for text, `number` for numeric values, `boolean` for true/false flags, `dataset` for fields whose valid values are constrained by a dataset (controlled vocabulary)."
                      },
                      "dataValidation": {
                        "type": "object",
                        "description": "Optional validation constraints applied to the field's value when a record is saved. Applicable constraints depend on `dataType`: string fields use `minLength`, `maxLength`, `pattern`, `format`; number fields use `minimum`, `maximum`; list fields use `minItems`, `maxItems`.",
                        "properties": {
                          "minLength": {
                            "type": "number",
                            "nullable": true,
                            "description": "Minimum number of characters for string fields."
                          },
                          "maxLength": {
                            "type": "number",
                            "nullable": true,
                            "description": "Maximum number of characters for string fields."
                          },
                          "minimum": {
                            "type": "number",
                            "nullable": true,
                            "description": "Minimum numeric value for number fields."
                          },
                          "maximum": {
                            "type": "number",
                            "nullable": true,
                            "description": "Maximum numeric value for number fields."
                          },
                          "pattern": {
                            "type": "string",
                            "nullable": true,
                            "description": "Regular expression pattern the string value must match."
                          },
                          "format": {
                            "type": "string",
                            "nullable": true,
                            "description": "Named format the string value must conform to (e.g. `date`, `date-time`, `uri`)."
                          },
                          "minItems": {
                            "type": "number",
                            "nullable": true,
                            "description": "Minimum number of items for list fields (`list: true`)."
                          },
                          "maxItems": {
                            "type": "number",
                            "nullable": true,
                            "description": "Maximum number of items for list fields (`list: true`)."
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "relationships": {
                    "type": "object",
                    "properties": {
                      "dataset": {
                        "type": "object",
                        "properties": {
                          "data": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "meta": {
                                "type": "object",
                                "properties": {
                                  "tenantId": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "tenantId"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "id",
                              "type",
                              "meta"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "data"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        }
      },
      "FieldFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IFieldFindOneResponse",
        "description": "Response for retrieving a single metadata field by ID. The `data` object is the field resource. When `include=dataset` or `include=dataset.items` is requested, the `included` array contains the related dataset and optionally its items.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Field"
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "included": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Dataset"
                },
                {
                  "$ref": "#/components/schemas/DatasetItem"
                }
              ]
            }
          }
        }
      },
      "FieldUpdateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IFieldUpdateOneRequest",
        "description": "Request body for partially updating an existing metadata field. Only the attributes included in the request are modified. The `data.id` must match the `fieldId` path parameter.",
        "type": "object",
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseResource"
              },
              {
                "type": "object",
                "required": [
                  "type"
                ],
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "fields"
                    ]
                  }
                }
              },
              {
                "required": [
                  "attributes"
                ],
                "additionalProperties": false,
                "properties": {
                  "attributes": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "dataValidation": {
                        "type": "object",
                        "description": "Updated validation constraints for the field's value. Only the properties provided are changed. Set a property to `null` to remove a constraint.",
                        "properties": {
                          "minLength": {
                            "type": "number",
                            "nullable": true,
                            "description": "Minimum number of characters for string fields."
                          },
                          "maxLength": {
                            "type": "number",
                            "nullable": true,
                            "description": "Maximum number of characters for string fields."
                          },
                          "minimum": {
                            "type": "number",
                            "nullable": true,
                            "description": "Minimum numeric value for number fields."
                          },
                          "maximum": {
                            "type": "number",
                            "nullable": true,
                            "description": "Maximum numeric value for number fields."
                          },
                          "pattern": {
                            "type": "string",
                            "nullable": true,
                            "description": "Regular expression pattern the string value must match."
                          },
                          "format": {
                            "type": "string",
                            "nullable": true,
                            "description": "Named format the string value must conform to (e.g. `date`, `date-time`, `uri`)."
                          },
                          "minItems": {
                            "type": "number",
                            "nullable": true,
                            "description": "Minimum number of items for list fields."
                          },
                          "maxItems": {
                            "type": "number",
                            "nullable": true,
                            "description": "Maximum number of items for list fields."
                          }
                        },
                        "additionalProperties": false
                      },
                      "label": {
                        "type": "string",
                        "description": "Updated human-readable display name for the field."
                      },
                      "supportsInheritance": {
                        "type": "boolean",
                        "nullable": true,
                        "description": "Updated inheritance flag. When `true`, this field's value can be inherited from a parent record."
                      },
                      "supportsKeywordSearch": {
                        "type": "boolean",
                        "nullable": true,
                        "description": "Updated keyword search flag. When `true`, this text field uses a `.keyword` subfield in OpenSearch for exact-match `eq` queries."
                      }
                    }
                  },
                  "relationships": {
                    "type": "object",
                    "properties": {
                      "dataset": {
                        "type": "object",
                        "properties": {
                          "data": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "meta": {
                                "type": "object",
                                "properties": {
                                  "tenantId": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "tenantId"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "id",
                              "type",
                              "meta"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "data"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        }
      },
      "WorkTypes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "WorkTypes",
        "description": "The classification type of an entertainment work. `Movie` is a standalone feature-length film. `MovieEdit` is a variation of a Movie. `Series` is a TV or streaming series. `Season` is a season within a Series. `Episode` is a single episode within a Season. `EpisodeEdit` is a variation of an Episode. `Compilation` is an editorially curated collection of existing records.",
        "type": "string",
        "enum": [
          "Movie",
          "MovieEdit",
          "Series",
          "Season",
          "Episode",
          "EpisodeEdit",
          "Compilation"
        ]
      },
      "RecordLayoutField": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordLayoutField",
        "description": "A field entry within a record layout section. Links a field (identified by `id` and `key`) to its position in the layout. The `fields` array on the section allows multiple sub-fields to be grouped under a single layout position.",
        "type": "object",
        "required": [
          "id",
          "key",
          "fields"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique ID of the field being placed in this layout position. Must reference an existing field that belongs to the tenant."
          },
          "key": {
            "type": "string",
            "description": "The machine-readable key of the field being placed in this layout position. Example: `\"synopsis\"`, `\"release_year\"`."
          }
        }
      },
      "RecordLayoutSection": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordLayoutSection",
        "description": "A section within a record layout group. Sections provide a labeled sub-grouping of fields within a tab/group in the editing UI. Each section has a unique `key`, a display `label`, and an ordered array of fields.",
        "type": "object",
        "required": [
          "key",
          "label",
          "fields"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the section within this layout. Assigned automatically on creation."
          },
          "key": {
            "type": "string",
            "description": "Stable machine-readable identifier for the section within its parent group. Example: `\"core_metadata\"`, `\"identifiers\"`."
          },
          "label": {
            "type": "string",
            "description": "Human-readable label displayed as the section heading in the editing UI. Example: `\"Core Metadata\"`, `\"Identifiers\"`."
          },
          "hidden": {
            "type": "boolean",
            "description": "When `true`, this section and all its fields are hidden from the editing UI. The system-required `core_metadata` section cannot be hidden."
          },
          "fields": {
            "type": "array",
            "description": "Ordered list of field references within this section. Each entry references a field by its `id` and `key`. The order determines the display order in the editing UI.",
            "items": {
              "$ref": "#/components/schemas/RecordLayoutField"
            }
          }
        }
      },
      "RecordLayoutGroup": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordLayoutGroup",
        "description": "A top-level grouping of sections within a record layout. Groups typically correspond to tabs or major UI panels in the record editing view. Each group has a unique `key`, a display `label`, a `type` classifier, and an ordered array of sections.",
        "type": "object",
        "required": [
          "key",
          "label",
          "type",
          "sections"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the group within this layout. Assigned automatically on creation."
          },
          "key": {
            "type": "string",
            "description": "Stable machine-readable identifier for the group within this layout. Example: `\"origination\"`, `\"technical_details\"`."
          },
          "label": {
            "type": "string",
            "description": "Human-readable label displayed as the tab or panel heading in the editing UI. Example: `\"Origination\"`, `\"Technical Details\"`."
          },
          "type": {
            "type": "string",
            "enum": [
              "fieldGroup",
              "entityCollection"
            ],
            "description": "Controls the group's role in the layout. `fieldGroup` contains editable metadata fields organized into sections. `entityCollection` is a reserved group for linked entities (such as contributors or credits) and must not contain custom sections."
          },
          "hidden": {
            "type": "boolean",
            "description": "When `true`, the group is hidden in the editing UI. Only applies to `fieldGroup` groups. Cannot be set on `entityCollection` groups. The required origination group cannot be hidden."
          },
          "sections": {
            "type": "array",
            "description": "Ordered list of sections within this group. Each section contains an ordered list of fields. `entityCollection` groups must have an empty sections array.",
            "items": {
              "$ref": "#/components/schemas/RecordLayoutSection"
            }
          }
        }
      },
      "RecordLayoutAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordLayoutAttributes",
        "description": "Attributes of a record layout. `name` is the display name. `workType` specifies which work type this layout applies to. `groups` is the ordered hierarchy of groups → sections → fields that defines the editing UI structure.",
        "type": "object",
        "required": [
          "name",
          "workType",
          "groups"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "description": "Human-readable display name for this record layout. Example: `\"Movie Layout\"`, `\"Series Default Layout\"`."
          },
          "description": {
            "type": "string",
            "description": "Optional longer description of the record layout and its purpose."
          },
          "workType": {
            "$ref": "#/components/schemas/WorkTypes"
          },
          "groups": {
            "type": "array",
            "description": "Ordered list of groups that make up this layout. Each group corresponds to a tab or major panel in the record editing UI. The layout hierarchy is: groups → sections → fields.",
            "items": {
              "$ref": "#/components/schemas/RecordLayoutGroup"
            }
          }
        }
      },
      "RecordLayoutFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordLayoutFindManyResponse",
        "description": "Paginated response for listing record layouts in a tenant. Each item in `data` is a full layout resource with attributes (name, workType, groups), tenant relationship, and meta. The top-level `links` object contains a self link.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "type",
                "attributes",
                "relationships",
                "meta"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "recordLayouts"
                  ]
                },
                "attributes": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/BaseResourceAttributes"
                    },
                    {
                      "$ref": "#/components/schemas/RecordLayoutAttributes"
                    }
                  ]
                },
                "meta": {
                  "type": "object",
                  "properties": {
                    "tenantId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "tenantId"
                  ]
                },
                "links": {
                  "$ref": "#/components/schemas/LinksRelated"
                }
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "RecordLayoutCreateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordLayoutCreateOneRequest",
        "description": "Request body for creating a new record layout. The `data.attributes` must include `name`, `workType`, and the `groups` hierarchy that defines the layout structure.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "attributes"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "recordLayouts"
                ]
              },
              "attributes": {
                "$ref": "#/components/schemas/RecordLayoutAttributes"
              }
            }
          }
        }
      },
      "RecordLayoutFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordLayoutFindOneResponse",
        "description": "Response for retrieving a single record layout by ID. The `data` object contains the full layout resource including `name`, `workType`, and the `groups` hierarchy (groups → sections → field references) that defines the editing UI structure for the associated work type.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes",
              "meta"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "recordLayouts"
                ]
              },
              "attributes": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BaseResourceAttributes"
                  },
                  {
                    "$ref": "#/components/schemas/RecordLayoutAttributes"
                  }
                ]
              },
              "meta": {
                "type": "object",
                "properties": {
                  "tenantId": {
                    "type": "string"
                  }
                },
                "required": [
                  "tenantId"
                ]
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "RecordLayoutUpdateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordLayoutUpdateOneRequest",
        "description": "Request body for partially updating an existing record layout. Only the attributes provided are modified. Typically used to update the `name`, `description`, or the groups/sections/fields structure.",
        "type": "object",
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseResource"
              },
              {
                "required": [
                  "attributes"
                ],
                "additionalProperties": false,
                "properties": {
                  "attributes": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "groups": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "key",
                            "label",
                            "type",
                            "sections"
                          ],
                          "additionalProperties": false,
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "key": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "fieldGroup",
                                "entityCollection"
                              ]
                            },
                            "hidden": {
                              "type": "boolean"
                            },
                            "sections": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "id",
                                  "key",
                                  "label",
                                  "fields"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "key": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "hidden": {
                                    "type": "boolean"
                                  },
                                  "fields": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "required": [
                                        "id",
                                        "key"
                                      ],
                                      "additionalProperties": false,
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "key": {
                                          "type": "string"
                                        },
                                        "span": {
                                          "type": "number"
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            ]
          }
        }
      },
      "IGlobalMetadataOperator": {
        "type": "string",
        "enum": [
          "eq",
          "ne",
          "contains",
          "starts_with",
          "lt",
          "lte",
          "gt",
          "gte",
          "exists",
          "not_exists"
        ]
      },
      "IGlobalMetadataCondition": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "enum": [
              "tenantId",
              "parentId",
              "externalId",
              "provider",
              "status",
              "workType",
              "workStatus",
              "primaryTitle",
              "synopses.key",
              "synopses.value",
              "synopses.type",
              "synopses.attribution",
              "synopses.locale",
              "synopses.characterCount",
              "genres.key",
              "genres.value",
              "genres.locale",
              "keywords.key",
              "keywords.value",
              "keywords.locale",
              "tagline.key",
              "tagline.value",
              "tagline.locale",
              "runLength",
              "releaseYear",
              "altIdentifiers.key",
              "altIdentifiers.value",
              "countriesOfOrigin.key",
              "countriesOfOrigin.value",
              "primarySpokenLanguage",
              "ratings.key",
              "ratings.value",
              "ratings.authority",
              "ratings.reason",
              "releaseDate",
              "pictureColorType",
              "originalLanguage",
              "alternateReleaseDates.key",
              "alternateReleaseDates.value",
              "parentInfo.seasonNumber",
              "parentInfo.episodeNumber",
              "parentInfo.seasonId",
              "parentInfo.seriesId",
              "contributors.name",
              "contributors.id",
              "contributors.originNexusId",
              "contributors.imdbId",
              "contributors.job",
              "contributors.characters",
              "contributors.billingOrder",
              "originRating",
              "originMovieType"
            ]
          },
          "operator": {
            "$ref": "#/components/schemas/IGlobalMetadataOperator"
          },
          "value": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ]
          }
        },
        "required": [
          "field",
          "operator"
        ],
        "additionalProperties": false
      },
      "IGlobalMetadataQueryGroup": {
        "type": "object",
        "properties": {
          "operator": {
            "type": "string",
            "enum": [
              "AND",
              "OR",
              "NOT"
            ]
          },
          "conditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IGlobalMetadataCondition"
            }
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IGlobalMetadataQueryGroup"
            }
          }
        },
        "required": [
          "operator"
        ],
        "anyOf": [
          {
            "required": [
              "conditions"
            ]
          },
          {
            "required": [
              "groups"
            ]
          }
        ],
        "additionalProperties": false
      },
      "GlobalMetadataSearchRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IGlobalMetadataSearchRequest",
        "description": "Request body for searching global (cross-tenant, provider-sourced) metadata records. Supports the same boolean query group model as contributor search, with conditions targeting global record fields such as titles, genres, contributors, release dates, identifiers, and Origin-specific fields.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "searchQueries"
                ]
              },
              "attributes": {
                "type": "object",
                "properties": {
                  "group": {
                    "$ref": "#/components/schemas/IGlobalMetadataQueryGroup"
                  }
                },
                "required": [
                  "group"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "definitions": {
          "IGlobalMetadataOperator": {
            "type": "string",
            "enum": [
              "eq",
              "ne",
              "contains",
              "starts_with",
              "lt",
              "lte",
              "gt",
              "gte",
              "exists",
              "not_exists"
            ]
          },
          "IGlobalMetadataCondition": {
            "type": "object",
            "properties": {
              "field": {
                "type": "string",
                "enum": [
                  "tenantId",
                  "parentId",
                  "externalId",
                  "provider",
                  "status",
                  "workType",
                  "workStatus",
                  "primaryTitle",
                  "synopses.key",
                  "synopses.value",
                  "synopses.type",
                  "synopses.attribution",
                  "synopses.locale",
                  "synopses.characterCount",
                  "genres.key",
                  "genres.value",
                  "genres.locale",
                  "keywords.key",
                  "keywords.value",
                  "keywords.locale",
                  "tagline.key",
                  "tagline.value",
                  "tagline.locale",
                  "runLength",
                  "releaseYear",
                  "altIdentifiers.key",
                  "altIdentifiers.value",
                  "countriesOfOrigin.key",
                  "countriesOfOrigin.value",
                  "primarySpokenLanguage",
                  "ratings.key",
                  "ratings.value",
                  "ratings.authority",
                  "ratings.reason",
                  "releaseDate",
                  "pictureColorType",
                  "originalLanguage",
                  "alternateReleaseDates.key",
                  "alternateReleaseDates.value",
                  "parentInfo.seasonNumber",
                  "parentInfo.episodeNumber",
                  "parentInfo.seasonId",
                  "parentInfo.seriesId",
                  "contributors.name",
                  "contributors.id",
                  "contributors.originNexusId",
                  "contributors.imdbId",
                  "contributors.job",
                  "contributors.characters",
                  "contributors.billingOrder",
                  "originRating",
                  "originMovieType"
                ]
              },
              "operator": {
                "$ref": "#/components/schemas/IGlobalMetadataOperator"
              },
              "value": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  }
                ]
              }
            },
            "required": [
              "field",
              "operator"
            ],
            "additionalProperties": false
          },
          "IGlobalMetadataQueryGroup": {
            "type": "object",
            "properties": {
              "operator": {
                "type": "string",
                "enum": [
                  "AND",
                  "OR",
                  "NOT"
                ]
              },
              "conditions": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/IGlobalMetadataCondition"
                }
              },
              "groups": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/IGlobalMetadataQueryGroup"
                }
              }
            },
            "required": [
              "operator"
            ],
            "anyOf": [
              {
                "required": [
                  "conditions"
                ]
              },
              {
                "required": [
                  "groups"
                ]
              }
            ],
            "additionalProperties": false
          }
        }
      },
      "GlobalImage": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IGlobalImage",
        "description": "An image asset associated with a global metadata record. Contains a provider-assigned key, the image URL or identifier as value, optional dimension metadata (width, height), content rating scores (violence, sexuality), locale, image type, and a flag indicating whether this is an official image from the provider.",
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "imageType": {
            "type": "string"
          },
          "height": {
            "type": "integer"
          },
          "width": {
            "type": "integer"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "violence": {
            "type": "integer"
          },
          "sexuality": {
            "type": "integer"
          },
          "official": {
            "type": "boolean"
          },
          "locale": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "value"
        ],
        "additionalProperties": false
      },
      "GlobalRecordContributor": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IGlobalRecordContributor",
        "description": "A contributor credit embedded within a global metadata record. Represents a person's involvement in a work (e.g. actor, director), identified by a provider-assigned key and optionally by contributor ID, Origin Nexus ID, or IMDb ID. Includes role (job), character names, and billing order.",
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "originNexusId": {
            "type": "string"
          },
          "imdbId": {
            "type": "string"
          },
          "job": {
            "type": "string"
          },
          "characters": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "billingOrder": {
            "type": "integer"
          }
        },
        "required": [
          "key",
          "name",
          "job"
        ],
        "additionalProperties": false
      },
      "GlobalBaseRecord": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IGlobalBaseRecord",
        "description": "Base schema shared by all global metadata records ingested from external providers (currently Origin). Captures the canonical entertainment metadata fields including titles, synopses, genres, ratings, release information, identifiers, images, and contributor credits. Extended by provider-specific record types such as IGlobalOriginRecord.",
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "provider": {
            "type": "string",
            "enum": [
              "OriginNexus",
              "IMDB",
              "EIDR"
            ]
          },
          "parentId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "DELETED"
            ]
          },
          "workType": {
            "$ref": "#/components/schemas/WorkTypes"
          },
          "workStatus": {
            "type": "string"
          },
          "primaryTitle": {
            "type": "string"
          },
          "titles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "locale": {
                  "type": "string"
                },
                "country": {
                  "type": "string"
                }
              },
              "required": [
                "key",
                "value"
              ],
              "additionalProperties": false
            }
          },
          "synopses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "attribution": {
                  "type": "string"
                },
                "locale": {
                  "type": "string"
                },
                "characterCount": {
                  "type": "integer"
                }
              },
              "required": [
                "key",
                "value",
                "locale"
              ],
              "additionalProperties": false
            }
          },
          "genres": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "locale": {
                  "type": "string"
                }
              },
              "required": [
                "key",
                "value",
                "locale"
              ],
              "additionalProperties": false
            }
          },
          "runLength": {
            "type": "integer",
            "description": "Total run length in **seconds**. Providers that publish minutes (Origin, IMDB, Gracenote) or an ISO duration (EIDR) are converted on ingest — a 30-minute episode is 1800, not 30."
          },
          "releaseYear": {
            "type": "integer"
          },
          "altIdentifiers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              },
              "required": [
                "key",
                "value"
              ],
              "additionalProperties": false
            }
          },
          "alternateReleaseDates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "locale": {
                  "type": "string"
                },
                "country": {
                  "type": "string"
                }
              },
              "required": [
                "key",
                "value"
              ],
              "additionalProperties": false
            }
          },
          "countriesOfOrigin": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              },
              "required": [
                "key",
                "value"
              ],
              "additionalProperties": false
            }
          },
          "associatedOrganizations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                }
              },
              "required": [
                "key",
                "value"
              ],
              "additionalProperties": false
            }
          },
          "ratings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "authority": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                }
              },
              "required": [
                "key",
                "value"
              ],
              "additionalProperties": false
            }
          },
          "releaseDate": {
            "type": "string",
            "format": "date-time"
          },
          "originalLanguage": {
            "type": "string"
          },
          "primarySpokenLanguage": {
            "type": "string"
          },
          "coverImage": {
            "$ref": "#/components/schemas/GlobalImage"
          },
          "images": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GlobalImage"
            }
          },
          "parentInfo": {
            "type": "object",
            "properties": {
              "seasonNumber": {
                "type": "integer"
              },
              "episodeNumber": {
                "type": "integer"
              },
              "seasonId": {
                "type": "string"
              },
              "seriesId": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "contributors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GlobalRecordContributor"
            }
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "updated": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "externalId",
          "workType",
          "primaryTitle"
        ],
        "additionalProperties": false
      },
      "GlobalOriginRecord": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IGlobalOriginRecord",
        "description": "A global metadata record sourced from the Origin provider. Extends IGlobalBaseRecord with Origin-specific fields: a normalized popularity rating (`originRating`), a movie type classification (`originMovieType`), IDs of any collection groups the record belongs to (`originCollectionIds`), program-level subject tags (`originTags`), and structured micro-genre classifications (`originMicroGenres`).",
        "allOf": [
          {
            "$ref": "#/components/schemas/GlobalBaseRecord"
          },
          {
            "type": "object",
            "properties": {
              "originRating": {
                "type": "integer"
              },
              "originMovieType": {
                "type": "string"
              },
              "originCollectionIds": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "originTags": {
                "type": "array",
                "description": "Program-level subject tags sourced from the Origin `Tags` payload (short human-readable phrases, e.g. \"space travel\", \"father daughter relationship\"). Distinct from `images[].tags` which describes image content.",
                "items": {
                  "type": "string"
                }
              },
              "originMicroGenres": {
                "type": "array",
                "description": "Structured micro-genre classifications sourced from the Origin `MicroGenres` payload. Each entry has a label and attribution; WikiData-attributed entries additionally carry a `sourceId` (Q-id) and `aliases`. Wikipedia-attributed entries may have neither.",
                "items": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "sourceId": {
                      "type": "string"
                    },
                    "attribution": {
                      "type": "string"
                    },
                    "aliases": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "label",
                    "attribution"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "GlobalMetadataSearchResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IGlobalMetadataSearchResponse",
        "description": "Response returned by the global metadata search endpoint. Contains a paginated array of JSON:API resources, each representing an Origin global record. The `meta` object provides pagination context (total, page, perPage, start, limit).",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "attributes": {
                  "$ref": "#/components/schemas/GlobalOriginRecord"
                }
              },
              "required": [
                "id",
                "type",
                "attributes"
              ],
              "additionalProperties": false
            }
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "string"
              },
              "next": {
                "type": "string"
              },
              "prev": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "meta": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "page": {
                "type": "integer"
              },
              "perPage": {
                "type": "integer"
              },
              "start": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "GlobalImdbRecord": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IGlobalImdbRecord",
        "description": "A global metadata record sourced from IMDb. Extends the shared base record with IMDb-specific fields such as public rating, taglines, keywords, filming locations, and a link to the title on imdb.com. Use GET /global/imdb/{id} with an IMDb title ID (for example `tt0816692`).",
        "allOf": [
          {
            "$ref": "#/components/schemas/GlobalBaseRecord"
          },
          {
            "type": "object",
            "properties": {
              "keywords": {
                "description": "Subject keywords associated with the title, each with a stable key, display value, and locale.",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    },
                    "locale": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "key",
                    "value",
                    "locale"
                  ],
                  "additionalProperties": false
                }
              },
              "tagline": {
                "description": "Marketing taglines for the title, localized when available.",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    },
                    "locale": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "key",
                    "value",
                    "locale"
                  ],
                  "additionalProperties": false
                }
              },
              "pictureColorType": {
                "description": "Color presentation of the title (for example Color or Black and White) when provided by IMDb.",
                "type": "string"
              },
              "imdbUrl": {
                "description": "Canonical IMDb web URL for this title.",
                "type": "string",
                "example": "https://www.imdb.com/title/tt0816692/"
              },
              "isAdult": {
                "description": "Whether IMDb classifies the title as adult-oriented content.",
                "type": "boolean"
              },
              "imdbRating": {
                "description": "Aggregate user rating from IMDb, including vote count.",
                "type": "object",
                "properties": {
                  "rating": {
                    "description": "Average rating on the IMDb scale (typically 1–10).",
                    "type": "number",
                    "example": 8.7
                  },
                  "numberOfVotes": {
                    "description": "Total number of user votes contributing to the rating.",
                    "type": "number",
                    "example": 2200000
                  }
                },
                "additionalProperties": false
              },
              "locations": {
                "description": "Filming locations and related scene notes when available from IMDb.",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "place": {
                      "description": "Named filming location.",
                      "type": "string"
                    },
                    "scenes": {
                      "description": "Scene descriptions linked to this location.",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "GlobalMetadataGetImdbResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IGlobalMetadataGetImdbResponse",
        "description": "JSON:API response wrapper for retrieving a single global record from IMDb by its IMDb title ID. The `data.attributes` object contains the full IGlobalImdbRecord payload, including IMDb-specific rating and location fields.",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "description": "Internal Origin Studio resource ID for this global metadata record.",
                "type": "string"
              },
              "type": {
                "description": "JSON:API resource type for global metadata records.",
                "type": "string"
              },
              "attributes": {
                "$ref": "#/components/schemas/GlobalImdbRecord"
              }
            },
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false
          },
          "links": {
            "description": "Hypermedia links for the retrieved resource.",
            "type": "object",
            "properties": {
              "self": {
                "description": "URL of this resource.",
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "data",
          "links"
        ],
        "additionalProperties": false
      },
      "GlobalEidrRecord": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IGlobalEIDRRecord",
        "description": "A global metadata record sourced from the Entertainment Identifier Registry (EIDR). Uses the shared base record fields only—EIDR does not add provider-specific extensions beyond standard titles, identifiers, credits, and release data. Use GET /global/eidr/{id} with a full EIDR ID (for example `10.5240/5BC6-2FA3-4F64-B17E-0B7D-H`).",
        "allOf": [
          {
            "$ref": "#/components/schemas/GlobalBaseRecord"
          }
        ]
      },
      "GlobalMetadataGetEidrResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IGlobalMetadataGetEidrResponse",
        "description": "JSON:API response wrapper for retrieving a single global record from EIDR by its registry ID. The `data.attributes` object contains IGlobalEidrRecord fields (shared base schema only). Alternate identifiers on the record may include cross-references such as IMDb IDs.",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "description": "Internal Origin Studio resource ID for this global metadata record.",
                "type": "string"
              },
              "type": {
                "description": "JSON:API resource type for global metadata records.",
                "type": "string"
              },
              "attributes": {
                "$ref": "#/components/schemas/GlobalEidrRecord"
              }
            },
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false
          },
          "links": {
            "description": "Hypermedia links for the retrieved resource.",
            "type": "object",
            "properties": {
              "self": {
                "description": "URL of this resource.",
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "data",
          "links"
        ],
        "additionalProperties": false
      },
      "GlobalGracenoteRecord": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IGlobalGracenoteRecord",
        "description": "A global metadata record sourced from a tenant's own licensed Gracenote entitlement. Uses the shared base record fields only. Unlike Origin/IMDb/EIDR, this data is per-tenant, not shared — a lookup only ever returns the calling tenant's own cached copy. Use GET /global/gracenote/{id} with a Gracenote TMSId.",
        "allOf": [
          {
            "$ref": "#/components/schemas/GlobalBaseRecord"
          }
        ]
      },
      "GlobalMetadataGetGracenoteResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IGlobalMetadataGetGracenoteResponse",
        "description": "JSON:API response wrapper for retrieving a single global record from the caller's tenant's own licensed Gracenote cache by its TMSId. The `data.attributes` object contains IGlobalGracenoteRecord fields (shared base schema only).",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "description": "Internal Origin Studio resource ID for this global metadata record.",
                "type": "string"
              },
              "type": {
                "description": "JSON:API resource type for global metadata records.",
                "type": "string"
              },
              "attributes": {
                "$ref": "#/components/schemas/GlobalGracenoteRecord"
              }
            },
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false
          },
          "links": {
            "description": "Hypermedia links for the retrieved resource.",
            "type": "object",
            "properties": {
              "self": {
                "description": "URL of this resource.",
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "data",
          "links"
        ],
        "additionalProperties": false
      },
      "GlobalMetadataGetOriginResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IGlobalMetadataGetOriginResponse",
        "description": "JSON:API response wrapper for retrieving a single global record directly from the Origin provider by its provider-assigned ID. The `data` object contains the full IGlobalOriginRecord attributes including Origin-specific fields (originRating, originMovieType, originCollectionIds).",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "attributes": {
                "$ref": "#/components/schemas/GlobalOriginRecord"
              }
            },
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "data",
          "links"
        ],
        "additionalProperties": false
      },
      "LicensedMetadataFeedHealth": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ILicensedMetadataFeedHealth",
        "description": "Steady-state health of one licensed-metadata feed's polling. Present once the feed has been polled at least once.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "ok",
              "unauthorized",
              "error"
            ],
            "description": "Outcome of the most recent poll. 'pending' means the feed is scheduled but hasn't completed a poll yet; 'ok' succeeded; 'unauthorized' means the provider rejected the API key — rotate it via PATCH; 'error' is any other failure."
          },
          "lastPolledAt": {
            "type": "string",
            "description": "ISO timestamp of the most recent poll attempt, whatever its outcome."
          },
          "lastSuccessAt": {
            "type": "string",
            "description": "ISO timestamp of the most recent successful poll. A stale value here while status is not 'ok' means ingestion is currently broken."
          },
          "nextPollAt": {
            "type": "string",
            "description": "Estimated ISO timestamp of the next poll — lastPolledAt plus this feed's configured interval. An estimate: the actual schedule fires on a fixed cadence, so a change to the interval only takes effect from the next tick."
          },
          "caughtUp": {
            "type": "boolean",
            "description": "Whether the feed had no further pending updates as of the last successful poll."
          },
          "stalled": {
            "type": "boolean",
            "description": "Present and true when the feed is overdue — the current time is well past nextPollAt, meaning the scheduler appears to have stopped firing rather than the feed being merely idle. A stalled feed's status/message reflect its last known outcome, which may look healthy; treat stalled as a distinct 'polling has silently stopped' signal. Absent when the feed is polling on schedule."
          },
          "behindBy": {
            "type": "integer",
            "description": "Approximate number of update-stream positions still pending as of the last successful poll (0 when caught up)."
          },
          "message": {
            "type": "string",
            "description": "Human-readable detail, present for non-ok statuses — what went wrong and what to do about it."
          }
        }
      },
      "LicensedMetadataConfigAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ILicensedMetadataConfigAttributes",
        "description": "Per-tenant licensed metadata provider config (read-only view). Existence of the resource means the provider is enabled for this tenant; delete disables it. Shows which provider is configured and whether an API key is stored — the raw key is never returned, only a partial preview.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider",
          "apiKeyConfigured",
          "programsPollingIntervalMinutes",
          "taxonomyPollingInterval",
          "seedingStatus"
        ],
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "gracenote"
            ],
            "description": "The licensed metadata provider this config enables for the tenant."
          },
          "apiKeyConfigured": {
            "type": "boolean",
            "description": "Whether an API key has been securely stored for this provider."
          },
          "apiKeyPreview": {
            "type": "string",
            "description": "First 2 and last 2 characters of the stored API key (e.g. \"gc••••9a\"), for display only. Never enough to reconstruct the key. Absent until an API key has been stored at least once."
          },
          "programsPollingIntervalMinutes": {
            "type": "integer",
            "enum": [
              15,
              30,
              45,
              60
            ],
            "description": "How often program updates are checked for once caught up on the initial seed."
          },
          "taxonomyPollingInterval": {
            "type": "string",
            "enum": [
              "daily",
              "weekly"
            ],
            "description": "How often the provider's reference taxonomy is checked for changes."
          },
          "pollingPaused": {
            "type": "boolean",
            "description": "True when the tenant has paused steady-state polling. While paused, both feeds' schedules are disabled and a steady-state drain already in flight stops at its next page, so no further provider API quota is spent on polling. An initial seed job already running is NOT stopped and will finish its crawl. Cursors, cached data and the configured cadence are all retained — resuming continues from where polling stopped rather than re-crawling. Absent means not paused."
          },
          "seedingStatus": {
            "type": "string",
            "enum": [
              "not_started",
              "seeding",
              "finished",
              "failed"
            ],
            "description": "Status of the initial data seed. Ongoing polling only starts once this reaches 'finished'."
          },
          "seedingError": {
            "type": "string",
            "description": "Customer-safe reason the initial seed failed. Present only when seedingStatus is 'failed'."
          },
          "seedingStartedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the most recent initial seed was launched. Recorded on this resource rather than read back from the seed's background-job row, because those rows are deleted by a 7-day TTL while this timestamp has to stay visible for the life of the integration. Absent until a seed has been launched at least once."
          },
          "seedingFinishedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the most recent initial seed reached a terminal state, whether it succeeded or failed. Absent while a seed is running, and for seeds launched before this field existed."
          },
          "polling": {
            "type": "object",
            "additionalProperties": false,
            "description": "Steady-state polling health per feed, so a tenant can tell whether ongoing ingestion is working after the initial seed finishes. A feed key is absent until that feed has been polled at least once.",
            "properties": {
              "programs": {
                "$ref": "#/components/schemas/LicensedMetadataFeedHealth"
              },
              "taxonomy": {
                "$ref": "#/components/schemas/LicensedMetadataFeedHealth"
              }
            }
          },
          "sandbox": {
            "type": "boolean",
            "description": "True when this config is using the Fabric sandbox API key, so its cached records are synthetic test data rather than licensed Gracenote content. Sandbox titles also carry a TMSId prefix Gracenote never issues (ZZ...), so they stay identifiable outside this response. Read-only — derived from the key, not settable."
          }
        }
      },
      "LicensedMetadataConfigFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ILicensedMetadataConfigFindManyResponse",
        "description": "The response for a licensed metadata configs find many request.",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/BaseResource"
                },
                {
                  "type": "object",
                  "properties": {
                    "attributes": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/BaseResourceAttributes"
                        },
                        {
                          "$ref": "#/components/schemas/LicensedMetadataConfigAttributes"
                        }
                      ]
                    },
                    "meta": {
                      "type": "object",
                      "description": "Non-attribute reference info. seedJobId isn't a JSON:API relationship because there's no dedicated backgroundJobs relationship endpoint here — check its status via GET /backgroundJobs/{jobId}.",
                      "properties": {
                        "seedJobId": {
                          "type": "string",
                          "description": "ID of the background job that ran (or is running) the initial seed, if one has been started."
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "attributes"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "CreateLicensedMetadataConfigAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreateLicensedMetadataConfigAttributes",
        "description": "Attributes for enabling a licensed metadata provider for a tenant. The tenant's own provider API key is required — Fabric never shares a key across tenants.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider",
          "programsPollingIntervalMinutes",
          "taxonomyPollingInterval"
        ],
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "gracenote"
            ],
            "description": "The licensed metadata provider to enable."
          },
          "apiKey": {
            "type": "string",
            "description": "Write-only. The tenant's own provider API key. Stored securely (per-tenant secret) and never returned in responses. Required unless apiKeyArn is provided."
          },
          "apiKeyArn": {
            "type": "string",
            "description": "Reference to a previously stored API key. Use this instead of apiKey if the key is already registered."
          },
          "programsPollingIntervalMinutes": {
            "type": "integer",
            "enum": [
              15,
              30,
              45,
              60
            ],
            "description": "How often to check for new program updates once caught up on the initial seed. This calls the provider's API using the tenant's own entitlement, so the tenant chooses the tradeoff between freshness and their own API quota usage — there is no default."
          },
          "taxonomyPollingInterval": {
            "type": "string",
            "enum": [
              "daily",
              "weekly"
            ],
            "description": "How often to check for changes to the provider's reference taxonomy (a small, rarely-changing dataset). Also drawn from the tenant's own API quota — there is no default."
          }
        }
      },
      "CreateLicensedMetadataConfigRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreateLicensedMetadataConfigRequest",
        "description": "The request to enable a licensed metadata provider for a tenant. A tenant may only have one config per provider.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "attributes"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "licensedMetadataConfigs"
                ]
              },
              "attributes": {
                "$ref": "#/components/schemas/CreateLicensedMetadataConfigAttributes"
              }
            }
          }
        }
      },
      "LicensedMetadataConfigCreateOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "title": "ILicensedMetadataConfigCreateOneResponse",
        "description": "Response after enabling a licensed metadata provider for a tenant. Contains the new resource and self link.",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseResource"
              },
              {
                "type": "object",
                "properties": {
                  "attributes": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/BaseResourceAttributes"
                      },
                      {
                        "$ref": "#/components/schemas/LicensedMetadataConfigAttributes"
                      }
                    ]
                  },
                  "meta": {
                    "type": "object",
                    "description": "Non-attribute reference info. seedJobId isn't a JSON:API relationship because there's no dedicated backgroundJobs relationship endpoint here — check its status via GET /backgroundJobs/{jobId}.",
                    "properties": {
                      "seedJobId": {
                        "type": "string",
                        "description": "ID of the background job that ran (or is running) the initial seed, if one has been started."
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "attributes"
                ],
                "additionalProperties": false
              }
            ]
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "required": [
              "self"
            ],
            "additionalProperties": false
          }
        }
      },
      "UpdateLicensedMetadataConfigAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IUpdateLicensedMetadataConfigAttributes",
        "description": "Attributes for updating an existing licensed metadata provider config. Every attribute is optional — supply only what you want to change. The provider itself is immutable and cannot be changed here.",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "apiKey": {
            "type": "string",
            "description": "Write-only. A new provider API key to rotate to. Stored securely (per-tenant secret, overwriting the previous value) and never returned in responses. Rotating the key does not tear down the existing cache."
          },
          "apiKeyArn": {
            "type": "string",
            "description": "Reference to a previously stored API key to point at instead. Mutually exclusive with apiKey."
          },
          "programsPollingIntervalMinutes": {
            "type": "integer",
            "enum": [
              15,
              30,
              45,
              60
            ],
            "description": "How often to check for new program updates once caught up on the initial seed."
          },
          "taxonomyPollingInterval": {
            "type": "string",
            "enum": [
              "daily",
              "weekly"
            ],
            "description": "How often to check for changes to the provider's reference taxonomy."
          },
          "pollingPaused": {
            "type": "boolean",
            "description": "Set true to pause steady-state polling, false to resume. Pausing disables both feeds' schedules and stops a steady-state drain already in flight at its next page; an initial seed job already running is not affected and will finish. Nothing is deleted — cursors, cached data and the configured cadence are retained, so resuming continues from where polling stopped. Changing the cadence while paused keeps it paused."
          }
        }
      },
      "UpdateLicensedMetadataConfigRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IUpdateLicensedMetadataConfigRequest",
        "description": "The request to update an existing licensed metadata provider config (e.g. rotate the API key). The config is identified by the path parameter; the body carries only the attributes to change.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "attributes"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "licensedMetadataConfigs"
                ]
              },
              "attributes": {
                "$ref": "#/components/schemas/UpdateLicensedMetadataConfigAttributes"
              }
            }
          }
        }
      },
      "MediaStorageFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IMediaStorageFindOneResponse",
        "description": "Returns the media storage information for a tenant",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "mediaStorage"
                ]
              },
              "attributes": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "committedBytes",
                  "limitBytes"
                ],
                "properties": {
                  "committedBytes": {
                    "type": "integer",
                    "description": "The number of bytes currently committed/used by the tenant"
                  },
                  "limitBytes": {
                    "type": "integer",
                    "description": "The maximum number of bytes allowed for the tenant"
                  },
                  "availableBytes": {
                    "type": "integer",
                    "description": "The number of bytes available for the tenant (limitBytes - committedBytes)"
                  },
                  "created": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "updated": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              }
            }
          },
          "links": {
            "$ref": "#/components/schemas/LinksSelf"
          }
        }
      },
      "MediaAttributeMediaType": {
        "$id": "media_attribute_media_type",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IMediaAttributeMediaType",
        "description": "High-level media category. `image` is a raster image (JPEG, PNG, etc.). `file` is a document or other non-image file (PDF, Office document, CSV). `archive` is a compressed collection of files.",
        "type": "string",
        "enum": [
          "image",
          "file",
          "archive"
        ]
      },
      "MediaAttributeMimeType": {
        "$id": "media_attribute_mime_type",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IMediaAttributeMimeType",
        "description": "MIME type of the uploaded file. Only types in this enum are accepted by the platform. Supported formats include common image formats (JPEG, PNG, GIF, WebP, TIFF, AVIF, PSD), PDF, illustration and design formats (AI, INDD), and Office/spreadsheet documents.",
        "type": "string",
        "enum": [
          "image/jpeg",
          "image/png",
          "image/vnd.adobe.photoshop",
          "image/gif",
          "image/avif",
          "image/webp",
          "image/tiff",
          "application/pdf",
          "text/csv",
          "application/illustrator",
          "application/x-indesign",
          "application/msword",
          "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
          "application/vnd.ms-excel",
          "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
        ]
      },
      "MediaAttributeImageType": {
        "$id": "media_attribute_image_type",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IMediaAttributeImageType",
        "description": "Editorial classification for an image asset associated with a record. Used to distinguish between general photos, talent portraits, theatrical marketing posters, and tile/thumbnail formats.",
        "type": "string",
        "enum": [
          "Photo",
          "Portrait",
          "Poster",
          "Theatrical Poster",
          "Tile"
        ]
      },
      "MediaAttributeSource": {
        "$id": "media_attribute_source",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IMediaAttributeSource",
        "description": "Origin of a media file. `UserUpload` means the file was uploaded directly by a tenant user. `OriginImport` means the file was imported from the Origin metadata provider during a data sync.",
        "type": "string",
        "enum": [
          "UserUpload",
          "OriginImport"
        ]
      },
      "MediaAttributes": {
        "$id": "media_attributes",
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IMediaAttributes",
        "description": "Attributes of a media file attached to a record. Covers file identity (`fileName`, `originalFileName`, `fileExtension`, `fileSize`, `fileUrl`), content classification (`mediaType`, `mimeType`), image-specific metadata (`imageType`, `imageWidth`, `imageHeight`), and tags for organization. `source` distinguishes user-uploaded files from those imported from Origin.",
        "type": "object",
        "required": [
          "mimeType",
          "fileName",
          "originalFileName"
        ],
        "additionalProperties": false,
        "properties": {
          "mediaType": {
            "$ref": "#/components/schemas/MediaAttributeMediaType"
          },
          "mimeType": {
            "$ref": "#/components/schemas/MediaAttributeMimeType"
          },
          "originalFileName": {
            "type": "string",
            "minLength": 1
          },
          "fileName": {
            "type": "string",
            "minLength": 1
          },
          "fileExtension": {
            "type": "string",
            "minLength": 1
          },
          "fileSize": {
            "type": "number",
            "minimum": 0
          },
          "fileUrl": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "imageType": {
            "$ref": "#/components/schemas/MediaAttributeImageType"
          },
          "imageWidth": {
            "type": "number",
            "minimum": 0
          },
          "imageHeight": {
            "type": "number",
            "minimum": 0
          },
          "source": {
            "$ref": "#/components/schemas/MediaAttributeSource"
          }
        }
      },
      "RecordRelationship": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordRelationship",
        "description": "A relationship to a record",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "records"
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          "meta": {
            "type": "object",
            "properties": {
              "primaryTitle": {
                "type": "string"
              }
            }
          },
          "links": {
            "$ref": "#/components/schemas/LinksRelated"
          }
        },
        "required": [
          "data"
        ]
      },
      "MediaRelationships": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IMediaRelationships",
        "description": "JSON:API relationship links for a media resource. Contains relationships to both the owning tenant and the record this media file is attached to.",
        "type": "object",
        "properties": {
          "tenant": {
            "$ref": "#/components/schemas/TenantRelationship"
          },
          "record": {
            "$ref": "#/components/schemas/RecordRelationship"
          }
        },
        "required": [
          "tenant",
          "record"
        ],
        "additionalProperties": false
      },
      "MediaFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IMediaFindManyResponse",
        "description": "Returns the media for a given record. You have to filter by mediaType",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta",
          "links"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "type",
                "attributes",
                "relationships",
                "meta"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "media"
                  ]
                },
                "attributes": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/BaseResourceAttributes"
                    },
                    {
                      "$ref": "#/components/schemas/MediaAttributes"
                    }
                  ]
                },
                "relationships": {
                  "$ref": "#/components/schemas/MediaRelationships"
                },
                "links": {
                  "$ref": "#/components/schemas/LinksRelated"
                }
              }
            }
          },
          "meta": {
            "type": "object",
            "required": [
              "filters",
              "expiresAt"
            ],
            "properties": {
              "filters": {
                "type": "object",
                "required": [
                  "mediaType"
                ],
                "properties": {
                  "mediaType": {
                    "$ref": "#/components/schemas/MediaAttributeMediaType"
                  },
                  "imageType": {
                    "$ref": "#/components/schemas/MediaAttributeImageType"
                  }
                },
                "additionalProperties": false
              },
              "expiresAt": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "links": {
            "$ref": "#/components/schemas/LinksSelf"
          }
        }
      },
      "MediaArchiveRelationships": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IMediaArchiveRelationships",
        "description": "Relationships for a media archive operation. Contains the list of media resource IDs that should be included in the archive.",
        "type": "object",
        "properties": {
          "media": {
            "type": "object",
            "required": [
              "data"
            ],
            "additionalProperties": false,
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "media"
                      ]
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "required": [
          "media"
        ],
        "additionalProperties": false
      },
      "MediaArchiveManyRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IMediaArchiveManyRequest",
        "description": "Request body for archiving multiple media files in a single operation. Specifies the media resource IDs to be archived via the `relationships.media` linkage array. Archived media are soft-deleted and no longer accessible via normal media endpoints.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "archives"
                ]
              },
              "relationships": {
                "$ref": "#/components/schemas/MediaArchiveRelationships"
              }
            }
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "MediaArchiveManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IMediaArchiveManyResponse",
        "description": "The response for a media download many zip request.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "type",
              "id",
              "attributes",
              "relationships"
            ],
            "additionalProperties": false,
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "archives"
                ]
              },
              "id": {
                "type": "string"
              },
              "attributes": {
                "type": "object",
                "required": [
                  "url",
                  "expiresAt"
                ],
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "expiresAt": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              },
              "relationships": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/MediaRelationships"
                  },
                  {
                    "$ref": "#/components/schemas/MediaArchiveRelationships"
                  }
                ]
              }
            }
          }
        }
      },
      "dataObjectMediaAdd": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "media"
            ]
          },
          "attributes": {
            "type": "object",
            "required": [
              "originalFileName"
            ],
            "additionalProperties": false,
            "properties": {
              "languages": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "imageType": {
                "type": "string",
                "enum": [
                  "Photo",
                  "Portrait",
                  "Poster",
                  "Theatrical Poster",
                  "Tile"
                ]
              },
              "originalFileName": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "type",
          "attributes"
        ],
        "additionalProperties": false
      },
      "updateRefObjectMedia": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "media"
            ]
          }
        },
        "required": [
          "id",
          "type"
        ],
        "additionalProperties": false
      },
      "dataObjectMediaUpdate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "media"
            ]
          },
          "attributes": {
            "type": "object",
            "required": [],
            "additionalProperties": false,
            "properties": {
              "languages": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "imageType": {
                "type": "string",
                "enum": [
                  "Photo",
                  "Portrait",
                  "Poster",
                  "Theatrical Poster",
                  "Tile"
                ]
              },
              "fileName": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "type",
          "attributes"
        ],
        "additionalProperties": false
      },
      "removeRefObjectMedia": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "media"
            ]
          }
        },
        "required": [
          "id",
          "type"
        ],
        "additionalProperties": false
      },
      "MediaAtomicOperationsRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IMediaAtomicOperationsRequest",
        "description": "JSON:API Atomic Operations request for managing media attached to a record. Supports `add` (register a new media file for upload), `update` (modify metadata of an existing media file), and `remove` (delete a media file) operations in a single request. Operations are applied sequentially.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "atomic:operations": {
            "type": "array",
            "items": {
              "type": "object",
              "oneOf": [
                {
                  "properties": {
                    "op": {
                      "const": "add"
                    },
                    "data": {
                      "$ref": "#/components/schemas/dataObjectMediaAdd"
                    }
                  },
                  "required": [
                    "op",
                    "data"
                  ],
                  "additionalProperties": false
                },
                {
                  "properties": {
                    "op": {
                      "const": "update"
                    },
                    "ref": {
                      "$ref": "#/components/schemas/updateRefObjectMedia"
                    },
                    "data": {
                      "$ref": "#/components/schemas/dataObjectMediaUpdate"
                    }
                  },
                  "required": [
                    "op",
                    "data"
                  ],
                  "additionalProperties": false
                },
                {
                  "properties": {
                    "op": {
                      "const": "remove"
                    },
                    "ref": {
                      "$ref": "#/components/schemas/removeRefObjectMedia"
                    }
                  },
                  "required": [
                    "op",
                    "ref"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          }
        },
        "required": [
          "atomic:operations"
        ],
        "additionalProperties": false,
        "definitions": {
          "dataObjectMediaAdd": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "media"
                ]
              },
              "attributes": {
                "type": "object",
                "required": [
                  "originalFileName"
                ],
                "additionalProperties": false,
                "properties": {
                  "languages": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "imageType": {
                    "type": "string",
                    "enum": [
                      "Photo",
                      "Portrait",
                      "Poster",
                      "Theatrical Poster",
                      "Tile"
                    ]
                  },
                  "originalFileName": {
                    "type": "string"
                  }
                }
              }
            },
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false
          },
          "dataObjectMediaUpdate": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "media"
                ]
              },
              "attributes": {
                "type": "object",
                "required": [],
                "additionalProperties": false,
                "properties": {
                  "languages": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "imageType": {
                    "type": "string",
                    "enum": [
                      "Photo",
                      "Portrait",
                      "Poster",
                      "Theatrical Poster",
                      "Tile"
                    ]
                  },
                  "fileName": {
                    "type": "string"
                  }
                }
              }
            },
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false
          },
          "updateRefObjectMedia": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "media"
                ]
              }
            },
            "required": [
              "id",
              "type"
            ],
            "additionalProperties": false
          },
          "removeRefObjectMedia": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "media"
                ]
              }
            },
            "required": [
              "id",
              "type"
            ],
            "additionalProperties": false
          }
        }
      },
      "MediaAtomicOperationsResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IMediaAtomicOperationsResponse",
        "description": "Response to a media atomic operations request. Each result in `atomic:results` corresponds to one operation. For `add` operations, the result includes a pre-signed S3 upload URL (`fileUrl`) and its expiration time — the client must upload the file bytes to this URL directly before the URL expires.",
        "type": "object",
        "properties": {
          "atomic:results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "uploads"
                    },
                    "id": {
                      "type": "string"
                    },
                    "attributes": {
                      "type": "object",
                      "properties": {
                        "originalFileName": {
                          "type": "string"
                        },
                        "fileUrl": {
                          "type": "string"
                        },
                        "expiresAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "originalFileName",
                        "fileUrl",
                        "expiresAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "type",
                    "id",
                    "attributes"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "data"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "atomic:results"
        ],
        "additionalProperties": true
      },
      "RecordMetadataAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordMetadataAttributes",
        "description": "Dynamic map of custom field values stored on a record. Each key corresponds to a field's `key` identifier, and the value can be a string, number, boolean, object, or array depending on the field's schema. This open-ended schema accommodates the tenant-configurable field system.",
        "type": "object",
        "patternProperties": {
          "^.*$": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number",
                "nullable": true
              },
              {
                "type": "boolean",
                "nullable": true
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "nullable": true
              },
              {
                "type": "object",
                "minProperties": 1,
                "patternProperties": {
                  "^.*$": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            ]
          }
        },
        "properties": {
          "primaryTitle": {
            "type": "string"
          },
          "workType": {
            "$ref": "#/components/schemas/WorkTypes"
          },
          "workTypeDetail": {
            "type": "string"
          },
          "lifecycleStatus": {
            "type": "string",
            "description": "The current lifecycle status (e.g., draft, in-review, published)"
          },
          "lifecyclePhase": {
            "type": "string",
            "enum": [
              "drafting",
              "published"
            ],
            "description": "The lifecycle phase used for authorization"
          },
          "sequenceNumber": {
            "type": "integer",
            "minimum": 1
          },
          "genres": {
            "type": "object",
            "minProperties": 1,
            "patternProperties": {
              "^.*$": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": false
          },
          "runLength": {
            "type": "number"
          },
          "releaseYear": {
            "type": "number"
          },
          "releaseDate": {
            "type": "string"
          },
          "countriesOfOrigin": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primarySpokenLanguage": {
            "type": "string"
          },
          "originNexusId": {
            "type": "string"
          },
          "eidrId": {
            "type": "string"
          },
          "imdbId": {
            "type": "string"
          },
          "gracenoteId": {
            "type": "string"
          },
          "tmdbId": {
            "type": "string"
          },
          "wikidataId": {
            "type": "string"
          },
          "wikipediaId": {
            "type": "string"
          },
          "facebookId": {
            "type": "string"
          },
          "xId": {
            "type": "string"
          },
          "instagramId": {
            "type": "string"
          },
          "upstreamId": {
            "type": "string"
          }
        }
      },
      "SecurityTagsRelationship": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ISecurityTagsRelationship",
        "description": "A relationship to one or more security tags",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "type"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "securityTags"
                  ]
                }
              }
            }
          }
        },
        "additionalProperties": false,
        "required": [
          "data"
        ]
      },
      "NewRecordCreateRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "INewRecordCreateRequest",
        "description": "Request body for creating a new record using the current (v2) format. Includes work type, initial metadata, optional parent relationship (for hierarchical works), and optional security tag assignments.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "records"
                ]
              },
              "attributes": {
                "$ref": "#/components/schemas/RecordMetadataAttributes",
                "required": [
                  "workType",
                  "primaryTitle"
                ]
              },
              "relationships": {
                "description": "Optional relationships to establish at creation time.",
                "type": "object",
                "properties": {
                  "parent": {
                    "description": "The parent record in the work hierarchy (e.g. a Season's parent is its Series). Never set for a standalone record — a Movie, MovieEdit, Series, Compilation, or a limited-series Episode created directly under its Series.",
                    "$ref": "#/components/schemas/RecordRelationship"
                  },
                  "securityTags": {
                    "description": "Security tags (permission groups) to apply to this record at creation. If omitted, the tenant's default security tag is applied instead.",
                    "$ref": "#/components/schemas/SecurityTagsRelationship"
                  },
                  "compilations": {
                    "description": "Links this record, at creation time, to one or more already-existing Compilation records as a member.",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string"
                            },
                            "id": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "type",
                            "id"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "data"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "compilationMembers": {
                    "description": "Seeds this Compilation's initial members at creation time (only meaningful when `attributes.workType` is `Compilation`). `ranking` sets each member's sort order within the compilation.",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string"
                            },
                            "id": {
                              "type": "string"
                            },
                            "ranking": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "type",
                            "id"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "data"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "RecordRelationships": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordRelationships",
        "description": "JSON:API relationships for a record resource.",
        "type": "object",
        "properties": {
          "parent": {
            "description": "The parent record in the work hierarchy, if any (e.g. an Episode's parent is its Season, or a Season's parent is its Series). Absent for standalone records such as a top-level Movie or Series.",
            "$ref": "#/components/schemas/RecordRelationship"
          },
          "compilations": {
            "description": "Link to the compilation records this record belongs to as a member. Fetch via GET /records/{recordId}/compilations.",
            "type": "object",
            "properties": {
              "links": {
                "type": "object",
                "properties": {
                  "related": {
                    "type": "string"
                  }
                }
              }
            },
            "required": [
              "links"
            ],
            "additionalProperties": false
          },
          "compilationMembers": {
            "description": "Link to this record's own compilation members, present only when this record is itself a Compilation. Fetch via GET /records/{recordId}/compilationMembers.",
            "type": "object",
            "properties": {
              "links": {
                "type": "object",
                "properties": {
                  "related": {
                    "type": "string"
                  }
                }
              }
            },
            "required": [
              "links"
            ],
            "additionalProperties": false
          },
          "securityTags": {
            "description": "The security tags (permission groups) applied to this record for access control. A record always has at least one.",
            "$ref": "#/components/schemas/SecurityTagsRelationship"
          },
          "creditLists": {
            "description": "Link to the credit lists (cast/crew credits) associated with this record.",
            "type": "object",
            "properties": {
              "links": {
                "type": "object",
                "properties": {
                  "related": {
                    "type": "string"
                  }
                }
              }
            },
            "required": [
              "links"
            ],
            "additionalProperties": false
          },
          "poster": {
            "description": "Link to this record's poster media asset, if one has been uploaded.",
            "type": "object",
            "properties": {
              "links": {
                "type": "object",
                "properties": {
                  "related": {
                    "type": "string"
                  }
                }
              }
            },
            "required": [
              "links"
            ],
            "additionalProperties": false
          },
          "tenant": {
            "description": "The tenant that owns this record.",
            "$ref": "#/components/schemas/TenantRelationship"
          },
          "prevRecord": {
            "description": "The previous sibling record under the same parent, ordered by sequenceNumber (e.g. the prior Episode in a Season). Absent if this is the first sibling or has no siblings.",
            "$ref": "#/components/schemas/RecordRelationship"
          },
          "nextRecord": {
            "description": "The next sibling record under the same parent, ordered by sequenceNumber (e.g. the following Episode in a Season). Absent if this is the last sibling or has no siblings.",
            "$ref": "#/components/schemas/RecordRelationship"
          }
        },
        "required": [
          "tenant"
        ],
        "additionalProperties": false
      },
      "NewRecordMeta": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "INewRecordMeta",
        "description": "Metadata for new-format record responses. Contains the record's hierarchical `path` (ancestry chain from the root work type down to the current record) for breadcrumb display and navigation.",
        "type": "object",
        "properties": {
          "path": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "primaryTitle": {
                  "type": "string"
                }
              },
              "required": [
                "id"
              ],
              "additionalProperties": false
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "DELETED"
            ]
          },
          "availableLocales": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "viewingLocale": {
            "type": "string",
            "description": "The locale the section/field visibility (redactions) was evaluated for. Echoes the request's `viewingLocale` query parameter (default 'en'). This is not content selection, the response always carries all locales."
          },
          "redactions": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "path": {
                  "type": "string"
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "unauthorized",
                    "stale"
                  ]
                }
              }
            }
          }
        },
        "required": [
          "path",
          "status",
          "availableLocales"
        ],
        "additionalProperties": false
      },
      "NewRecordFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "INewRecordFindOneResponse",
        "description": "JSON:API response for fetching a single record using the current (v2) format. Contains the full record data, hierarchy path in `meta`, and a self link.",
        "type": "object",
        "required": [
          "data",
          "meta",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseResource"
              },
              {
                "type": "object",
                "properties": {
                  "attributes": {
                    "$ref": "#/components/schemas/RecordMetadataAttributes",
                    "required": [
                      "workType",
                      "primaryTitle"
                    ]
                  },
                  "relationships": {
                    "$ref": "#/components/schemas/RecordRelationships",
                    "required": [
                      "tenant"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "attributes",
                  "relationships"
                ],
                "additionalProperties": false
              }
            ]
          },
          "meta": {
            "$ref": "#/components/schemas/NewRecordMeta"
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "string"
              }
            }
          }
        }
      },
      "NewRecordUpdateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "INewRecordUpdateOneRequest",
        "description": "Request body for partially updating a record using the current (v2) format. Supports updating core metadata attributes and/or replacing the record's security tag relationships in a single request.",
        "type": "object",
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "required": [
              "id",
              "type"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "records"
                ]
              },
              "attributes": {
                "type": "object",
                "additionalProperties": true,
                "minProperties": 1,
                "patternProperties": {
                  "^.*$": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number",
                        "nullable": true
                      },
                      {
                        "type": "null"
                      },
                      {
                        "type": "boolean",
                        "nullable": true
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "nullable": true
                      },
                      {
                        "type": "object",
                        "minProperties": 1,
                        "patternProperties": {
                          "^.*$": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              },
                              {
                                "type": "boolean"
                              },
                              {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "properties": {
                  "primaryTitle": {
                    "type": "string",
                    "nullable": true
                  },
                  "workType": {
                    "$ref": "#/components/schemas/WorkTypes",
                    "nullable": true
                  },
                  "workTypeDetail": {
                    "type": "string",
                    "nullable": true
                  },
                  "lifecycleStatus": {
                    "type": "string",
                    "description": "The current lifecycle status (e.g., draft, in-review, published)",
                    "nullable": true
                  },
                  "sequenceNumber": {
                    "type": "integer",
                    "nullable": true,
                    "minimum": 1
                  },
                  "genres": {
                    "type": "object",
                    "minProperties": 1,
                    "nullable": true,
                    "patternProperties": {
                      "^.*$": {
                        "oneOf": [
                          {
                            "type": "array",
                            "nullable": true,
                            "items": {
                              "type": "string"
                            }
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  "runLength": {
                    "type": "number",
                    "nullable": true
                  },
                  "releaseYear": {
                    "type": "number",
                    "nullable": true
                  },
                  "releaseDate": {
                    "type": "string",
                    "nullable": true
                  },
                  "countriesOfOrigin": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "nullable": true
                  },
                  "primarySpokenLanguage": {
                    "type": "string",
                    "nullable": true
                  },
                  "originNexusId": {
                    "type": "string",
                    "nullable": true
                  },
                  "eidrId": {
                    "type": "string",
                    "nullable": true
                  },
                  "imdbId": {
                    "type": "string",
                    "nullable": true
                  },
                  "gracenoteId": {
                    "type": "string",
                    "nullable": true
                  },
                  "tmdbId": {
                    "type": "string",
                    "nullable": true
                  },
                  "wikidataId": {
                    "type": "string",
                    "nullable": true
                  },
                  "wikipediaId": {
                    "type": "string",
                    "nullable": true
                  },
                  "facebookId": {
                    "type": "string",
                    "nullable": true
                  },
                  "xId": {
                    "type": "string",
                    "nullable": true
                  },
                  "instagramId": {
                    "type": "string",
                    "nullable": true
                  }
                }
              },
              "relationships": {
                "description": "Relationships to replace on the record.",
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "securityTags": {
                    "description": "Fully replaces the record's current set of security tags with this list (unlike POST .../relationships/securityTags, which only appends). At least one tag must remain.",
                    "$ref": "#/components/schemas/SecurityTagsRelationship"
                  }
                }
              }
            }
          }
        }
      },
      "ITenantLibrarySearchOperator": {
        "type": "string",
        "description": "The operator to use for a search condition. eq — exact match. ne — exact exclusion; a record with NO value for the field satisfies ne (Salesforce SOQL-style: 'not equal' includes 'not set'), not the stricter SQL null-handling reading. contains — substring/token match on analyzed text fields (e.g. tenant custom text fields); on keyword-mapped fields (e.g. the genres field, or path) it degenerates to an exact match, not substring — there is no way to discover a field's underlying mapping from this API, so prefer eq/starts_with on fields you know are keyword-like. not_contains — negation of contains, with the same per-field keyword-vs-text caveat, and the same 'no value satisfies the negation' semantics as ne. starts_with — prefix match; not supported on numeric fields or on analyzed text fields without keyword search enabled. lt/lte/gt/gte — numeric or date range comparisons. exists — field has any non-null value. not_exists — field is absent or null; the strict/only correct way to test absence (ne does NOT distinguish absence from 'anything else' — both are satisfied).",
        "example": "eq",
        "enum": [
          "eq",
          "ne",
          "contains",
          "not_contains",
          "starts_with",
          "lt",
          "lte",
          "gt",
          "gte",
          "exists",
          "not_exists"
        ]
      },
      "ITenantLibrarySearchCondition": {
        "type": "object",
        "properties": {
          "field": {
            "description": "A system-owned field name or a tenant custom field key. Notable fields: `genres` — matched against the request's `filter.locale` (or 'en' if omitted), the same way a localized tenant custom field is. `parentId` — matches only the immediate parent (one hierarchy level); to match an entire subtree at any depth (e.g. every Season and Episode under a Series), use `path` with operator `starts_with` and the ancestor's own recordId as the value instead — `path` is the full ancestor chain including the record's own ID, joined with '|'. Any field name not in the enum below is treated as a tenant custom field key — fetch valid keys via `GET /fields`.",
            "example": "primaryTitle",
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "workType",
                  "workTypeDetail",
                  "primaryTitle",
                  "originNexusId",
                  "upstreamId",
                  "genres",
                  "releaseYear",
                  "sequenceNumber",
                  "created",
                  "updated",
                  "deletedAt",
                  "tenantId",
                  "recordId",
                  "status",
                  "lifecycleStatus",
                  "lifecyclePhase",
                  "parentId",
                  "path",
                  "securityTagIds",
                  "dataDeliveryPackages",
                  "eidrId",
                  "imdbId",
                  "gracenoteId",
                  "tmdbId",
                  "wikidataId",
                  "wikipediaId",
                  "facebookId",
                  "xId",
                  "instagramId"
                ]
              },
              {
                "type": "string",
                "pattern": "^[a-z][a-zA-Z0-9_-]{2,49}$",
                "description": "Tenant custom field key"
              }
            ]
          },
          "operator": {
            "$ref": "#/components/schemas/ITenantLibrarySearchOperator"
          },
          "value": {
            "description": "The value to search for. An array value with operator eq means 'matches any of these' (an OR/IN check on a single field), not 'equals this exact array'. Omit entirely for exists/not_exists.",
            "example": "The Matrix",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          }
        },
        "required": [
          "field",
          "operator"
        ],
        "additionalProperties": false
      },
      "ITenantLibrarySearchQueryGroup": {
        "type": "object",
        "properties": {
          "operator": {
            "type": "string",
            "description": "How this node's own conditions and groups combine: AND — all must match; OR — at least one must match; NOT — negates the COMBINED result of all of this node's own conditions/groups (which are ANDed together first) — it does not distinguish or independently negate each one. To negate a single condition on its own, put it alone in its own NOT group rather than mixing it with siblings.",
            "example": "AND",
            "enum": [
              "AND",
              "OR",
              "NOT"
            ]
          },
          "conditions": {
            "type": "array",
            "description": "Leaf filters evaluated at this node, combined per this node's own operator.",
            "items": {
              "$ref": "#/components/schemas/ITenantLibrarySearchCondition"
            }
          },
          "groups": {
            "type": "array",
            "description": "Nested where-nodes for arbitrary AND/OR/NOT composition, combined with this node's own conditions per this node's operator.",
            "items": {
              "$ref": "#/components/schemas/ITenantLibrarySearchQueryGroup"
            }
          }
        },
        "required": [
          "operator"
        ],
        "anyOf": [
          {
            "required": [
              "conditions"
            ]
          },
          {
            "required": [
              "groups"
            ]
          }
        ],
        "additionalProperties": false
      },
      "TenantLibrarySearchRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantLibrarySearchRequest",
        "type": "object",
        "description": "The request body for a search and filter request to the tenant library. `data.attributes.group` is a boolean tree of filters — see ITenantLibrarySearchQueryGroup and ITenantLibrarySearchCondition for the field/operator semantics, and the `examples` below for common patterns including nested AND/OR/NOT composition, genres, and hierarchy traversal.",
        "examples": [
          {
            "data": {
              "type": "searchQueries",
              "attributes": {
                "group": {
                  "operator": "AND",
                  "conditions": [
                    {
                      "field": "primaryTitle",
                      "operator": "eq",
                      "value": "The Matrix"
                    }
                  ]
                }
              }
            }
          },
          {
            "description": "Nested AND/OR/NOT composition: Movies released 1999 or later, tagged sci_fi or action, excluding anything still in drafting.",
            "data": {
              "type": "searchQueries",
              "attributes": {
                "group": {
                  "operator": "AND",
                  "conditions": [
                    {
                      "field": "workType",
                      "operator": "eq",
                      "value": "Movie"
                    },
                    {
                      "field": "releaseYear",
                      "operator": "gte",
                      "value": 1999
                    }
                  ],
                  "groups": [
                    {
                      "operator": "OR",
                      "conditions": [
                        {
                          "field": "genres",
                          "operator": "eq",
                          "value": "sci_fi"
                        },
                        {
                          "field": "genres",
                          "operator": "eq",
                          "value": "action"
                        }
                      ]
                    },
                    {
                      "operator": "NOT",
                      "conditions": [
                        {
                          "field": "lifecyclePhase",
                          "operator": "eq",
                          "value": "drafting"
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          {
            "description": "Hierarchy traversal: every descendant (any depth) of a given Series, via path + starts_with using that Series' own recordId. Use parentId eq instead for exactly one level (e.g. only a Series' direct Seasons).",
            "data": {
              "type": "searchQueries",
              "attributes": {
                "group": {
                  "operator": "AND",
                  "conditions": [
                    {
                      "field": "path",
                      "operator": "starts_with",
                      "value": "<seriesRecordId>"
                    }
                  ]
                }
              }
            }
          },
          {
            "description": "not_exists/ne treat a record with no value for the field as satisfying the negation (Salesforce-style) — this matches records where releaseYear was never set, not just records with a different releaseYear.",
            "data": {
              "type": "searchQueries",
              "attributes": {
                "group": {
                  "operator": "AND",
                  "conditions": [
                    {
                      "field": "releaseYear",
                      "operator": "ne",
                      "value": 1999
                    }
                  ]
                }
              }
            }
          }
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "searchQueries"
                ]
              },
              "attributes": {
                "type": "object",
                "properties": {
                  "group": {
                    "$ref": "#/components/schemas/ITenantLibrarySearchQueryGroup"
                  }
                },
                "required": [
                  "group"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "definitions": {
          "ITenantLibrarySearchOperator": {
            "type": "string",
            "description": "The operator to use for a search condition. eq — exact match. ne — exact exclusion; a record with NO value for the field satisfies ne (Salesforce SOQL-style: 'not equal' includes 'not set'), not the stricter SQL null-handling reading. contains — substring/token match on analyzed text fields (e.g. tenant custom text fields); on keyword-mapped fields (e.g. the genres field, or path) it degenerates to an exact match, not substring — there is no way to discover a field's underlying mapping from this API, so prefer eq/starts_with on fields you know are keyword-like. not_contains — negation of contains, with the same per-field keyword-vs-text caveat, and the same 'no value satisfies the negation' semantics as ne. starts_with — prefix match; not supported on numeric fields or on analyzed text fields without keyword search enabled. lt/lte/gt/gte — numeric or date range comparisons. exists — field has any non-null value. not_exists — field is absent or null; the strict/only correct way to test absence (ne does NOT distinguish absence from 'anything else' — both are satisfied).",
            "example": "eq",
            "enum": [
              "eq",
              "ne",
              "contains",
              "not_contains",
              "starts_with",
              "lt",
              "lte",
              "gt",
              "gte",
              "exists",
              "not_exists"
            ]
          },
          "ITenantLibrarySearchCondition": {
            "type": "object",
            "properties": {
              "field": {
                "description": "A system-owned field name or a tenant custom field key. Notable fields: `genres` — matched against the request's `filter.locale` (or 'en' if omitted), the same way a localized tenant custom field is. `parentId` — matches only the immediate parent (one hierarchy level); to match an entire subtree at any depth (e.g. every Season and Episode under a Series), use `path` with operator `starts_with` and the ancestor's own recordId as the value instead — `path` is the full ancestor chain including the record's own ID, joined with '|'. Any field name not in the enum below is treated as a tenant custom field key — fetch valid keys via `GET /fields`.",
                "example": "primaryTitle",
                "oneOf": [
                  {
                    "type": "string",
                    "enum": [
                      "workType",
                      "workTypeDetail",
                      "primaryTitle",
                      "originNexusId",
                      "upstreamId",
                      "genres",
                      "releaseYear",
                      "sequenceNumber",
                      "created",
                      "updated",
                      "deletedAt",
                      "tenantId",
                      "recordId",
                      "status",
                      "lifecycleStatus",
                      "lifecyclePhase",
                      "parentId",
                      "path",
                      "securityTagIds",
                      "dataDeliveryPackages",
                      "eidrId",
                      "imdbId",
                      "gracenoteId",
                      "tmdbId",
                      "wikidataId",
                      "wikipediaId",
                      "facebookId",
                      "xId",
                      "instagramId"
                    ]
                  },
                  {
                    "type": "string",
                    "pattern": "^[a-z][a-zA-Z0-9_-]{2,49}$",
                    "description": "Tenant custom field key"
                  }
                ]
              },
              "operator": {
                "$ref": "#/components/schemas/ITenantLibrarySearchOperator"
              },
              "value": {
                "description": "The value to search for. An array value with operator eq means 'matches any of these' (an OR/IN check on a single field), not 'equals this exact array'. Omit entirely for exists/not_exists.",
                "example": "The Matrix",
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                ]
              }
            },
            "required": [
              "field",
              "operator"
            ],
            "additionalProperties": false
          },
          "ITenantLibrarySearchQueryGroup": {
            "type": "object",
            "properties": {
              "operator": {
                "type": "string",
                "description": "How this node's own conditions and groups combine: AND — all must match; OR — at least one must match; NOT — negates the COMBINED result of all of this node's own conditions/groups (which are ANDed together first) — it does not distinguish or independently negate each one. To negate a single condition on its own, put it alone in its own NOT group rather than mixing it with siblings.",
                "example": "AND",
                "enum": [
                  "AND",
                  "OR",
                  "NOT"
                ]
              },
              "conditions": {
                "type": "array",
                "description": "Leaf filters evaluated at this node, combined per this node's own operator.",
                "items": {
                  "$ref": "#/components/schemas/ITenantLibrarySearchCondition"
                }
              },
              "groups": {
                "type": "array",
                "description": "Nested where-nodes for arbitrary AND/OR/NOT composition, combined with this node's own conditions per this node's operator.",
                "items": {
                  "$ref": "#/components/schemas/ITenantLibrarySearchQueryGroup"
                }
              }
            },
            "required": [
              "operator"
            ],
            "anyOf": [
              {
                "required": [
                  "conditions"
                ]
              },
              {
                "required": [
                  "groups"
                ]
              }
            ],
            "additionalProperties": false
          }
        }
      },
      "OpenSearchTenantLibraryCommonFields": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IOpenSearchTenantLibraryCommonFields",
        "description": "Common metadata fields shared across tenant library search index entries, including timestamps, work type, lifecycle state, primary title, and optional media cover image.",
        "type": "object",
        "properties": {
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "updated": {
            "type": "string",
            "format": "date-time"
          },
          "deletedAt": {
            "type": "string",
            "format": "date-time"
          },
          "workType": {
            "type": "string"
          },
          "workTypeDetail": {
            "type": "string"
          },
          "lifecycleStatus": {
            "type": "string",
            "description": "The current lifecycle status"
          },
          "lifecyclePhase": {
            "type": "string",
            "description": "The current lifecycle phase"
          },
          "primaryTitle": {
            "type": "string"
          },
          "sequenceNumber": {
            "type": "integer"
          },
          "releaseYear": {
            "type": "integer"
          },
          "coverImage": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string"
              },
              "value": {
                "type": "string"
              },
              "height": {
                "type": "integer"
              },
              "width": {
                "type": "integer"
              }
            },
            "required": [
              "key",
              "value"
            ],
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "RecordCommonIdentifierAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordCommonIdentifierAttributes",
        "description": "Common identifier attributes for record",
        "type": "object",
        "properties": {
          "originNexusId": {
            "type": "string"
          },
          "eidrId": {
            "type": "string"
          },
          "imdbId": {
            "type": "string"
          },
          "gracenoteId": {
            "type": "string"
          },
          "tmdbId": {
            "type": "string"
          },
          "wikidataId": {
            "type": "string"
          },
          "wikipediaId": {
            "type": "string"
          },
          "facebookId": {
            "type": "string"
          },
          "xId": {
            "type": "string"
          },
          "instagramId": {
            "type": "string"
          },
          "upstreamId": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "TenantLibraryRecordAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantLibraryRecordAttributes",
        "description": "Fields from tenant-library record used in the API response",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/OpenSearchTenantLibraryCommonFields",
            "required": [
              "workType",
              "primaryTitle",
              "lifecycleStatus",
              "lifecyclePhase",
              "created",
              "updated"
            ]
          },
          {
            "$ref": "#/components/schemas/RecordCommonIdentifierAttributes"
          },
          {
            "type": "object",
            "properties": {
              "genres": {
                "type": "object",
                "patternProperties": {
                  "^.*$": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "RecordMeta": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordMeta",
        "description": "Metadata attached to a record resource outside its core attributes. `path` represents the hierarchical ancestry of the record (e.g., Series → Season for an Episode), providing context for navigation and display.",
        "type": "object",
        "properties": {
          "path": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "primaryTitle": {
                  "type": "string"
                }
              },
              "required": [
                "id"
              ],
              "additionalProperties": false
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "DELETED"
            ]
          },
          "availableLocales": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tenantId": {
            "type": "string"
          },
          "childrenStats": {
            "type": "object",
            "properties": {
              "count": {
                "type": "object",
                "additionalProperties": {
                  "type": "number"
                }
              }
            },
            "additionalProperties": false
          },
          "redactions": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "path": {
                  "type": "string"
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "unauthorized"
                  ]
                }
              }
            }
          }
        },
        "required": [
          "path",
          "status",
          "availableLocales"
        ],
        "additionalProperties": false
      },
      "TenantLibrarySearchResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantLibrarySearchResponse",
        "description": "Response returned by the tenant library record search endpoint. Contains a paginated array of matching record resources, with pagination links and total count metadata.",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "type",
                "attributes",
                "meta"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "records"
                  ]
                },
                "attributes": {
                  "$ref": "#/components/schemas/TenantLibraryRecordAttributes"
                },
                "relationships": {
                  "$ref": "#/components/schemas/RecordRelationships"
                },
                "meta": {
                  "$ref": "#/components/schemas/RecordMeta"
                },
                "links": {
                  "$ref": "#/components/schemas/LinksSelf"
                }
              }
            },
            "additionalProperties": false
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "string"
              },
              "next": {
                "type": "string"
              },
              "prev": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "meta": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "page": {
                "type": "integer"
              },
              "perPage": {
                "type": "integer"
              },
              "unauthorizedCount": {
                "type": "integer"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "data",
          "meta"
        ],
        "additionalProperties": false
      },
      "IRecordIdJobParameters": {
        "type": "object",
        "description": "Parameters for job types that only need a target record id: deleteRecord, restoreRecord, permanentlyDeleteRecord.",
        "properties": {
          "recordId": {
            "type": "string"
          }
        },
        "required": [
          "recordId"
        ],
        "additionalProperties": false
      },
      "IRecordCreateRecordFromScratchJobParameters": {
        "type": "object",
        "properties": {
          "workType": {
            "$ref": "#/components/schemas/WorkTypes"
          },
          "primaryTitle": {
            "type": "string"
          },
          "releaseYear": {
            "type": "number"
          },
          "workTypeDetail": {
            "type": "string"
          },
          "parentRecordId": {
            "type": "string"
          },
          "securityTags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "editClass": {
            "type": "string"
          },
          "intendedTerritories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "seasons": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "primaryTitle": {
                  "type": "string"
                },
                "releaseYear": {
                  "type": "number"
                },
                "workType": {
                  "type": "string",
                  "enum": [
                    "Season"
                  ]
                },
                "securityTags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "primaryTitle",
                "workType"
              ]
            }
          },
          "episodes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "primaryTitle": {
                  "type": "string"
                },
                "releaseYear": {
                  "type": "number"
                },
                "workType": {
                  "type": "string",
                  "enum": [
                    "Episode"
                  ]
                },
                "securityTags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "primaryTitle",
                "workType"
              ]
            }
          },
          "compilations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                }
              },
              "required": [
                "id"
              ]
            }
          }
        },
        "required": [
          "workType"
        ],
        "additionalProperties": false
      },
      "IRecordCreateMediaFromUrlJobParameters": {
        "type": "object",
        "properties": {
          "urls": {
            "description": "Media source URLs to fetch and attach; supply at least one. Each must use `https` and be served by an approved media host; a URL on any other host is rejected without being fetched. Rejections are reported per URL, so the remaining entries in the job still run.",
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "maxItems": 100
          },
          "recordId": {
            "type": "string"
          },
          "imageType": {
            "$ref": "#/components/schemas/MediaAttributeImageType"
          },
          "locale": {
            "description": "Optional BCP 47 language tag (optionally region- or script-qualified, e.g. `en`, `pt-br`, `zh-Hans`) describing the language of the fetched media. Applies uniformly to every entry in `urls`. Normalized against Studio's canonical locale list when the media record is written; unrecognized values are dropped rather than defaulted.",
            "type": "string"
          }
        },
        "required": [
          "urls",
          "recordId",
          "imageType"
        ],
        "additionalProperties": false
      },
      "IRecordMigrateLifecycleStatusJobParameters": {
        "type": "object",
        "properties": {
          "oldLifecycleStatus": {
            "type": "string"
          },
          "newLifecycleStatus": {
            "type": "string"
          },
          "workType": {
            "$ref": "#/components/schemas/WorkTypes"
          }
        },
        "required": [
          "oldLifecycleStatus",
          "newLifecycleStatus",
          "workType"
        ],
        "additionalProperties": false
      },
      "IImportSeriesOriginNexusJobParameters": {
        "type": "object",
        "properties": {
          "seriesId": {
            "type": "string"
          },
          "securityTags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "importOptions": {
            "type": "object",
            "description": "Controls Origin Nexus import depth and series-level media/credits.",
            "properties": {
              "seriesOnly": {
                "type": "boolean",
                "description": "When true, skip seasons/episodes and import the series record only. When omitted, the full hierarchy (seasons and episodes) is imported by default."
              },
              "importCredits": {
                "type": "boolean",
                "description": "When false, skip importing credits and linked contributors from Origin Nexus. When omitted, credits and contributors are imported by default."
              },
              "importImages": {
                "type": "boolean",
                "description": "When false, skip importing poster/cover images. When omitted, images are imported by default."
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "seriesId"
        ],
        "additionalProperties": false
      },
      "IImportMoviesOriginNexusJobParameters": {
        "type": "object",
        "properties": {
          "movieId": {
            "type": "string"
          },
          "securityTags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "importOptions": {
            "type": "object",
            "description": "Controls movie-level media/credits import.",
            "properties": {
              "importCredits": {
                "type": "boolean",
                "description": "When false, skip importing credits and linked contributors from Origin Nexus. When omitted, credits and contributors are imported by default."
              },
              "importImages": {
                "type": "boolean",
                "description": "When false, skip importing poster/cover images. When omitted, images are imported by default."
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "movieId"
        ],
        "additionalProperties": false
      },
      "IRecordBulkEditJobParameters": {
        "type": "object",
        "description": "Parameters for a bulk-edit job: apply the same field edits to every record matching a selection predicate, for one locale. The state machine resolves the selection to concrete record ids server-side, then patches each record.",
        "properties": {
          "locale": {
            "type": "string",
            "description": "The single locale all edits target (e.g. `en`). Optional: required only when at least one edit targets a localized field. A job editing only unlocalized fields (e.g. `releaseYear`) may omit it; a localized edit without a locale fails that field."
          },
          "edits": {
            "type": "array",
            "minItems": 1,
            "description": "Field edits applied to every selected record. `overwrite` replaces the field value for the job locale (`value` required); `delete` clears it.",
            "items": {
              "type": "object",
              "properties": {
                "fieldKey": {
                  "type": "string"
                },
                "action": {
                  "type": "string",
                  "enum": [
                    "overwrite",
                    "delete"
                  ]
                },
                "value": {
                  "description": "New value for `overwrite`; ignored for `delete`. Arbitrary JSON validated per field at write time."
                }
              },
              "required": [
                "fieldKey",
                "action"
              ],
              "additionalProperties": false
            }
          },
          "selection": {
            "type": "object",
            "description": "Resolved Studio Library selection predicate. When `searchGroup` is present (an all-in-view or hierarchy selection), every record matching it is in scope, minus `excludeRecordIds`, plus `includeRecordIds`. When `searchGroup` is absent, only `includeRecordIds` (a pure manual-tick selection) are edited.",
            "properties": {
              "searchGroup": {
                "type": "object",
                "description": "Boolean query tree (ITenantLibrarySearchQueryGroup). Present for all-in-view / hierarchy selections; omitted for a pure manual-tick selection. Validated by the search service when the enumeration query runs.",
                "additionalProperties": true
              },
              "includeRecordIds": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "excludeRecordIds": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [],
            "additionalProperties": false
          }
        },
        "required": [
          "edits",
          "selection"
        ],
        "additionalProperties": false
      },
      "CreateRecordJobRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordCreateJobRequest",
        "description": "Request body for creating a record background job. Specify the job type (e.g., `deleteRecord`) and the required parameters. The created job can be polled via `GET /record-jobs/{jobId}`.",
        "type": "object",
        "definitions": {
          "IRecordIdJobParameters": {
            "type": "object",
            "description": "Parameters for job types that only need a target record id: deleteRecord, restoreRecord, permanentlyDeleteRecord.",
            "properties": {
              "recordId": {
                "type": "string"
              }
            },
            "required": [
              "recordId"
            ],
            "additionalProperties": false
          },
          "IRecordCreateRecordFromScratchJobParameters": {
            "type": "object",
            "properties": {
              "workType": {
                "$ref": "#/components/schemas/WorkTypes"
              },
              "primaryTitle": {
                "type": "string"
              },
              "releaseYear": {
                "type": "number"
              },
              "workTypeDetail": {
                "type": "string"
              },
              "parentRecordId": {
                "type": "string"
              },
              "securityTags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "editClass": {
                "type": "string"
              },
              "intendedTerritories": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "seasons": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "primaryTitle": {
                      "type": "string"
                    },
                    "releaseYear": {
                      "type": "number"
                    },
                    "workType": {
                      "type": "string",
                      "enum": [
                        "Season"
                      ]
                    },
                    "securityTags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "primaryTitle",
                    "workType"
                  ]
                }
              },
              "episodes": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "primaryTitle": {
                      "type": "string"
                    },
                    "releaseYear": {
                      "type": "number"
                    },
                    "workType": {
                      "type": "string",
                      "enum": [
                        "Episode"
                      ]
                    },
                    "securityTags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "primaryTitle",
                    "workType"
                  ]
                }
              },
              "compilations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id"
                  ]
                }
              }
            },
            "required": [
              "workType"
            ],
            "additionalProperties": false
          },
          "IRecordCreateMediaFromUrlJobParameters": {
            "type": "object",
            "properties": {
              "urls": {
                "description": "Media source URLs to fetch and attach; supply at least one. Each must use `https` and be served by an approved media host; a URL on any other host is rejected without being fetched. Rejections are reported per URL, so the remaining entries in the job still run.",
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uri"
                },
                "maxItems": 100
              },
              "recordId": {
                "type": "string"
              },
              "imageType": {
                "$ref": "#/components/schemas/MediaAttributeImageType"
              },
              "locale": {
                "description": "Optional BCP 47 language tag (optionally region- or script-qualified, e.g. `en`, `pt-br`, `zh-Hans`) describing the language of the fetched media. Applies uniformly to every entry in `urls`. Normalized against Studio's canonical locale list when the media record is written; unrecognized values are dropped rather than defaulted.",
                "type": "string"
              }
            },
            "required": [
              "urls",
              "recordId",
              "imageType"
            ],
            "additionalProperties": false
          },
          "IRecordMigrateLifecycleStatusJobParameters": {
            "type": "object",
            "properties": {
              "oldLifecycleStatus": {
                "type": "string"
              },
              "newLifecycleStatus": {
                "type": "string"
              },
              "workType": {
                "$ref": "#/components/schemas/WorkTypes"
              }
            },
            "required": [
              "oldLifecycleStatus",
              "newLifecycleStatus",
              "workType"
            ],
            "additionalProperties": false
          },
          "IImportSeriesOriginNexusJobParameters": {
            "type": "object",
            "properties": {
              "seriesId": {
                "type": "string"
              },
              "securityTags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "importOptions": {
                "type": "object",
                "description": "Controls Origin Nexus import depth and series-level media/credits.",
                "properties": {
                  "seriesOnly": {
                    "type": "boolean",
                    "description": "When true, skip seasons/episodes and import the series record only. When omitted, the full hierarchy (seasons and episodes) is imported by default."
                  },
                  "importCredits": {
                    "type": "boolean",
                    "description": "When false, skip importing credits and linked contributors from Origin Nexus. When omitted, credits and contributors are imported by default."
                  },
                  "importImages": {
                    "type": "boolean",
                    "description": "When false, skip importing poster/cover images. When omitted, images are imported by default."
                  }
                },
                "additionalProperties": false
              }
            },
            "required": [
              "seriesId"
            ],
            "additionalProperties": false
          },
          "IImportMoviesOriginNexusJobParameters": {
            "type": "object",
            "properties": {
              "movieId": {
                "type": "string"
              },
              "securityTags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "importOptions": {
                "type": "object",
                "description": "Controls movie-level media/credits import.",
                "properties": {
                  "importCredits": {
                    "type": "boolean",
                    "description": "When false, skip importing credits and linked contributors from Origin Nexus. When omitted, credits and contributors are imported by default."
                  },
                  "importImages": {
                    "type": "boolean",
                    "description": "When false, skip importing poster/cover images. When omitted, images are imported by default."
                  }
                },
                "additionalProperties": false
              }
            },
            "required": [
              "movieId"
            ],
            "additionalProperties": false
          },
          "IRecordBulkEditJobParameters": {
            "type": "object",
            "description": "Parameters for a bulk-edit job: apply the same field edits to every record matching a selection predicate, for one locale. The state machine resolves the selection to concrete record ids server-side, then patches each record.",
            "properties": {
              "locale": {
                "type": "string",
                "description": "The single locale all edits target (e.g. `en`). Optional: required only when at least one edit targets a localized field. A job editing only unlocalized fields (e.g. `releaseYear`) may omit it; a localized edit without a locale fails that field."
              },
              "edits": {
                "type": "array",
                "minItems": 1,
                "description": "Field edits applied to every selected record. `overwrite` replaces the field value for the job locale (`value` required); `delete` clears it.",
                "items": {
                  "type": "object",
                  "properties": {
                    "fieldKey": {
                      "type": "string"
                    },
                    "action": {
                      "type": "string",
                      "enum": [
                        "overwrite",
                        "delete"
                      ]
                    },
                    "value": {
                      "description": "New value for `overwrite`; ignored for `delete`. Arbitrary JSON validated per field at write time."
                    }
                  },
                  "required": [
                    "fieldKey",
                    "action"
                  ],
                  "additionalProperties": false
                }
              },
              "selection": {
                "type": "object",
                "description": "Resolved Studio Library selection predicate. When `searchGroup` is present (an all-in-view or hierarchy selection), every record matching it is in scope, minus `excludeRecordIds`, plus `includeRecordIds`. When `searchGroup` is absent, only `includeRecordIds` (a pure manual-tick selection) are edited.",
                "properties": {
                  "searchGroup": {
                    "type": "object",
                    "description": "Boolean query tree (ITenantLibrarySearchQueryGroup). Present for all-in-view / hierarchy selections; omitted for a pure manual-tick selection. Validated by the search service when the enumeration query runs.",
                    "additionalProperties": true
                  },
                  "includeRecordIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "excludeRecordIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            },
            "required": [
              "edits",
              "selection"
            ],
            "additionalProperties": false
          }
        },
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseCreateRequest"
              },
              {
                "type": "object",
                "properties": {
                  "attributes": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "The kind of background job to run. Determines which shape `parameters` must match: `deleteRecord`/`restoreRecord`/`permanentlyDeleteRecord` take only a `recordId` — WARNING: `deleteRecord` and `permanentlyDeleteRecord` act recursively on the entire hierarchy under that record (e.g. deleting a Series also deletes all of its Seasons and Episodes), not just the target record itself; `restoreRecord` restores the same hierarchy back. `permanentlyDeleteRecord` is irreversible. `createRecordFromScratch` creates a new record (optionally with seasons/episodes/compilation links); `createMediaFromUrl` fetches and attaches media from external URLs; `migrateRecordLifecycleStatus` bulk-moves all records of a workType from one lifecycle status to another; `importSeriesOriginNexus`/`importMoviesOriginNexus` import a Series or Movie (and its hierarchy) from Origin Nexus by its Origin ID.",
                        "enum": [
                          "deleteRecord",
                          "restoreRecord",
                          "permanentlyDeleteRecord",
                          "createRecordFromScratch",
                          "createMediaFromUrl",
                          "migrateRecordLifecycleStatus",
                          "importSeriesOriginNexus",
                          "importMoviesOriginNexus",
                          "bulkEditRecords"
                        ]
                      },
                      "parameters": {
                        "description": "Job-specific parameters. The required shape depends on `type` — see the `type` field description.",
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/IRecordIdJobParameters"
                          },
                          {
                            "$ref": "#/components/schemas/IRecordCreateRecordFromScratchJobParameters"
                          },
                          {
                            "$ref": "#/components/schemas/IRecordCreateMediaFromUrlJobParameters"
                          },
                          {
                            "$ref": "#/components/schemas/IRecordMigrateLifecycleStatusJobParameters"
                          },
                          {
                            "$ref": "#/components/schemas/IImportSeriesOriginNexusJobParameters"
                          },
                          {
                            "$ref": "#/components/schemas/IImportMoviesOriginNexusJobParameters"
                          },
                          {
                            "$ref": "#/components/schemas/IRecordBulkEditJobParameters"
                          }
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "parameters"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "attributes"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "RecordJob": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordJob",
        "description": "Attributes for a record background job. Extends the base background job attributes with record-specific job type and parameters. Currently supports `deleteRecord` as a job type, which asynchronously removes a record and all associated data.",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/BackgroundJobAttributes"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "deleteRecord",
                  "restoreRecord",
                  "permanentlyDeleteRecord",
                  "createRecordFromScratch",
                  "createMediaFromUrl",
                  "migrateRecordLifecycleStatus",
                  "importSeriesOriginNexus",
                  "importMoviesOriginNexus",
                  "bulkEditRecords"
                ]
              },
              "parameters": {
                "type": "object",
                "oneOf": [
                  {
                    "properties": {
                      "recordId": {
                        "type": "string"
                      },
                      "tenantId": {
                        "type": "string"
                      },
                      "subject": {
                        "type": "string",
                        "description": "Human-readable label for the job's target record (its primary title), captured server-side at job creation so the UI can display it even after the record itself is deleted. Purely presentational — not used by job processing."
                      }
                    },
                    "required": [
                      "recordId",
                      "tenantId"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "properties": {
                      "seriesId": {
                        "type": "string"
                      },
                      "tenantId": {
                        "type": "string"
                      },
                      "subject": {
                        "type": "string",
                        "description": "Human-readable label for the imported title (the Origin Nexus global record's primary title), resolved server-side at job creation for display in the background-jobs UI. Purely presentational — not used by job processing."
                      }
                    },
                    "required": [
                      "seriesId",
                      "tenantId"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "properties": {
                      "movieId": {
                        "type": "string"
                      },
                      "tenantId": {
                        "type": "string"
                      },
                      "subject": {
                        "type": "string",
                        "description": "Human-readable label for the imported title (the Origin Nexus global record's primary title), resolved server-side at job creation for display in the background-jobs UI. Purely presentational — not used by job processing."
                      }
                    },
                    "required": [
                      "movieId",
                      "tenantId"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "properties": {
                      "workType": {
                        "$ref": "#/components/schemas/WorkTypes"
                      },
                      "primaryTitle": {
                        "type": "string"
                      },
                      "tenantId": {
                        "type": "string"
                      },
                      "subject": {
                        "type": "string",
                        "description": "Human-readable label for the job's target record (its primary title), captured server-side at job creation for display in the background-jobs UI. Purely presentational — not used by job processing."
                      }
                    },
                    "required": [
                      "recordId",
                      "workType",
                      "tenantId"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "properties": {
                      "tenantId": {
                        "type": "string"
                      },
                      "recordId": {
                        "type": "string"
                      },
                      "urls": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "subject": {
                        "type": "string",
                        "description": "Human-readable label for the job's target record (its primary title), captured server-side at job creation for display in the background-jobs UI. Purely presentational — not used by job processing."
                      }
                    },
                    "required": [
                      "urls",
                      "tenantId",
                      "recordId"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "properties": {
                      "tenantId": {
                        "type": "string"
                      },
                      "oldLifecycleStatus": {
                        "type": "string"
                      },
                      "newLifecycleStatus": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "tenantId",
                      "oldLifecycleStatus",
                      "newLifecycleStatus"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "description": "bulkEditRecords parameters as stored on the job (includes runtime-injected tenantId/jobId).",
                    "properties": {
                      "tenantId": {
                        "type": "string"
                      },
                      "jobId": {
                        "type": "string"
                      },
                      "locale": {
                        "type": "string"
                      },
                      "edits": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "fieldKey": {
                              "type": "string"
                            },
                            "action": {
                              "type": "string",
                              "enum": [
                                "overwrite",
                                "delete"
                              ]
                            },
                            "value": {}
                          },
                          "required": [
                            "fieldKey",
                            "action"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "selection": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "required": [
                      "tenantId",
                      "edits",
                      "selection"
                    ],
                    "additionalProperties": true
                  }
                ]
              }
            },
            "required": [
              "type",
              "parameters"
            ],
            "additionalProperties": false
          }
        ],
        "required": [
          "arn",
          "status",
          "created",
          "updated",
          "type",
          "parameters"
        ],
        "additionalProperties": false
      },
      "CreateRecordJobResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreateRecordJobResponse",
        "description": "Response returned after successfully creating a record background job. Contains the new job's ID and initial status attributes.",
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseCreateRequest"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "attributes": {
                    "$ref": "#/components/schemas/RecordJob"
                  }
                },
                "required": [
                  "id",
                  "attributes"
                ]
              }
            ]
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "RecordGetDeletedAncestorsResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordGetDeletedAncestorsResponse",
        "description": "Returns the ancestor records (top-down) for a given record, optionally narrowed by status via the filter.status query param. Used by the restore confirmation dialog (which requests filter.status=DELETED). Empty when no matching ancestors exist.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "records"
                  ]
                },
                "attributes": {
                  "type": "object",
                  "properties": {
                    "primaryTitle": {
                      "type": "string"
                    },
                    "workType": {
                      "type": "string"
                    },
                    "sequenceNumber": {
                      "type": "integer"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ACTIVE",
                        "DELETED"
                      ]
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "primaryTitle",
                    "workType",
                    "sequenceNumber",
                    "status"
                  ]
                },
                "relationships": {
                  "type": "object",
                  "properties": {
                    "parent": {
                      "description": "This ancestor's own parent, one level further up the chain. Absent for the top-most (root) ancestor.",
                      "$ref": "#/components/schemas/RecordRelationship"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false,
              "required": [
                "id",
                "type",
                "attributes"
              ]
            }
          },
          "meta": {
            "type": "object",
            "properties": {
              "workTypeCounts": {
                "type": "object",
                "description": "Counts of the returned ancestors broken down by workType.",
                "additionalProperties": {
                  "type": "integer"
                }
              }
            },
            "additionalProperties": false
          }
        }
      },
      "RecordChildrenFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordChildrenFindManyResponse",
        "description": "Returns the identifiers of direct active child records for a parent record. Compilation members are not included; use GET /records/{recordId}/compilationMembers for those. Empty when the parent has no hierarchical children (for example, a Movie, a leaf Episode, or a Compilation).",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "records"
                  ]
                }
              },
              "additionalProperties": false,
              "required": [
                "id",
                "type"
              ]
            }
          }
        }
      },
      "RecordCompilationMemberFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordCompilationMemberFindManyResponse",
        "description": "Returns a list of compilation members for a given record.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta",
          "links"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "compilationLinkageItems"
                  ]
                },
                "attributes": {
                  "type": "object",
                  "properties": {
                    "ranking": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "ranking"
                  ]
                },
                "relationships": {
                  "type": "object",
                  "properties": {
                    "record": {
                      "description": "The member record this compilation-membership entry represents.",
                      "$ref": "#/components/schemas/RecordRelationship"
                    },
                    "tenant": {
                      "description": "The tenant that owns this compilation membership.",
                      "$ref": "#/components/schemas/TenantRelationship"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "record",
                    "tenant"
                  ]
                }
              },
              "additionalProperties": false,
              "required": [
                "id",
                "type",
                "attributes",
                "relationships"
              ]
            },
            "additionalProperties": false
          }
        }
      },
      "RecordCompilationFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordCompilationFindManyResponse",
        "description": "Returns a list of compilations for a given record.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta",
          "links"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "compilationLinkageItems"
                  ]
                },
                "attributes": {
                  "type": "object",
                  "properties": {
                    "ranking": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "ranking"
                  ]
                },
                "relationships": {
                  "type": "object",
                  "properties": {
                    "compilation": {
                      "description": "The Compilation record that this record is a member of.",
                      "$ref": "#/components/schemas/RecordRelationship"
                    },
                    "tenant": {
                      "description": "The tenant that owns this compilation membership.",
                      "$ref": "#/components/schemas/TenantRelationship"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "compilation",
                    "tenant"
                  ]
                }
              },
              "additionalProperties": false,
              "required": [
                "id",
                "type",
                "attributes",
                "relationships"
              ]
            },
            "additionalProperties": false
          }
        }
      },
      "compilationLinkageItemDataObject": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "compilationLinkageItems"
          },
          "id": {
            "type": "string"
          },
          "attributes": {
            "type": "object",
            "properties": {
              "ranking": {
                "type": "number",
                "minimum": 0
              },
              "recordStatus": {
                "type": "string",
                "enum": [
                  "ACTIVE",
                  "DELETED"
                ]
              },
              "compilationStatus": {
                "type": "string",
                "enum": [
                  "ACTIVE",
                  "DELETED"
                ]
              }
            },
            "additionalProperties": false
          },
          "relationships": {
            "description": "The record being added as a compilation member.",
            "type": "object",
            "properties": {
              "record": {
                "description": "The record to add. Identifies an existing record by type and ID — it is not created by this call.",
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "records"
                      },
                      "id": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "data"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "record"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "attributes",
          "relationships"
        ],
        "additionalProperties": false
      },
      "compilationLinkageItemRefObject": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "compilationLinkageItems"
          },
          "id": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "additionalProperties": false
      },
      "compilationLinkageItemUpdateDataObject": {
        "type": "object",
        "properties": {
          "attributes": {
            "type": "object",
            "properties": {
              "ranking": {
                "type": "number",
                "minimum": 0
              },
              "recordStatus": {
                "type": "string",
                "enum": [
                  "ACTIVE",
                  "DELETED"
                ]
              },
              "compilationStatus": {
                "type": "string",
                "enum": [
                  "ACTIVE",
                  "DELETED"
                ]
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "attributes"
        ],
        "additionalProperties": false
      },
      "CompilationMembersAtomicOperationsRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICompilationMembersAtomicOperationsRequest",
        "description": "JSON:API Atomic Operations request for managing compilation membership and member order in a single transactional call. Three operation types: `add` — add a record as a new member (rejects a memberRecordId already in the compilation; to change an existing member's ranking or status, use `update` instead, not remove+add). `update` — change an existing member's `ranking` and/or status by its own linkage-item id (from the `ref`), without affecting membership; this is the correct way to reorder members — removing every member and re-adding them is unnecessary and not atomic-safe. `remove` — remove an existing member by its linkage-item id.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "atomic:operations": {
            "type": "array",
            "items": {
              "type": "object",
              "oneOf": [
                {
                  "type": "object",
                  "description": "Add a record as a new compilation member. Fails if the record is already a member — use `update` to change an existing member's ranking/status instead of removing and re-adding.",
                  "properties": {
                    "op": {
                      "const": "add"
                    },
                    "data": {
                      "$ref": "#/components/schemas/compilationLinkageItemDataObject"
                    }
                  },
                  "required": [
                    "op",
                    "data"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "description": "Update an existing member's ranking and/or status by its own linkage-item id, without affecting membership. This is the correct way to reorder members.",
                  "properties": {
                    "op": {
                      "const": "update"
                    },
                    "ref": {
                      "$ref": "#/components/schemas/compilationLinkageItemRefObject"
                    },
                    "data": {
                      "$ref": "#/components/schemas/compilationLinkageItemUpdateDataObject"
                    }
                  },
                  "required": [
                    "op",
                    "ref",
                    "data"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "description": "Remove an existing member by its own linkage-item id.",
                  "properties": {
                    "op": {
                      "const": "remove"
                    },
                    "ref": {
                      "$ref": "#/components/schemas/compilationLinkageItemRefObject"
                    }
                  },
                  "required": [
                    "op",
                    "ref"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          }
        },
        "required": [
          "atomic:operations"
        ],
        "additionalProperties": false,
        "definitions": {
          "compilationLinkageItemDataObject": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "compilationLinkageItems"
              },
              "id": {
                "type": "string"
              },
              "attributes": {
                "type": "object",
                "properties": {
                  "ranking": {
                    "type": "number",
                    "minimum": 0
                  },
                  "recordStatus": {
                    "type": "string",
                    "enum": [
                      "ACTIVE",
                      "DELETED"
                    ]
                  },
                  "compilationStatus": {
                    "type": "string",
                    "enum": [
                      "ACTIVE",
                      "DELETED"
                    ]
                  }
                },
                "additionalProperties": false
              },
              "relationships": {
                "description": "The record being added as a compilation member.",
                "type": "object",
                "properties": {
                  "record": {
                    "description": "The record to add. Identifies an existing record by type and ID — it is not created by this call.",
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "records"
                          },
                          "id": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "type",
                          "id"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "data"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "record"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "attributes",
              "relationships"
            ],
            "additionalProperties": false
          },
          "compilationLinkageItemUpdateDataObject": {
            "type": "object",
            "properties": {
              "attributes": {
                "type": "object",
                "properties": {
                  "ranking": {
                    "type": "number",
                    "minimum": 0
                  },
                  "recordStatus": {
                    "type": "string",
                    "enum": [
                      "ACTIVE",
                      "DELETED"
                    ]
                  },
                  "compilationStatus": {
                    "type": "string",
                    "enum": [
                      "ACTIVE",
                      "DELETED"
                    ]
                  }
                },
                "additionalProperties": false
              }
            },
            "required": [
              "attributes"
            ],
            "additionalProperties": false
          },
          "compilationLinkageItemRefObject": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "compilationLinkageItems"
              },
              "id": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "id"
            ],
            "additionalProperties": false
          }
        }
      },
      "RecordLifecycleNodeAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordLifecycleStatusAttributes",
        "description": "A single lifecycle status node: id, label, phase (drafting or published), and optional position.",
        "type": "object",
        "required": [
          "id",
          "label",
          "phase"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the status"
          },
          "label": {
            "type": "string",
            "description": "Display label for the status"
          },
          "phase": {
            "type": "string",
            "enum": [
              "drafting",
              "published"
            ],
            "description": "The phase this status belongs to"
          },
          "description": {
            "type": "string",
            "description": "Optional description of the status"
          },
          "positionX": {
            "type": "number",
            "description": "The x position of the status"
          },
          "positionY": {
            "type": "number",
            "description": "The y position of the status"
          }
        }
      },
      "RecordLifecycleEdgeAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordLifecycleTransitionAttributes",
        "description": "Attributes of a directed edge in the lifecycle graph, representing a transition between two statuses. `fromStatusId` and `toStatusId` identify the source and target lifecycle status nodes. `direction` indicates whether the transition represents forward progression or a regression in the lifecycle.",
        "type": "object",
        "required": [
          "id",
          "label",
          "fromStatusId",
          "toStatusId",
          "direction"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the transition"
          },
          "label": {
            "type": "string",
            "description": "Display label for the transition action"
          },
          "fromStatusId": {
            "type": "string",
            "description": "The source status ID"
          },
          "toStatusId": {
            "type": "string",
            "description": "The target status ID"
          },
          "direction": {
            "type": "string",
            "enum": [
              "forward",
              "backward"
            ],
            "description": "The direction of the transition based on handles (east→west = forward)"
          },
          "description": {
            "type": "string",
            "description": "Optional description for the transition action"
          }
        }
      },
      "RecordLifecycleAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordLifecycleAttributes",
        "description": "Attributes defining a record lifecycle: work type, statuses, and transitions between statuses.",
        "type": "object",
        "required": [
          "workType",
          "statuses",
          "transitions"
        ],
        "additionalProperties": false,
        "properties": {
          "workType": {
            "$ref": "#/components/schemas/WorkTypes"
          },
          "statuses": {
            "type": "array",
            "description": "The lifecycle statuses",
            "items": {
              "$ref": "#/components/schemas/RecordLifecycleNodeAttributes"
            }
          },
          "transitions": {
            "type": "array",
            "description": "The lifecycle transitions between statuses",
            "items": {
              "$ref": "#/components/schemas/RecordLifecycleEdgeAttributes"
            }
          }
        }
      },
      "RecordLifecycleFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordLifecycleFindManyResponse",
        "description": "JSON:API response for listing all record lifecycles in a tenant. Returns an array of lifecycle resources with their full graph definitions.",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Unique identifier for the lifecycle"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "recordLifecycles"
                  ]
                },
                "attributes": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/BaseResourceAttributes"
                    },
                    {
                      "$ref": "#/components/schemas/RecordLifecycleAttributes"
                    }
                  ]
                },
                "relationships": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "description": "The tenant that owns this lifecycle definition.",
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "tenants"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "type"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    "author": {
                      "description": "The user who originally created this lifecycle definition.",
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "users"
                              ]
                            },
                            "meta": {
                              "type": "object",
                              "properties": {
                                "tenantId": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string"
                                },
                                "displayName": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "tenantId",
                                "type",
                                "displayName"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "type",
                            "meta"
                          ]
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "related": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "required": [
                        "data"
                      ]
                    },
                    "updatedBy": {
                      "description": "The user who last modified this lifecycle definition.",
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "users"
                              ]
                            },
                            "meta": {
                              "type": "object",
                              "properties": {
                                "tenantId": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string"
                                },
                                "displayName": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "tenantId",
                                "type",
                                "displayName"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "type",
                            "meta"
                          ]
                        },
                        "links": {
                          "type": "object",
                          "properties": {
                            "related": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "required": [
                        "data"
                      ]
                    }
                  },
                  "required": [
                    "tenant"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "id",
                "type",
                "attributes",
                "relationships"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "RecordLifecycleCreateRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordLifecycleCreateRequest",
        "description": "Request body for creating a new record lifecycle. Defines the lifecycle's name, initial status nodes, allowed transitions (edges), and the visual layout positions of nodes in the lifecycle editor.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "recordLifecycles"
                ]
              },
              "attributes": {
                "$ref": "#/components/schemas/RecordLifecycleAttributes"
              }
            },
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "RecordLifecycleFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordLifecycleFindOneResponse",
        "description": "JSON:API response for fetching a single record lifecycle by ID. Contains the full lifecycle resource including its statuses, transitions, nodes, and edges that define the lifecycle graph.",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier for the lifecycle"
              },
              "type": {
                "type": "string",
                "enum": [
                  "recordLifecycles"
                ]
              },
              "attributes": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BaseResourceAttributes"
                  },
                  {
                    "$ref": "#/components/schemas/RecordLifecycleAttributes"
                  }
                ]
              },
              "relationships": {
                "type": "object",
                "properties": {
                  "tenant": {
                    "description": "The tenant that owns this lifecycle definition.",
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "tenants"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "data"
                    ],
                    "additionalProperties": false
                  },
                  "author": {
                    "description": "The user who originally created this lifecycle definition.",
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "users"
                            ]
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "tenantId": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "displayName": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "tenantId",
                              "type",
                              "displayName"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "meta"
                        ]
                      },
                      "links": {
                        "type": "object",
                        "properties": {
                          "related": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "required": [
                      "data"
                    ]
                  },
                  "updatedBy": {
                    "description": "The user who last modified this lifecycle definition.",
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "users"
                            ]
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "tenantId": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "displayName": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "tenantId",
                              "type",
                              "displayName"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "meta"
                        ]
                      },
                      "links": {
                        "type": "object",
                        "properties": {
                          "related": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "required": [
                      "data"
                    ]
                  }
                },
                "required": [
                  "tenant"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "type",
              "attributes",
              "relationships"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "RecordLifecycleStatusAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordLifecycleStatusAttributes",
        "description": "A lifecycle status definition: id, label, phase (drafting or published), optional description and position, and in-use metadata.",
        "type": "object",
        "required": [
          "id",
          "label",
          "phase"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the status"
          },
          "label": {
            "type": "string",
            "description": "Display label for the status"
          },
          "phase": {
            "type": "string",
            "enum": [
              "drafting",
              "published"
            ],
            "description": "The phase this status belongs to"
          },
          "description": {
            "type": "string",
            "description": "Optional description for the status"
          },
          "positionX": {
            "type": "number",
            "description": "The x position of the status"
          },
          "positionY": {
            "type": "number",
            "description": "The y position of the status"
          },
          "meta": {
            "type": "object",
            "description": "Metadata about the status",
            "additionalProperties": false,
            "properties": {
              "inUse": {
                "type": "boolean",
                "description": "Whether this status has records associated with it in the studio library"
              }
            }
          }
        }
      },
      "RecordLifecycleTransitionAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordLifecycleTransitionAttributes",
        "description": "Attributes of a lifecycle transition (the action that moves a record from one status to another). Defines the transition label shown to users, the source and destination status IDs, and the direction (forward or backward in the lifecycle progression).",
        "type": "object",
        "required": [
          "id",
          "label",
          "fromStatusId",
          "toStatusId",
          "direction"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the transition"
          },
          "label": {
            "type": "string",
            "description": "Display label for the transition action"
          },
          "fromStatusId": {
            "type": "string",
            "description": "The source status ID"
          },
          "toStatusId": {
            "type": "string",
            "description": "The target status ID"
          },
          "direction": {
            "type": "string",
            "enum": [
              "forward",
              "backward"
            ],
            "description": "The direction of the transition based on handles (east→west = forward)"
          }
        }
      },
      "RecordLifecycleUpdateRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordLifecycleUpdateRequest",
        "description": "Request body for partially updating an existing record lifecycle. Only the fields included are modified. Supports updating the lifecycle name, status nodes, transitions, and node positions.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier for the lifecycle"
              },
              "type": {
                "type": "string",
                "enum": [
                  "recordLifecycles"
                ]
              },
              "attributes": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "statuses": {
                    "type": "array",
                    "description": "The lifecycle statuses",
                    "items": {
                      "$ref": "#/components/schemas/RecordLifecycleStatusAttributes"
                    }
                  },
                  "transitions": {
                    "type": "array",
                    "description": "The lifecycle transitions",
                    "items": {
                      "$ref": "#/components/schemas/RecordLifecycleTransitionAttributes"
                    }
                  }
                }
              }
            },
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "IExternalDataFieldItem": {
        "type": "object",
        "description": "One external field resource",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "externalSynopses",
              "externalTitles",
              "externalPrimaryTitle",
              "externalReleaseYear",
              "externalReleaseDate",
              "externalRunLength",
              "externalCountryOfOrigin",
              "externalPrimarySpokenLanguage",
              "externalOriginalLanguage",
              "externalGenre",
              "externalKeyword"
            ],
            "description": "Discriminator for item shape"
          },
          "id": {
            "type": "string",
            "description": "Stable compound id: recordId:provider:itemKey"
          },
          "attributes": {
            "type": "object",
            "description": "Item fields (varies by type)",
            "properties": {
              "field": {
                "type": "string",
                "enum": [
                  "synopses",
                  "titles",
                  "primaryTitle",
                  "releaseYear",
                  "releaseDate",
                  "runLength",
                  "countriesOfOrigin",
                  "primarySpokenLanguage",
                  "originalLanguage",
                  "genres",
                  "keywords"
                ],
                "description": "Field group this item belongs to"
              },
              "value": {
                "type": "string",
                "description": "Primary value for this item (title text, synopsis body, year, date, duration, language code, etc.)"
              },
              "language": {
                "type": "string",
                "description": "Locale / language tag (present on synopses and titles)"
              },
              "source": {
                "type": "string",
                "description": "Provider (e.g. Origin)"
              },
              "attribution": {
                "type": "string",
                "description": "Attribution / credit for the source value"
              },
              "synopsisType": {
                "type": "string",
                "description": "Synopsis kind (e.g. short, long, log line)"
              },
              "titleType": {
                "type": "string",
                "description": "Title kind (e.g. primary, alternative)"
              },
              "country": {
                "type": "string",
                "description": "ISO 3166-1 alpha-2 country code"
              },
              "characterCount": {
                "type": "integer",
                "description": "Character length of the value for UI hints"
              },
              "key": {
                "type": "string",
                "description": "Sub-key disambiguating multi-valued items"
              }
            },
            "required": [
              "field",
              "source"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "id",
          "attributes"
        ],
        "additionalProperties": false
      },
      "ExternalDataFieldsFindManyResponse": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "IExternalDataFieldsFindManyResponse",
        "title": "IExternalDataFieldsFindManyResponse",
        "description": "JSON:API 1.1 document for external field data from a provider (e.g., Origin). Primary data is a flat collection of typed field resources.",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "description": "Flat collection of external field resources for this record + provider",
            "items": {
              "$ref": "#/components/schemas/IExternalDataFieldItem"
            }
          },
          "meta": {
            "type": "object",
            "description": "Document-level meta for the external data request",
            "properties": {
              "total": {
                "type": "integer",
                "description": "Total number of field items returned"
              },
              "provider": {
                "type": "string",
                "enum": [
                  "OriginNexus",
                  "IMDB",
                  "EIDR",
                  "Gracenote"
                ],
                "description": "Provider identifier"
              },
              "availableLocales": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Locale codes that have data in at least one external source (synopses or titles)"
              }
            },
            "required": [
              "total",
              "provider"
            ]
          },
          "jsonapi": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "description": "JSON:API version"
              }
            },
            "required": [
              "version"
            ]
          },
          "links": {
            "type": "object",
            "description": "JSON:API document-level links"
          },
          "included": {
            "type": "array",
            "description": "JSON:API sideloaded resources",
            "items": {
              "type": "object"
            }
          }
        },
        "required": [
          "data",
          "meta",
          "jsonapi"
        ],
        "$defs": {
          "IExternalDataFieldItem": {
            "type": "object",
            "description": "One external field resource",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "externalSynopses",
                  "externalTitles",
                  "externalPrimaryTitle",
                  "externalReleaseYear",
                  "externalReleaseDate",
                  "externalRunLength",
                  "externalCountryOfOrigin",
                  "externalPrimarySpokenLanguage",
                  "externalOriginalLanguage",
                  "externalGenre",
                  "externalKeyword"
                ],
                "description": "Discriminator for item shape"
              },
              "id": {
                "type": "string",
                "description": "Stable compound id: recordId:provider:itemKey"
              },
              "attributes": {
                "type": "object",
                "description": "Item fields (varies by type)",
                "properties": {
                  "field": {
                    "type": "string",
                    "enum": [
                      "synopses",
                      "titles",
                      "primaryTitle",
                      "releaseYear",
                      "releaseDate",
                      "runLength",
                      "countriesOfOrigin",
                      "primarySpokenLanguage",
                      "originalLanguage",
                      "genres",
                      "keywords"
                    ],
                    "description": "Field group this item belongs to"
                  },
                  "value": {
                    "type": "string",
                    "description": "Primary value for this item (title text, synopsis body, year, date, duration, language code, etc.)"
                  },
                  "language": {
                    "type": "string",
                    "description": "Locale / language tag (present on synopses and titles)"
                  },
                  "source": {
                    "type": "string",
                    "description": "Provider (e.g. Origin)"
                  },
                  "attribution": {
                    "type": "string",
                    "description": "Attribution / credit for the source value"
                  },
                  "synopsisType": {
                    "type": "string",
                    "description": "Synopsis kind (e.g. short, long, log line)"
                  },
                  "titleType": {
                    "type": "string",
                    "description": "Title kind (e.g. primary, alternative)"
                  },
                  "country": {
                    "type": "string",
                    "description": "ISO 3166-1 alpha-2 country code"
                  },
                  "characterCount": {
                    "type": "integer",
                    "description": "Character length of the value for UI hints"
                  },
                  "key": {
                    "type": "string",
                    "description": "Sub-key disambiguating multi-valued items"
                  }
                },
                "required": [
                  "field",
                  "source"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "id",
              "attributes"
            ],
            "additionalProperties": false
          }
        }
      },
      "RecordAddSecurityTagsRelationshipRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordAddSecurityTagsRelationshipRequest",
        "description": "Request body for adding security tags to a record relationship",
        "type": "object",
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "type"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "securityTags"
                  ]
                }
              }
            }
          }
        }
      },
      "RecordDeleteSecurityTagsRelationshipRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRecordDeleteSecurityTagsRelationshipRequest",
        "description": "Request body for removing security tags from a record relationship",
        "type": "object",
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "type"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "securityTags"
                  ]
                }
              }
            }
          }
        }
      },
      "TenantAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantAttributes",
        "description": "Tenant profile: display name (fullName), key, plan, and optional contact info.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "fullName",
          "key",
          "plan"
        ],
        "properties": {
          "fullName": {
            "type": "string",
            "description": "Display name for the tenant (e.g. studio or company name)."
          },
          "contactInfo": {
            "type": "object",
            "description": "Optional contact details for the tenant.",
            "properties": {
              "email": {
                "type": "string"
              },
              "phone": {
                "type": "string"
              },
              "address": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "key": {
            "type": "string",
            "description": "Unique key identifying the tenant (used in URLs and references)."
          },
          "description": {
            "type": "string"
          },
          "policyStoreId": {
            "type": "string"
          },
          "auth0OrganizationId": {
            "type": "string",
            "description": "The linked identity provider organization ID for this tenant."
          },
          "plan": {
            "type": "string",
            "description": "Subscription plan (e.g. pro, team, enterprise)."
          },
          "planQuota": {
            "type": "object",
            "description": "Resource quotas for the tenant plan.",
            "properties": {
              "userCount": {
                "type": "number",
                "description": "Maximum number of users allowed for the tenant."
              },
              "recordCount": {
                "type": "number",
                "description": "Maximum number of records allowed for the tenant."
              },
              "deliveryRecordCount": {
                "type": "number",
                "description": "Maximum number of delivery records allowed for the tenant."
              },
              "apiCallCount": {
                "type": "number",
                "description": "Maximum number of API calls allowed per month."
              },
              "mediaStorageBytes": {
                "type": "number",
                "description": "Maximum media storage in bytes."
              }
            },
            "additionalProperties": false
          },
          "audit": {
            "type": "object",
            "description": "Audit log settings for the tenant.",
            "properties": {
              "retention": {
                "type": "object",
                "description": "Retention policy for audit log files.",
                "required": [
                  "days"
                ],
                "properties": {
                  "days": {
                    "type": "number",
                    "description": "Number of days to retain audit log files. Must be one of the allowed values: 1, 30, 60, 90, 365, 730, 1095, 1460, 1825, 2555."
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false,
            "required": [
              "retention"
            ]
          }
        }
      },
      "TenantRelationships": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantRelationships",
        "description": "JSON:API relationship links for a tenant resource. `author` identifies the user who created the tenant; `updatedBy` identifies the user who last modified it (both with display name and tenant context in meta).",
        "type": "object",
        "properties": {
          "author": {
            "type": "object",
            "required": [
              "data"
            ],
            "additionalProperties": false,
            "properties": {
              "data": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "meta"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "users"
                    ]
                  },
                  "meta": {
                    "type": "object",
                    "required": [
                      "tenantId",
                      "type",
                      "displayName"
                    ],
                    "properties": {
                      "tenantId": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      },
                      "displayName": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "updatedBy": {
            "type": "object",
            "required": [
              "data"
            ],
            "additionalProperties": false,
            "properties": {
              "data": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "meta"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "users"
                    ]
                  },
                  "meta": {
                    "type": "object",
                    "required": [
                      "tenantId",
                      "type",
                      "displayName"
                    ],
                    "properties": {
                      "tenantId": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      },
                      "displayName": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "additionalProperties": false
      },
      "GetTenantResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantFindOneResponse",
        "description": "The response for a tenant find one request.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "tenants"
                ]
              },
              "attributes": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BaseResourceAttributes"
                  },
                  {
                    "$ref": "#/components/schemas/TenantAttributes",
                    "required": [
                      "fullName",
                      "key",
                      "plan"
                    ]
                  }
                ]
              },
              "relationships": {
                "$ref": "#/components/schemas/TenantRelationships"
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "CreateTenantRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantCreateRequest",
        "description": "Request body to create a tenant. Uses JSON:API format with attributes (fullName, key, plan, etc.).",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseCreateRequest"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "attributes": {
                    "type": "object",
                    "required": [
                      "fullName",
                      "contactInfo",
                      "key",
                      "description",
                      "plan",
                      "planQuota"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "fullName": {
                        "type": "string"
                      },
                      "contactInfo": {
                        "type": "object",
                        "required": [
                          "email"
                        ],
                        "properties": {
                          "email": {
                            "type": "string"
                          },
                          "phone": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      },
                      "key": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "auth0UserId": {
                        "type": "string",
                        "description": "Optional Auth0 user ID to add to the organization. If provided, this user will be added to the tenant's Auth0 organization."
                      },
                      "shouldCreateUsagePlan": {
                        "type": "boolean"
                      },
                      "audit": {
                        "type": "object",
                        "description": "Audit log settings for the tenant.",
                        "properties": {
                          "retention": {
                            "type": "object",
                            "description": "Retention policy for audit log files.",
                            "required": [
                              "days"
                            ],
                            "properties": {
                              "days": {
                                "type": "number",
                                "description": "Number of days to retain audit log files. Must be one of: 1, 30, 60, 90, 365, 730, 1095, 1460, 1825, 2555. Defaults to 30 when omitted."
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "additionalProperties": false,
                        "required": [
                          "retention"
                        ]
                      },
                      "organizationId": {
                        "type": "string",
                        "description": "Optional Auth0 organization id. When set, the tenant is linked to this pre-provisioned organization (it must exist). When omitted, an Auth0 organization is created with name equal to the tenant key and display_name equal to fullName, unless that organization name is already in use."
                      },
                      "plan": {
                        "type": "string",
                        "enum": [
                          "pro",
                          "team",
                          "enterprise"
                        ]
                      },
                      "planQuota": {
                        "type": "object",
                        "description": "Resource quotas for the tenant plan",
                        "required": [
                          "userCount",
                          "recordCount",
                          "deliveryRecordCount",
                          "apiCallCount",
                          "mediaStorageBytes"
                        ],
                        "additionalProperties": false,
                        "properties": {
                          "userCount": {
                            "type": "number",
                            "description": "Maximum number of users allowed for the tenant"
                          },
                          "recordCount": {
                            "type": "number",
                            "description": "Maximum number of records allowed for the tenant"
                          },
                          "deliveryRecordCount": {
                            "type": "number",
                            "description": "Maximum number of delivery records allowed for the tenant"
                          },
                          "apiCallCount": {
                            "type": "number",
                            "description": "Maximum number of API calls allowed per month"
                          },
                          "mediaStorageBytes": {
                            "type": "number",
                            "description": "Maximum media storage in bytes"
                          }
                        }
                      }
                    }
                  }
                },
                "required": [
                  "id",
                  "attributes"
                ]
              }
            ]
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "data": {
              "type": "tenants",
              "attributes": {
                "fullName": "Acme Studio",
                "contactInfo": {
                  "email": "admin@example.com"
                },
                "key": "acme",
                "description": "Example tenant",
                "organizationId": "org_example",
                "plan": "team",
                "planQuota": {
                  "userCount": 100,
                  "recordCount": 1000000,
                  "deliveryRecordCount": 100000,
                  "apiCallCount": 1000000,
                  "mediaStorageBytes": 1099776
                }
              }
            }
          },
          {
            "data": {
              "type": "tenants",
              "attributes": {
                "fullName": "Beta Studio",
                "contactInfo": {
                  "email": "admin@beta.example.com"
                },
                "key": "beta",
                "description": "Tenant with Auth0 organization created automatically",
                "plan": "team",
                "planQuota": {
                  "userCount": 50,
                  "recordCount": 500000,
                  "deliveryRecordCount": 50000,
                  "apiCallCount": 500000,
                  "mediaStorageBytes": 1099776
                }
              }
            }
          }
        ]
      },
      "TenantCreateOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantCreateOneResponse",
        "description": "The response for a tenant create one request.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "tenants"
                ]
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "UpdateTenantRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantUpdateRequest",
        "description": "The request to update a tenant.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "tenants"
                ]
              },
              "attributes": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "fullName": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "contactInfo": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "email": {
                        "type": "string"
                      },
                      "phone": {
                        "type": "string"
                      },
                      "address": {
                        "type": "string"
                      }
                    }
                  },
                  "plan": {
                    "type": "string",
                    "enum": [
                      "pro",
                      "team",
                      "enterprise"
                    ]
                  },
                  "planQuota": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "userCount": {
                        "type": "number"
                      },
                      "recordCount": {
                        "type": "number"
                      },
                      "deliveryRecordCount": {
                        "type": "number"
                      },
                      "apiCallCount": {
                        "type": "number"
                      },
                      "mediaStorageBytes": {
                        "type": "number"
                      }
                    }
                  },
                  "audit": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "retention"
                    ],
                    "properties": {
                      "retention": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "days"
                        ],
                        "properties": {
                          "days": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "TenantFeatureAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantFeatureAttributes",
        "description": "Effective state of one entitlement-governed feature for one tenant. `granted` is decided by the tenant's plan and `enabled` by the tenant's own admins; `effective` is the conjunction and is the only value UI and handlers should gate on. Features the plan does not grant are still returned, flagged rather than omitted, so they can be surfaced as an upsell.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "granted",
          "enabled",
          "effective"
        ],
        "properties": {
          "granted": {
            "type": "boolean",
            "description": "The tenant's plan offers this feature."
          },
          "enabled": {
            "type": "boolean",
            "description": "The tenant has activated this feature. Activation is permanent in v1: there is no deactivation path."
          },
          "effective": {
            "type": "boolean",
            "description": "Both granted and enabled. The value to gate behaviour on."
          },
          "availableOn": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "pro",
                "team",
                "enterprise"
              ]
            },
            "description": "Plans that offer this feature. Omitted when every plan offers it. An empty array means the feature has been withdrawn from all plans."
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "description": "When the tenant activated the feature. Absent until activation."
          },
          "updated": {
            "type": "string",
            "format": "date-time",
            "description": "When the activation was last modified. Absent until activation."
          }
        }
      },
      "TenantFeatureResource": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantFeatureResource",
        "description": "A JSON:API resource object for one entitlement-governed feature. The resource `id` is the feature's registry key.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "type",
          "attributes"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The feature's registry key."
          },
          "type": {
            "type": "string",
            "enum": [
              "features"
            ]
          },
          "attributes": {
            "$ref": "#/components/schemas/TenantFeatureAttributes"
          },
          "relationships": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "author": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "data"
                ],
                "description": "Who activated the feature. Absent until activation.",
                "properties": {
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id",
                      "type",
                      "meta"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "users"
                        ]
                      },
                      "meta": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "tenantId",
                          "type",
                          "displayName"
                        ],
                        "properties": {
                          "tenantId": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "links": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "related": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "self": {
                "type": "string"
              }
            }
          }
        }
      },
      "TenantFeatureFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantFeatureFindManyResponse",
        "description": "The response for a tenant feature find many request. Returns every registered feature, including those the tenant's plan does not grant. An empty array means no feature is governed by entitlements yet.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TenantFeatureResource"
            }
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            }
          }
        }
      },
      "UpdateTenantFeatureRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IUpdateTenantFeatureRequest",
        "description": "The request to activate a feature for a tenant. Activation is forward-only in v1, so `enabled` may only be `true`; sending `false` is rejected by validation rather than silently ignored. Deactivation is a v2 concern, at which point the constraint on `enabled` is relaxed.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "attributes"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "features"
                ]
              },
              "attributes": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "enabled"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "const": true,
                    "description": "Must be true. Activation cannot be undone in v1."
                  }
                }
              }
            }
          }
        }
      },
      "TenantFeatureFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantFeatureFindOneResponse",
        "description": "The response for a single tenant feature, returned after activation.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/TenantFeatureResource"
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            }
          }
        }
      },
      "TenantFeatureActivationAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantFeatureActivationAttributes",
        "description": "One tenant's row in the internal portfolio readout: who they are, what they pay for, and the effective state of every registered feature.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenantKey",
          "plan",
          "features"
        ],
        "properties": {
          "tenantKey": {
            "type": "string",
            "description": "The tenant's human-readable key."
          },
          "plan": {
            "type": "string",
            "enum": [
              "pro",
              "team",
              "enterprise"
            ],
            "description": "The tenant's plan, which decides what is granted."
          },
          "features": {
            "type": "array",
            "description": "Effective state per registered feature for this tenant.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "featureKey",
                "granted",
                "enabled",
                "effective"
              ],
              "properties": {
                "featureKey": {
                  "type": "string"
                },
                "granted": {
                  "type": "boolean"
                },
                "enabled": {
                  "type": "boolean"
                },
                "effective": {
                  "type": "boolean"
                },
                "activatedAt": {
                  "type": "string",
                  "format": "date-time",
                  "description": "When this tenant activated the feature. Absent until activation."
                }
              }
            }
          }
        }
      },
      "TenantFeatureActivationFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantFeatureActivationFindManyResponse",
        "description": "Cross-tenant activation state for every registered feature, for Fabric staff only. One resource per tenant, whose `id` is the tenant id. Used for the internal portfolio readout of which clients have activated what.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "type",
                "attributes"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The tenant id."
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "tenantFeatureActivations"
                  ]
                },
                "attributes": {
                  "$ref": "#/components/schemas/TenantFeatureActivationAttributes"
                }
              }
            }
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            }
          }
        }
      },
      "PolicyTemplateAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IPolicyTemplateAttributes",
        "description": "The attributes for a policy template.",
        "additionalProperties": false,
        "required": [
          "resourceType",
          "name",
          "label",
          "actions"
        ],
        "type": "object",
        "properties": {
          "resourceType": {
            "type": "string",
            "enum": [
              "record",
              "contributor",
              "delivery",
              "bulkActions"
            ],
            "description": "The resource type this template targets"
          },
          "name": {
            "type": "string",
            "description": "The name of the policy template, cannot be changed after creation"
          },
          "label": {
            "type": "string",
            "description": "The display label for the policy template"
          },
          "description": {
            "type": "string",
            "description": "The description of the policy template"
          },
          "actions": {
            "type": "array",
            "description": "The actions allowed by this policy template",
            "items": {
              "type": "string"
            }
          },
          "locales": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "workTypeEntityAccess": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "creditsAccess": {
                  "type": "boolean"
                },
                "mediaAccess": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "externalDataAccess": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            }
          },
          "workTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkTypes"
            }
          },
          "lifecyclePhases": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "drafting",
                "published"
              ]
            }
          },
          "workTypeLifecycleAccess": {
            "type": "object",
            "description": "Per-work-type lifecycle status access, keyed by work type. Requires the statusBasedPermissions entitlement. Its presence makes the policy status-based; lifecyclePhases is then derived from these statuses. Status ids are not unique across work types, which is why this is keyed by work type.",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "sectionIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createSources": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "custom",
                "origin"
              ]
            }
          },
          "updateTypes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "regular",
                "publish"
              ]
            }
          }
        }
      },
      "PolicyTemplateRelationships": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "title": "IPolicyTemplateRelationships",
        "properties": {
          "tenant": {
            "$ref": "#/components/schemas/TenantRelationship"
          }
        },
        "required": [
          "tenant"
        ],
        "additionalProperties": false
      },
      "PolicyTemplateFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IPolicyTemplateFindManyResponse",
        "description": "The response for a policy template find many request.",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "type",
                "attributes",
                "relationships"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "policyTemplates"
                  ]
                },
                "attributes": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/BaseResourceAttributes"
                    },
                    {
                      "$ref": "#/components/schemas/PolicyTemplateAttributes"
                    }
                  ]
                },
                "relationships": {
                  "$ref": "#/components/schemas/PolicyTemplateRelationships"
                },
                "meta": {
                  "type": "object",
                  "properties": {
                    "tenantId": {
                      "type": "string",
                      "description": "The tenant ID"
                    }
                  },
                  "required": [
                    "tenantId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "CreatePolicyTemplateRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IPolicyTemplateCreateRequest",
        "description": "The request for creating a policy template.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "attributes"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "policyTemplates"
                ]
              },
              "attributes": {
                "$ref": "#/components/schemas/PolicyTemplateAttributes"
              }
            }
          }
        }
      },
      "PolicyTemplateCreateOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "title": "IPolicyTemplateCreateOneResponse",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "policyTemplates"
                ]
              },
              "attributes": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BaseResourceAttributes"
                  },
                  {
                    "$ref": "#/components/schemas/PolicyTemplateAttributes"
                  }
                ]
              },
              "relationships": {
                "$ref": "#/components/schemas/PolicyTemplateRelationships"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "tenantId": {
                    "type": "string",
                    "description": "The tenant ID"
                  }
                },
                "required": [
                  "tenantId"
                ],
                "additionalProperties": false
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "PolicyTemplateFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IPolicyTemplateFindOneResponse",
        "description": "The response for a policy template find one request.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes",
              "relationships"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "policyTemplates"
                ]
              },
              "attributes": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BaseResourceAttributes"
                  },
                  {
                    "$ref": "#/components/schemas/PolicyTemplateAttributes"
                  }
                ]
              },
              "relationships": {
                "$ref": "#/components/schemas/PolicyTemplateRelationships"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "tenantId": {
                    "type": "string",
                    "description": "The tenant ID"
                  },
                  "assignmentsCount": {
                    "type": "number",
                    "description": "Number of active assignments for this template"
                  }
                },
                "required": [
                  "tenantId"
                ],
                "additionalProperties": false
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "PolicyTemplateUpdateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IPolicyTemplateUpdateOneRequest",
        "description": "The request for a policy template update request.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "policyTemplates"
                ]
              },
              "attributes": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "actions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "locales": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "workTypeEntityAccess": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "creditsAccess": {
                          "type": "boolean"
                        },
                        "mediaAccess": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "externalDataAccess": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "workTypes": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/WorkTypes"
                    }
                  },
                  "lifecyclePhases": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "drafting",
                        "published"
                      ]
                    }
                  },
                  "workTypeLifecycleAccess": {
                    "type": "object",
                    "description": "Per-work-type lifecycle status access, keyed by work type. Requires the statusBasedPermissions entitlement.",
                    "additionalProperties": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "sectionIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "createSources": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "custom",
                        "origin"
                      ]
                    }
                  },
                  "updateTypes": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "regular",
                        "publish"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "PolicyTemplateUpdateOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IPolicyTemplateUpdateOneResponse",
        "description": "The response for a policy template update one request.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes",
              "relationships"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "policyTemplates"
                ]
              },
              "attributes": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BaseResourceAttributes"
                  },
                  {
                    "$ref": "#/components/schemas/PolicyTemplateAttributes"
                  }
                ]
              },
              "relationships": {
                "$ref": "#/components/schemas/PolicyTemplateRelationships"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "tenantId": {
                    "type": "string",
                    "description": "The tenant ID"
                  }
                },
                "required": [
                  "tenantId"
                ],
                "additionalProperties": false
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "PolicyAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IPolicyAttributes",
        "description": "The attributes for a policy.",
        "additionalProperties": false,
        "required": [
          "resourceType"
        ],
        "type": "object",
        "properties": {
          "resourceType": {
            "type": "string",
            "enum": [
              "record",
              "contributor",
              "delivery",
              "bulkActions"
            ],
            "description": "The resource type this policy applies to"
          }
        }
      },
      "RoleRelationship": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRoleRelationship",
        "description": "A relationship to a role",
        "type": "object",
        "properties": {
          "data": {
            "additionalProperties": false,
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "userRoles"
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          "links": {
            "$ref": "#/components/schemas/LinksRelated"
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "PolicyTemplateRelationship": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IPolicyTemplateRelationship",
        "description": "A relationship to a policy template",
        "type": "object",
        "properties": {
          "data": {
            "additionalProperties": false,
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "policyTemplates"
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          "links": {
            "$ref": "#/components/schemas/LinksRelated"
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "SecurityTagRelationship": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ISecurityTagRelationship",
        "description": "A relationship to a security tag",
        "type": "object",
        "properties": {
          "data": {
            "additionalProperties": false,
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "securityTags"
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          "links": {
            "$ref": "#/components/schemas/LinksRelated"
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "PolicyRelationships": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "title": "IPolicyRelationships",
        "description": "Relationships for a policy: tenant, role, and security tag.",
        "properties": {
          "tenant": {
            "$ref": "#/components/schemas/TenantRelationship"
          },
          "role": {
            "$ref": "#/components/schemas/RoleRelationship"
          },
          "template": {
            "$ref": "#/components/schemas/PolicyTemplateRelationship"
          },
          "securityTag": {
            "$ref": "#/components/schemas/SecurityTagRelationship"
          }
        },
        "required": [
          "tenant",
          "role"
        ],
        "additionalProperties": false
      },
      "PolicyFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IPolicyFindManyResponse",
        "description": "The response for a policy find many request.",
        "additionalProperties": false,
        "required": [
          "data",
          "links",
          "included"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "type",
                "attributes",
                "relationships"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "policies"
                  ]
                },
                "attributes": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/BaseResourceAttributes"
                    },
                    {
                      "$ref": "#/components/schemas/PolicyAttributes"
                    }
                  ]
                },
                "relationships": {
                  "$ref": "#/components/schemas/PolicyRelationships"
                },
                "meta": {
                  "type": "object",
                  "properties": {
                    "tenantId": {
                      "type": "string",
                      "description": "The tenant ID"
                    }
                  },
                  "required": [
                    "tenantId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              },
              "next": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "included": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "type",
                "attributes",
                "relationships"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "policyTemplates"
                  ]
                },
                "attributes": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/BaseResourceAttributes"
                    },
                    {
                      "$ref": "#/components/schemas/PolicyTemplateAttributes"
                    }
                  ]
                },
                "relationships": {
                  "$ref": "#/components/schemas/PolicyTemplateRelationships"
                },
                "meta": {
                  "type": "object",
                  "properties": {
                    "tenantId": {
                      "type": "string",
                      "description": "The tenant ID"
                    }
                  },
                  "required": [
                    "tenantId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "meta": {
            "type": "object",
            "properties": {
              "cursor": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          }
        }
      },
      "AssignPolicyTemplateRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IAssignPolicyTemplateRequest",
        "description": "Request to create policies from a template for given roles and optional security tags.",
        "type": "object",
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "required": [
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "policies"
                ]
              },
              "attributes": {
                "type": "object",
                "required": [
                  "roleIds"
                ],
                "additionalProperties": false,
                "properties": {
                  "roleIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "description": "Role IDs to assign"
                  },
                  "securityTagIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Security tag IDs (required for record type, ignored for contributor/delivery)"
                  }
                }
              }
            }
          }
        }
      },
      "PolicyFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IPolicyFindOneResponse",
        "description": "The response for a policy find one request.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes",
              "relationships"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "policies"
                ]
              },
              "attributes": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BaseResourceAttributes"
                  },
                  {
                    "$ref": "#/components/schemas/PolicyAttributes"
                  }
                ]
              },
              "relationships": {
                "$ref": "#/components/schemas/PolicyRelationships"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "tenantId": {
                    "type": "string",
                    "description": "The tenant ID"
                  },
                  "avpPolicy": {
                    "type": "object",
                    "description": "The AVP policy details",
                    "properties": {
                      "resource": {
                        "type": "object",
                        "properties": {
                          "entityType": {
                            "type": "string"
                          },
                          "entityId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "entityType",
                          "entityId"
                        ],
                        "additionalProperties": false
                      },
                      "principal": {
                        "type": "object",
                        "properties": {
                          "entityType": {
                            "type": "string"
                          },
                          "entityId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "entityType",
                          "entityId"
                        ],
                        "additionalProperties": false
                      },
                      "actions": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "actionType": {
                              "type": "string"
                            },
                            "actionId": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "actionType",
                            "actionId"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "effect": {
                        "type": "string",
                        "enum": [
                          "Permit",
                          "Forbid"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "tenantId"
                ],
                "additionalProperties": false
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "policyRefObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "const": "policies"
          }
        },
        "required": [
          "id",
          "type"
        ],
        "additionalProperties": false
      },
      "PolicyAtomicOperationsRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IPolicyAtomicOperationsRequest",
        "description": "JSON:API Atomic Operations request for managing policies. Supports `remove` operations to delete one or more policies in a single call.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "atomic:operations": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "properties": {
                "op": {
                  "const": "remove"
                },
                "ref": {
                  "$ref": "#/components/schemas/policyRefObject"
                }
              },
              "required": [
                "op",
                "ref"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "atomic:operations"
        ],
        "additionalProperties": false,
        "definitions": {
          "policyRefObject": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "const": "policies"
              }
            },
            "required": [
              "id",
              "type"
            ],
            "additionalProperties": false
          }
        }
      },
      "SecurityTagAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ISecurityTagAttributes",
        "description": "The attributes of a security tag in a tenant.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "description",
          "name"
        ],
        "properties": {
          "description": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "SecurityTagFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ISecurityTagFindManyResponse",
        "description": "The response for a security tag find many request.",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/BaseResource"
                },
                {
                  "type": "object",
                  "properties": {
                    "attributes": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/BaseResourceAttributes"
                        },
                        {
                          "$ref": "#/components/schemas/SecurityTagAttributes"
                        }
                      ]
                    }
                  },
                  "required": [
                    "attributes"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "CreateSecurityTagRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ISecurityTagCreateRequest",
        "description": "The request to create a security tag in a tenant.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "attributes"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "securityTags"
                ]
              },
              "attributes": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "description": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "description",
                  "name"
                ]
              }
            }
          }
        }
      },
      "SecurityTagCreateOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "title": "ISecurityTagCreateOneResponse",
        "description": "Response after creating a security tag. Contains the new security tag resource and self link.",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseResource"
              },
              {
                "type": "object",
                "properties": {
                  "attributes": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/BaseResourceAttributes"
                      },
                      {
                        "$ref": "#/components/schemas/SecurityTagAttributes",
                        "required": [
                          "description",
                          "name"
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "attributes"
                ],
                "additionalProperties": false
              }
            ]
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "required": [
              "self"
            ],
            "additionalProperties": false
          }
        }
      },
      "SecurityTagFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ISecurityTagFindOneResponse",
        "description": "The response for a security tag find one request.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "securityTags"
                ]
              },
              "attributes": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BaseResourceAttributes"
                  },
                  {
                    "$ref": "#/components/schemas/SecurityTagAttributes",
                    "required": [
                      "description"
                    ]
                  }
                ]
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "UpdateSecurityTagRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ISecurityTagUpdateRequest",
        "description": "The request to update a security tag in a tenant.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "securityTags"
                ]
              },
              "attributes": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "ApiKeyAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IApiKeyAttributes",
        "description": "The attributes of an api key in a tenant. The raw key value is never returned here — it is available only in the create response, which uses ApiKeyCreateAttributes.json.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "description",
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "valuePreview": {
            "description": "Masked, non-secret preview of the key value, e.g. ak_prd_••••••••1a2b. Used to identify a key in a list.",
            "type": "string"
          },
          "expiresAt": {
            "description": "ISO 8601 timestamp after which the key is refused.",
            "type": "string"
          }
        }
      },
      "ApiKeyFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IApiKeyFindManyResponse",
        "description": "The response for a api key find many request.",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/BaseResource"
                },
                {
                  "type": "object",
                  "properties": {
                    "attributes": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/BaseResourceAttributes"
                        },
                        {
                          "$ref": "#/components/schemas/ApiKeyAttributes"
                        }
                      ]
                    }
                  },
                  "required": [
                    "attributes"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "CreateApiKeyRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IApiKeyCreateRequest",
        "description": "The request to create an api key in a tenant. Roles are specified via `relationships.roles` as an array of role resource identifiers.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "attributes",
              "relationships"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "apiKeys"
                ]
              },
              "attributes": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "description": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "expiresInDays": {
                    "description": "Validity window for the key. The key stops authenticating once this many days have passed since creation. Defaults to 90 when omitted.",
                    "type": "integer",
                    "enum": [
                      30,
                      60,
                      90,
                      180,
                      365
                    ]
                  }
                },
                "required": [
                  "description",
                  "name"
                ]
              },
              "relationships": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "roles"
                ],
                "properties": {
                  "roles": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "data"
                    ],
                    "properties": {
                      "data": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "id",
                            "type"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "userRoles"
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "ApiKeyCreateAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IApiKeyCreateAttributes",
        "description": "Attributes returned when an API key is created. This is the only response that carries the raw key value — it is stored only as a hash, so it cannot be retrieved again. Clients must surface it to the user immediately.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "description",
          "name",
          "value"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "value": {
            "description": "The raw API key, shown exactly once. Format: ak_<env>_<32 hex chars>.",
            "type": "string"
          },
          "valuePreview": {
            "description": "Masked, non-secret preview of the key value, e.g. ak_prd_••••••••1a2b.",
            "type": "string"
          },
          "expiresAt": {
            "description": "ISO 8601 timestamp after which the key is refused.",
            "type": "string"
          }
        }
      },
      "ApiKeyCreateOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "title": "IApiKeyCreateOneResponse",
        "description": "Response after creating an API key. Contains the new API key resource and self link. This is the only response that includes the raw key value.",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseResource"
              },
              {
                "type": "object",
                "properties": {
                  "attributes": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/BaseResourceAttributes"
                      },
                      {
                        "$ref": "#/components/schemas/ApiKeyCreateAttributes",
                        "required": [
                          "description",
                          "name",
                          "value"
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "attributes"
                ],
                "additionalProperties": false
              }
            ]
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "required": [
              "self"
            ],
            "additionalProperties": false
          }
        }
      },
      "ApiKeyFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IApiKeyFindOneResponse",
        "description": "The response for a api key find one request.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "apiKeys"
                ]
              },
              "attributes": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BaseResourceAttributes"
                  },
                  {
                    "$ref": "#/components/schemas/ApiKeyAttributes",
                    "required": [
                      "description"
                    ]
                  }
                ]
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "AiAssistantConfigAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IAiAssistantConfigAttributes",
        "description": "Per-tenant AI assistant settings (read-only view). Shows which model provider is configured, the selected model, and whether an API key is stored.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "modelProvider",
          "modelId",
          "apiKeyConfigured",
          "created",
          "updated"
        ],
        "properties": {
          "modelProvider": {
            "type": "string",
            "enum": [
              "bedrock",
              "custom"
            ],
            "description": "The model provider type. 'bedrock' uses a Fabric-provided model. 'custom' uses a model and API key you provide."
          },
          "modelId": {
            "type": "string",
            "minLength": 1,
            "description": "The model identifier. For custom providers this is the string LiteLLM routes on, normally provider-qualified (e.g. anthropic/claude-sonnet-4); for bedrock it is the Fabric-managed Bedrock model id."
          },
          "apiKeyConfigured": {
            "type": "boolean",
            "description": "Whether an API key has been securely stored for this configuration."
          },
          "apiKeyArn": {
            "type": "string",
            "description": "Reference to the stored API key. The raw key is never returned. Omitted when apiKeyConfigured is false."
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "description": "When this configuration was created"
          },
          "updated": {
            "type": "string",
            "format": "date-time",
            "description": "When this configuration was last updated"
          }
        }
      },
      "AiAssistantConfigFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IAiAssistantConfigFindManyResponse",
        "description": "The response for an AI assistant config find many request.",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/BaseResource"
                },
                {
                  "type": "object",
                  "properties": {
                    "attributes": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/BaseResourceAttributes"
                        },
                        {
                          "$ref": "#/components/schemas/AiAssistantConfigAttributes"
                        }
                      ]
                    }
                  },
                  "required": [
                    "attributes"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "CreateAiAssistantConfigAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreateAiAssistantConfigAttributes",
        "description": "Attributes for creating an AI assistant configuration. Choose modelProvider 'bedrock' for a Fabric-provided model, or 'custom' to bring your own model and API key.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "modelProvider"
        ],
        "properties": {
          "modelProvider": {
            "type": "string",
            "enum": [
              "bedrock",
              "custom"
            ],
            "description": "Model source: 'bedrock' uses a Fabric-provided model (no API key needed), 'custom' lets you bring your own model and API key."
          },
          "modelId": {
            "type": "string",
            "minLength": 1,
            "description": "The model to use, as LiteLLM routes on it — normally provider-qualified, e.g. anthropic/claude-sonnet-4. Required with 'custom' modelProvider."
          },
          "apiKey": {
            "type": "string",
            "description": "Write-only. Your provider API key. Stored securely and never returned in responses. Required with 'custom' modelProvider if apiKeyArn is not provided."
          },
          "apiKeyArn": {
            "type": "string",
            "description": "Reference to a previously stored API key. Use this instead of apiKey if your key is already registered."
          }
        }
      },
      "CreateAiAssistantConfigRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IAiAssistantConfigCreateRequest",
        "description": "The request to create the AI assistant config for a tenant. A tenant may only have one.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "attributes"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "aiAssistantConfigs"
                ]
              },
              "attributes": {
                "$ref": "#/components/schemas/CreateAiAssistantConfigAttributes"
              }
            }
          }
        }
      },
      "AiAssistantConfigCreateOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "title": "IAiAssistantConfigCreateOneResponse",
        "description": "Response after creating a tenant's AI assistant config. Contains the new resource and self link.",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseResource"
              },
              {
                "type": "object",
                "properties": {
                  "attributes": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/BaseResourceAttributes"
                      },
                      {
                        "$ref": "#/components/schemas/AiAssistantConfigAttributes"
                      }
                    ]
                  }
                },
                "required": [
                  "attributes"
                ],
                "additionalProperties": false
              }
            ]
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "required": [
              "self"
            ],
            "additionalProperties": false
          }
        }
      },
      "AiAssistantConfigFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IAiAssistantConfigFindOneResponse",
        "description": "The response for an AI assistant config find one request.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "aiAssistantConfigs"
                ]
              },
              "attributes": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BaseResourceAttributes"
                  },
                  {
                    "$ref": "#/components/schemas/AiAssistantConfigAttributes"
                  }
                ]
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "UpdateAiAssistantConfigRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IAiAssistantConfigUpdateRequest",
        "description": "Request to update the AI assistant configuration. All attributes are optional — only provided fields are modified.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "aiAssistantConfigs"
                ]
              },
              "attributes": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "modelProvider": {
                    "type": "string",
                    "enum": [
                      "bedrock",
                      "custom"
                    ],
                    "description": "Change the model provider type. Switching between 'bedrock' and 'custom' is supported."
                  },
                  "modelId": {
                    "type": "string",
                    "minLength": 1,
                    "description": "The model identifier, as LiteLLM routes on it — normally provider-qualified, e.g. anthropic/claude-sonnet-4."
                  },
                  "apiKey": {
                    "type": "string",
                    "description": "Write-only. Your provider API key. Stored securely and never returned. Use this to rotate an existing key."
                  },
                  "apiKeyArn": {
                    "type": "string",
                    "description": "Reference to a previously stored API key."
                  }
                }
              }
            }
          }
        }
      },
      "EventSubscriptionAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IEventSubscriptionAttributes",
        "description": "The attributes of a event subscription in a tenant.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "type",
          "endpoint",
          "subscriptionArn"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "endpoint": {
            "type": "string"
          },
          "subscriptionArn": {
            "type": "string"
          }
        }
      },
      "EventSubscriptionFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IEventSubscriptionFindManyResponse",
        "description": "The response for a event subscription find many request.",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/BaseResource"
                },
                {
                  "type": "object",
                  "properties": {
                    "attributes": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/BaseResourceAttributes"
                        },
                        {
                          "$ref": "#/components/schemas/EventSubscriptionAttributes"
                        }
                      ]
                    }
                  },
                  "required": [
                    "attributes"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "meta": {
            "type": "object",
            "properties": {
              "awsRegion": {
                "type": "string"
              },
              "awsAccountId": {
                "type": "string"
              },
              "tenantId": {
                "type": "string"
              },
              "awsSubscriptions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "subscriptionArn": {
                      "type": "string"
                    },
                    "pendingConfirmation": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "subscriptionArn",
                    "pendingConfirmation"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "awsRegion",
              "awsAccountId",
              "tenantId",
              " awsSubscriptions"
            ],
            "additionalProperties": false
          }
        }
      },
      "CreateEventSubscriptionRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IEventSubscriptionCreateOneRequest",
        "description": "The request to create an event subscription in a tenant.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "attributes"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "eventSubscriptions"
                ]
              },
              "attributes": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "endpoint": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "type",
                  "endpoint"
                ]
              }
            }
          }
        }
      },
      "EventSubscriptionCreateOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "title": "IEventSubscriptionCreateOneResponse",
        "description": "Response after creating an event subscription. Contains the new subscription resource and self link.",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseResource"
              },
              {
                "type": "object",
                "properties": {
                  "attributes": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/BaseResourceAttributes"
                      },
                      {
                        "$ref": "#/components/schemas/EventSubscriptionAttributes",
                        "required": [
                          "name",
                          "type",
                          "endpoint"
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "attributes"
                ],
                "additionalProperties": false
              }
            ]
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "required": [
              "self"
            ],
            "additionalProperties": false
          }
        }
      },
      "EventSubscriptionFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IEventSubscriptionFindOneResponse",
        "description": "The response for a event subscription find one request.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "eventSubscriptions"
                ]
              },
              "attributes": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BaseResourceAttributes"
                  },
                  {
                    "$ref": "#/components/schemas/EventSubscriptionAttributes"
                  }
                ]
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "ITenantFullDeleteJobParameters": {
        "type": "object",
        "properties": {
          "tenantIdToDelete": {
            "type": "string",
            "description": "The ID of the tenant to delete"
          }
        },
        "required": [
          "tenantIdToDelete"
        ],
        "additionalProperties": false
      },
      "ITenantSyncSystemPoliciesJobParameters": {
        "type": "object",
        "properties": {
          "tenantIdToSync": {
            "type": "string",
            "description": "Optional: sync only this tenant instead of all tenants"
          }
        },
        "additionalProperties": false
      },
      "TenantJobCreateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantJobCreateOneRequest",
        "description": "Request body to create a tenant background job. Specify job type and parameters.",
        "type": "object",
        "definitions": {
          "ITenantFullDeleteJobParameters": {
            "type": "object",
            "properties": {
              "tenantIdToDelete": {
                "type": "string",
                "description": "The ID of the tenant to delete"
              }
            },
            "required": [
              "tenantIdToDelete"
            ],
            "additionalProperties": false
          },
          "ITenantSyncSystemPoliciesJobParameters": {
            "type": "object",
            "properties": {
              "tenantIdToSync": {
                "type": "string",
                "description": "Optional: sync only this tenant instead of all tenants"
              }
            },
            "additionalProperties": false
          }
        },
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseCreateRequest"
              },
              {
                "type": "object",
                "properties": {
                  "attributes": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "fullTenantDelete",
                          "syncSystemPolicies"
                        ],
                        "description": "The type of tenant job to create",
                        "example": "fullTenantDelete"
                      },
                      "parameters": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/ITenantFullDeleteJobParameters"
                          },
                          {
                            "$ref": "#/components/schemas/ITenantSyncSystemPoliciesJobParameters"
                          }
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "parameters"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "attributes"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "TenantJob": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantJob",
        "description": "Attributes for a tenant-level background job (e.g. full tenant delete). Extends generic background job attributes.",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/BackgroundJobAttributes"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "fullTenantDelete",
                  "syncSystemPolicies"
                ]
              },
              "parameters": {
                "type": "object",
                "additionalProperties": true
              }
            },
            "required": [
              "type",
              "parameters"
            ],
            "additionalProperties": false
          }
        ],
        "required": [
          "arn",
          "status",
          "created",
          "updated",
          "type",
          "parameters"
        ],
        "additionalProperties": false
      },
      "TenantJobCreateOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ITenantJobCreateOneResponse",
        "description": "Response after creating a tenant background job. Contains the new job resource and self link.",
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseCreateRequest"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "attributes": {
                    "$ref": "#/components/schemas/TenantJob"
                  },
                  "links": {
                    "type": "object",
                    "properties": {
                      "self": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "self"
                    ]
                  },
                  "relationships": {
                    "type": "object",
                    "properties": {
                      "tenant": {
                        "$ref": "#/components/schemas/TenantRelationship"
                      }
                    },
                    "required": [
                      "tenant"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "attributes",
                  "links",
                  "relationships"
                ]
              }
            ]
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "UserAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IUserAttributes",
        "description": "Attribute fields for a user. `source` distinguishes users created directly in Origin Studio (`local`) from those federated via an external identity provider (`external`). `blocked` indicates whether the user's access is disabled; when true the user cannot log in.",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "email_verified": {
            "type": "boolean"
          },
          "picture": {
            "type": "string",
            "description": "URL to a picture for this user"
          },
          "name": {
            "type": "string",
            "description": "Name of this user"
          },
          "email": {
            "type": "string",
            "description": "Email address of this user"
          },
          "app_metadata": {
            "type": "object",
            "description": "App-specific metadata for this user"
          },
          "source": {
            "type": "string",
            "description": "Source of this user",
            "enum": [
              "local",
              "external"
            ]
          },
          "identity_provider": {
            "type": "string",
            "description": "The identity provider used to authenticate this user (e.g. local, google-oauth2)"
          },
          "blocked": {
            "type": "boolean",
            "description": "Whether the user is blocked/disabled"
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "updated": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "User": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IUser",
        "description": "A JSON:API user resource representing a person with access to Origin Studio. Includes profile attributes (email, name, picture, status) and relationships to the owning tenant and the user's assigned roles.",
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseResource"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "users"
              },
              "attributes": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/UserAttributes"
                  }
                ],
                "additionalProperties": false
              },
              "relationships": {
                "type": "object",
                "required": [
                  "tenant"
                ],
                "additionalProperties": false,
                "properties": {
                  "tenant": {
                    "$ref": "#/components/schemas/TenantRelationship"
                  },
                  "roles": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "data": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/RoleRelationship"
                        }
                      }
                    }
                  }
                }
              }
            },
            "required": [
              "type",
              "attributes",
              "relationships"
            ],
            "additionalProperties": false
          }
        ]
      },
      "GetUsersResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IGetUsersResponse",
        "description": "Paginated response for listing users within a tenant. Each item in `data` is a full user resource with profile attributes and role relationships, plus a `meta.tenantId` and a self link. The top-level `meta` object provides total count and pagination offsets.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta",
          "links"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "type",
                "attributes",
                "relationships"
              ],
              "additionalProperties": false,
              "allOf": [
                {
                  "$ref": "#/components/schemas/User"
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "meta",
                    "links"
                  ],
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "tenantId": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "self": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                }
              ]
            },
            "additionalProperties": false
          },
          "meta": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "start": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              }
            },
            "additionalProperties": false
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "CreateUsersRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreateUsersRequest",
        "description": "Request body for creating one or more users in a single API call. Each entry in `data` specifies the user's email address and the role IDs to assign. The new user will receive an invitation email and must verify their account before logging in.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "user"
                  ],
                  "description": "The type of the resource, which must be 'user'"
                },
                "attributes": {
                  "type": "object",
                  "properties": {
                    "email": {
                      "type": "string",
                      "format": "email",
                      "description": "The email address of the user"
                    },
                    "roles": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "An array of role IDs to assign to the user"
                    }
                  },
                  "required": [
                    "email",
                    "roles"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "type",
                "attributes"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "CreateUsersData": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreateUsersData",
        "description": "The result payload of a batch user creation operation. `created` lists users that were successfully created with their email and assigned role IDs. `failed` lists entries that could not be created, each with the email address, HTTP status code, and error details explaining the failure.",
        "type": "object",
        "properties": {
          "created": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "users"
                  ]
                },
                "id": {
                  "type": "string",
                  "format": "email"
                },
                "attributes": {
                  "type": "object",
                  "properties": {
                    "email": {
                      "type": "string",
                      "format": "email"
                    },
                    "roles": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "email",
                    "roles"
                  ]
                }
              },
              "required": [
                "type",
                "id",
                "attributes"
              ],
              "additionalProperties": false
            }
          },
          "failed": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string",
                  "format": "email"
                },
                "status": {
                  "type": "number"
                },
                "title": {
                  "type": "string"
                },
                "detail": {
                  "type": "string"
                }
              },
              "required": [
                "email",
                "status",
                "title",
                "detail"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "created",
          "failed"
        ],
        "additionalProperties": false
      },
      "CreateUsersResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ICreateUsersResponse",
        "description": "Response returned by the batch user creation endpoint. The `data` object contains separate `created` and `failed` arrays, allowing partial success — the caller should inspect both arrays even on a 201 response.",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "$ref": "#/components/schemas/CreateUsersData"
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "GetUserResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IGetUserResponse",
        "description": "The response for a user find one request.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta",
          "links"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/User"
          },
          "meta": {
            "type": "object",
            "required": [
              "tenantId"
            ],
            "properties": {
              "tenantId": {
                "type": "string"
              },
              "permissions": {
                "type": "object",
                "properties": {
                  "deliveryWorkspace": {
                    "type": "object",
                    "properties": {
                      "canAccess": {
                        "type": "boolean"
                      }
                    }
                  },
                  "administration": {
                    "type": "object",
                    "properties": {
                      "canAccess": {
                        "type": "boolean"
                      }
                    }
                  },
                  "bulkActions": {
                    "type": "object",
                    "properties": {
                      "write": {
                        "type": "object",
                        "properties": {
                          "canAccess": {
                            "type": "boolean"
                          }
                        }
                      },
                      "delete": {
                        "type": "object",
                        "properties": {
                          "canAccess": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                }
              }
            },
            "additionalProperties": false
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "PatchUserRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IPatchUserRequest",
        "description": "Request body for partially updating a user. Supports updating the user's `blocked` status via `attributes` and/or replacing the user's role assignments via `relationships.roles`. The `data.id` must match the `userId` path parameter.",
        "type": "object",
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseResource"
              },
              {
                "required": [
                  "id",
                  "type"
                ],
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "users"
                    ]
                  },
                  "attributes": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "blocked": {
                        "type": "boolean"
                      }
                    }
                  },
                  "relationships": {
                    "type": "object",
                    "required": [
                      "roles"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "roles": {
                        "type": "object",
                        "required": [
                          "data"
                        ],
                        "additionalProperties": false,
                        "properties": {
                          "data": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "id",
                                "type"
                              ],
                              "additionalProperties": false,
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "userRoles"
                                  ]
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            ]
          }
        }
      },
      "UserRoleAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IUserRoleAttributes",
        "description": "Attributes of a user role. `name` is the display name (e.g., 'Admin', 'Editor'). `dataSource` indicates whether the role is system-provisioned by Fabric (`fabric`) or created by the tenant (`custom`). Fabric roles cannot be renamed or deleted.",
        "type": "object",
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of this role"
          },
          "description": {
            "type": "string",
            "description": "Description of this role"
          },
          "dataSource": {
            "type": "string",
            "description": "The data source of the role",
            "enum": [
              "custom",
              "fabric"
            ]
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "updated": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RoleRelationships": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRoleRelationships",
        "description": "JSON:API relationship links for a role resource. Contains the owning `tenant` relationship and an optional `author` relationship identifying the user who created the role (with display name and tenant context in meta).",
        "type": "object",
        "properties": {
          "tenant": {
            "$ref": "#/components/schemas/TenantRelationship"
          },
          "author": {
            "type": "object",
            "required": [
              "data"
            ],
            "additionalProperties": false,
            "properties": {
              "data": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "meta"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "users"
                    ]
                  },
                  "meta": {
                    "type": "object",
                    "required": [
                      "tenantId",
                      "type",
                      "displayName"
                    ],
                    "properties": {
                      "tenantId": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      },
                      "displayName": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              },
              "links": {
                "type": "object",
                "properties": {
                  "related": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "required": [
          "tenant"
        ],
        "additionalProperties": false
      },
      "RoleFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRoleFindManyResponse",
        "description": "Response for listing all roles in a tenant. Each item in `data` is a full role resource with its name, description, dataSource, timestamps, tenant relationship, and author relationship. The `meta.tenantId` on each role item identifies the owning tenant.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "type",
                "attributes",
                "relationships",
                "meta"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "userRoles"
                  ]
                },
                "attributes": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/BaseResourceAttributes"
                    },
                    {
                      "$ref": "#/components/schemas/UserRoleAttributes"
                    }
                  ]
                },
                "relationships": {
                  "$ref": "#/components/schemas/RoleRelationships"
                },
                "meta": {
                  "type": "object",
                  "properties": {
                    "tenantId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "tenantId"
                  ]
                },
                "links": {
                  "$ref": "#/components/schemas/LinksRelated"
                }
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "EffectiveConditions": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IEffectiveConditions",
        "description": "Scoping conditions attached to a policy-granted action. Mirrors the policy template's conditions. Only present on grants with source 'policy'.",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "workTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "locales": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "lifecyclePhases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "lifecycleStatuses": {
            "type": "object",
            "description": "Per-work-type lifecycle status access (the template's workTypeLifecycleAccess). Keyed by work type because status ids are only unique within a work type.",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "sectionIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createSources": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "updateTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "securityTagId": {
            "type": "string"
          },
          "dataGroups": {
            "type": "object",
            "description": "Per-work-type entity-collection access (the template's workTypeEntityAccess).",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "creditsAccess": {
                  "type": "boolean"
                },
                "mediaAccess": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "externalDataAccess": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      },
      "EffectiveActionGrant": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IEffectiveActionGrant",
        "description": "A single allowed action on a resource, tagged with where it comes from.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "verb",
          "source"
        ],
        "properties": {
          "verb": {
            "type": "string",
            "enum": [
              "Create",
              "Read",
              "Update",
              "Delete",
              "Write"
            ],
            "description": "The allowed action verb."
          },
          "source": {
            "type": "string",
            "enum": [
              "baseline",
              "policy"
            ],
            "description": "'baseline' = granted by the role's identity (system policies); 'policy' = a custom assigned policy."
          },
          "policyId": {
            "type": "string"
          },
          "templateId": {
            "type": "string"
          },
          "templateLabel": {
            "type": "string"
          },
          "conditions": {
            "$ref": "#/components/schemas/EffectiveConditions"
          }
        }
      },
      "EffectiveResourceGroup": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IEffectiveResourceGroup",
        "description": "All allowed actions on a single resource category.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "resourceType",
          "grants"
        ],
        "properties": {
          "resourceType": {
            "type": "string",
            "enum": [
              "record",
              "contributor",
              "credits",
              "media",
              "delivery",
              "dataset",
              "field",
              "recordLayout",
              "recordLifecycle",
              "tenant",
              "user",
              "globalMetadata",
              "bulkActions"
            ]
          },
          "grants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EffectiveActionGrant"
            }
          }
        }
      },
      "EffectivePermissionsAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IEffectivePermissionsAttributes",
        "description": "Descriptive summary of what a role (or the union of a user's roles) is allowed to do.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "roles",
          "fullAccess",
          "resourceGroups"
        ],
        "properties": {
          "roles": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "roleId",
                "isSystemRole"
              ],
              "properties": {
                "roleId": {
                  "type": "string"
                },
                "roleName": {
                  "type": "string"
                },
                "isSystemRole": {
                  "type": "boolean"
                }
              }
            }
          },
          "fullAccess": {
            "type": "boolean",
            "description": "True when the role is unrestricted within 'scope'. When true, 'resourceGroups' is empty."
          },
          "scope": {
            "type": "string",
            "enum": [
              "global",
              "tenant"
            ],
            "description": "Present when 'fullAccess' is true. Indicates the breadth of that unrestricted access: 'tenant' covers the caller's own tenant."
          },
          "forbids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Stable keys describing notable restrictions (Admin caveats)."
          },
          "resourceGroups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EffectiveResourceGroup"
            }
          }
        }
      },
      "EffectivePermissionsResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IEffectivePermissionsResponse",
        "description": "Effective permissions for a user (the union of their roles, via /users/{userId}/permissions) or a single role (via /roles/{roleId}/permissions). The two endpoints share this structurally identical shape.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "effectivePermissions"
                ]
              },
              "attributes": {
                "$ref": "#/components/schemas/EffectivePermissionsAttributes"
              },
              "meta": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "tenantId"
                ],
                "properties": {
                  "tenantId": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            }
          }
        }
      },
      "CreateRoleRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRoleCreateRequest",
        "description": "Request body for creating a new custom role in a tenant. The `name` is required and must be unique within the tenant. An optional `description` can be provided to explain the role's purpose.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseCreateRequest"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "attributes": {
                    "type": "object",
                    "required": [
                      "name"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "The name of the role"
                      },
                      "description": {
                        "type": "string",
                        "description": "The description of the role"
                      }
                    }
                  }
                },
                "required": [
                  "attributes"
                ]
              }
            ]
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "RoleFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRoleFindOneResponse",
        "description": "The response for a user role find one request.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes",
              "relationships",
              "meta"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "userRoles"
                ]
              },
              "attributes": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BaseResourceAttributes"
                  },
                  {
                    "$ref": "#/components/schemas/UserRoleAttributes"
                  }
                ]
              },
              "relationships": {
                "$ref": "#/components/schemas/RoleRelationships"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "tenantId": {
                    "type": "string"
                  }
                },
                "required": [
                  "tenantId"
                ]
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "RoleUpdateOneRequest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRoleUpdateOneRequest",
        "description": "Request body for updating a role's description. Currently only the `description` attribute is updatable via this endpoint. The role name is immutable after creation.",
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteRequestMeta"
          },
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BaseResource"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "attributes": {
                    "type": "object",
                    "required": [
                      "description"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "description": {
                        "type": "string",
                        "description": "The description of the role"
                      }
                    }
                  }
                },
                "required": [
                  "attributes"
                ]
              }
            ]
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "RoleUpdateOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IRoleUpdateOneResponse",
        "description": "The response for a user role update one request.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes",
              "relationships",
              "meta"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "userRoles"
                ]
              },
              "attributes": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BaseResourceAttributes"
                  },
                  {
                    "$ref": "#/components/schemas/UserRoleAttributes"
                  }
                ]
              },
              "relationships": {
                "$ref": "#/components/schemas/RoleRelationships"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "tenantId": {
                    "type": "string"
                  }
                },
                "required": [
                  "tenantId"
                ]
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "UtilizationAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IUtilizationAttributes",
        "description": "Attributes for current utilization data",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userCount",
          "recordCount",
          "apiCallCount",
          "deliveryRecordCount",
          "mediaStorageBytes",
          "currentMonthKey",
          "peakUserCount",
          "peakRecordCount",
          "peakApiCallCount",
          "peakDeliveryRecordCount",
          "peakMediaStorageBytes"
        ],
        "properties": {
          "currentMonthKey": {
            "type": "string",
            "description": "Current month key in YYYY-MM format",
            "pattern": "^\\d{4}-\\d{2}$"
          },
          "userCount": {
            "type": "integer",
            "description": "Current number of users"
          },
          "recordCount": {
            "type": "integer",
            "description": "Current number of records"
          },
          "apiCallCount": {
            "type": "integer",
            "description": "Current number of API calls this month"
          },
          "deliveryRecordCount": {
            "type": "integer",
            "description": "Current number of delivery records"
          },
          "mediaStorageBytes": {
            "type": "integer",
            "description": "Current media storage usage in bytes"
          },
          "peakUserCount": {
            "type": "integer",
            "description": "Peak user count for the current month"
          },
          "peakRecordCount": {
            "type": "integer",
            "description": "Peak record count for the current month"
          },
          "peakApiCallCount": {
            "type": "integer",
            "description": "Peak API call count for the current month"
          },
          "peakDeliveryRecordCount": {
            "type": "integer",
            "description": "Peak delivery record count for the current month"
          },
          "peakMediaStorageBytes": {
            "type": "integer",
            "description": "Peak media storage bytes for the current month"
          },
          "lastReconciledAt": {
            "type": "string",
            "format": "date-time",
            "description": "Last time utilization was reconciled"
          },
          "updated": {
            "type": "string",
            "format": "date-time",
            "description": "Last update timestamp"
          }
        }
      },
      "UtilizationFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IUtilizationFindOneResponse",
        "description": "Response for getting current utilization",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "description": "Utilization ID"
              },
              "type": {
                "type": "string",
                "enum": [
                  "utilization"
                ]
              },
              "attributes": {
                "$ref": "#/components/schemas/UtilizationAttributes"
              }
            }
          }
        }
      },
      "UtilizationSnapshotAttributes": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IUtilizationSnapshotAttributes",
        "description": "Attributes for a utilization snapshot",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenantId",
          "yearMonth",
          "peakUserCount",
          "peakRecordCount",
          "peakApiCallCount",
          "peakDeliveryRecordCount",
          "peakMediaStorageBytes"
        ],
        "properties": {
          "yearMonth": {
            "type": "string",
            "description": "Month in YYYY-MM format",
            "pattern": "^\\d{4}-\\d{2}$"
          },
          "plan": {
            "type": "string",
            "description": "Plan name at the time of the snapshot"
          },
          "peakUserCount": {
            "type": "integer",
            "description": "Peak user count for the month"
          },
          "peakRecordCount": {
            "type": "integer",
            "description": "Peak record count for the month"
          },
          "peakApiCallCount": {
            "type": "integer",
            "description": "Peak API call count for the month"
          },
          "peakDeliveryRecordCount": {
            "type": "integer",
            "description": "Peak delivery record count for the month"
          },
          "peakMediaStorageBytes": {
            "type": "integer",
            "description": "Peak media storage bytes for the month"
          },
          "endOfMonthUserCount": {
            "type": "integer",
            "description": "User count at the end of the month"
          },
          "endOfMonthRecordCount": {
            "type": "integer",
            "description": "Record count at the end of the month"
          },
          "endOfMonthDeliveryRecordCount": {
            "type": "integer",
            "description": "Delivery record count at the end of the month"
          },
          "endOfMonthMediaStorageBytes": {
            "type": "integer",
            "description": "Media storage bytes at the end of the month"
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "description": "Snapshot creation timestamp"
          }
        }
      },
      "UtilizationSnapshotFindManyResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IUtilizationSnapshotFindManyResponse",
        "description": "Response for listing utilization snapshots",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta",
          "links"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "type",
                "attributes",
                "links"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Snapshot ID"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "utilizationSnapshots"
                  ]
                },
                "attributes": {
                  "$ref": "#/components/schemas/UtilizationSnapshotAttributes"
                },
                "links": {
                  "type": "object",
                  "required": [
                    "self"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "self": {
                      "type": "string",
                      "description": "Link to this snapshot"
                    }
                  }
                }
              }
            }
          },
          "meta": {
            "type": "object",
            "required": [
              "total"
            ],
            "additionalProperties": false,
            "properties": {
              "total": {
                "type": "integer",
                "description": "Total number of snapshots available"
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "additionalProperties": false,
            "properties": {
              "self": {
                "type": "string",
                "description": "Link to this resource"
              }
            }
          }
        }
      },
      "UtilizationSnapshotFindOneResponse": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "IUtilizationSnapshotFindOneResponse",
        "description": "Response for getting a single utilization snapshot",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "links"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "type",
              "attributes"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "description": "Snapshot ID"
              },
              "type": {
                "type": "string",
                "enum": [
                  "utilizationSnapshots"
                ]
              },
              "attributes": {
                "$ref": "#/components/schemas/UtilizationSnapshotAttributes"
              }
            }
          },
          "links": {
            "type": "object",
            "required": [
              "self"
            ],
            "additionalProperties": false,
            "properties": {
              "self": {
                "type": "string",
                "description": "Link to this snapshot"
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "jwt-apikey-authorizer": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header",
        "x-amazon-apigateway-authtype": "custom",
        "x-amazon-apigateway-authorizer": {
          "type": "token",
          "authorizerUri": "${apiAuthorizerUri}",
          "authorizerResultTtlInSeconds": 300
        }
      }
    }
  },
  "x-tagGroups": [
    {
      "name": "Fabric API - Audit",
      "tags": [
        "Audit"
      ]
    },
    {
      "name": "Fabric API - Background Jobs",
      "tags": [
        "Background Jobs"
      ]
    },
    {
      "name": "Fabric API - Contributors",
      "tags": [
        "Contributors",
        "Global Contributors"
      ]
    },
    {
      "name": "Fabric API - Credits",
      "tags": [
        "Credits"
      ]
    },
    {
      "name": "Fabric API - Data Deliveries",
      "tags": [
        "Data Deliveries"
      ]
    },
    {
      "name": "Fabric API - Data Ingress",
      "tags": [
        "DataIngress"
      ]
    },
    {
      "name": "Fabric API - Data Warehouse Settings",
      "tags": [
        "Data Warehouse Settings"
      ]
    },
    {
      "name": "Fabric API - Datasets",
      "tags": [
        "Datasets"
      ]
    },
    {
      "name": "Fabric API - Fields",
      "tags": [
        "Fields"
      ]
    },
    {
      "name": "Fabric API - Global Metadata",
      "tags": [
        "Global Metadata",
        "Licensed Metadata"
      ]
    },
    {
      "name": "Studio+ API - Media",
      "tags": [
        "Media"
      ]
    },
    {
      "name": "Fabric API - Records",
      "tags": [
        "Records",
        "Record Lifecycles"
      ]
    },
    {
      "name": "Fabric API - Tenants",
      "tags": [
        "Tenants"
      ]
    },
    {
      "name": "Fabric API - Users",
      "tags": [
        "Users"
      ]
    },
    {
      "name": "Fabric API - Utilization",
      "tags": [
        "Utilization"
      ]
    }
  ],
  "x-amazon-apigateway-minimum-compression-size": 4096,
  "x-amazon-apigateway-gateway-responses": {
    "ACCESS_DENIED": {
      "statusCode": 403,
      "responseParameters": {
        "gatewayresponse.header.Access-Control-Allow-Origin": "'https://knowledgebase.fabricdata.com'",
        "gatewayresponse.header.Access-Control-Allow-Headers": "'Authorization,Content-Type,Accept'",
        "gatewayresponse.header.Vary": "'Origin'"
      },
      "responseTemplates": {
        "application/json": "{\"jsonapi\":{\"version\":\"1.1\"},\"errors\":[{\"status\":\"403\",\"title\":\"Access Denied\",\"detail\":\"You are forbidden to perform this action.\"}]}"
      }
    },
    "DEFAULT_4XX": {
      "statusCode": 400,
      "responseParameters": {
        "gatewayresponse.header.Access-Control-Allow-Origin": "'https://knowledgebase.fabricdata.com'",
        "gatewayresponse.header.Access-Control-Allow-Headers": "'Authorization,Content-Type,Accept'",
        "gatewayresponse.header.Vary": "'Origin'"
      },
      "responseTemplates": {
        "application/json": "{\"jsonapi\":{\"version\":\"1.1\"},\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"The request is invalid.\"}]}"
      }
    },
    "EXPIRED_TOKEN": {
      "statusCode": 403,
      "responseParameters": {
        "gatewayresponse.header.Access-Control-Allow-Origin": "'https://knowledgebase.fabricdata.com'",
        "gatewayresponse.header.Access-Control-Allow-Headers": "'Authorization,Content-Type,Accept'",
        "gatewayresponse.header.Vary": "'Origin'"
      },
      "responseTemplates": {
        "application/json": "{\"jsonapi\":{\"version\":\"1.1\"},\"errors\":[{\"status\":\"403\",\"title\":\"Expired Token\",\"detail\":\"The token has expired.\"}]}"
      }
    },
    "UNAUTHORIZED": {
      "statusCode": 401,
      "responseParameters": {
        "gatewayresponse.header.Access-Control-Allow-Origin": "'https://knowledgebase.fabricdata.com'",
        "gatewayresponse.header.Access-Control-Allow-Headers": "'Authorization,Content-Type,Accept'",
        "gatewayresponse.header.Vary": "'Origin'"
      },
      "responseTemplates": {
        "application/json": "{\"jsonapi\":{\"version\":\"1.1\"},\"errors\":[{\"status\":\"401\",\"title\":\"Unauthorized\",\"detail\":\"You are not authorized to perform this action.\"}]}"
      }
    },
    "UNSUPPORTED_MEDIA_TYPE": {
      "statusCode": 415,
      "responseParameters": {
        "gatewayresponse.header.Access-Control-Allow-Origin": "'https://knowledgebase.fabricdata.com'",
        "gatewayresponse.header.Access-Control-Allow-Headers": "'Authorization,Content-Type,Accept'",
        "gatewayresponse.header.Vary": "'Origin'"
      },
      "responseTemplates": {
        "application/json": "{\"jsonapi\":{\"version\":\"1.1\"},\"errors\":[{\"status\":\"415\",\"title\":\"Unsupported Media Type\",\"detail\":\"The request content type is not supported by the API.\"}]}"
      }
    },
    "THROTTLED": {
      "statusCode": 429,
      "responseParameters": {
        "gatewayresponse.header.Access-Control-Allow-Origin": "'https://knowledgebase.fabricdata.com'",
        "gatewayresponse.header.Access-Control-Allow-Headers": "'Authorization,Content-Type,Accept'",
        "gatewayresponse.header.Vary": "'Origin'"
      },
      "responseTemplates": {
        "application/json": "{\"jsonapi\":{\"version\":\"1.1\"},\"errors\":[{\"status\":\"429\",\"title\":\"Too Many Requests\",\"detail\":\"The request was throttled.\"}]}"
      }
    },
    "QUOTA_EXCEEDED": {
      "statusCode": 403,
      "responseParameters": {
        "gatewayresponse.header.Access-Control-Allow-Origin": "'https://knowledgebase.fabricdata.com'",
        "gatewayresponse.header.Access-Control-Allow-Headers": "'Authorization,Content-Type,Accept'",
        "gatewayresponse.header.Vary": "'Origin'"
      },
      "responseTemplates": {
        "application/json": "{\"jsonapi\":{\"version\":\"1.1\"},\"errors\":[{\"status\":\"403\",\"title\":\"Forbidden\",\"detail\":\"The request was throttled.\"}]}"
      }
    },
    "REQUEST_TOO_LARGE": {
      "statusCode": 413,
      "responseParameters": {
        "gatewayresponse.header.Access-Control-Allow-Origin": "'https://knowledgebase.fabricdata.com'",
        "gatewayresponse.header.Access-Control-Allow-Headers": "'Authorization,Content-Type,Accept'",
        "gatewayresponse.header.Vary": "'Origin'"
      },
      "responseTemplates": {
        "application/json": "{\"jsonapi\":{\"version\":\"1.1\"},\"errors\":[{\"status\":\"413\",\"title\":\"Request Too Large\",\"detail\":\"The request is too large.\"}]}"
      }
    },
    "WAF_FILTERED": {
      "statusCode": 403,
      "responseParameters": {
        "gatewayresponse.header.Access-Control-Allow-Origin": "'https://knowledgebase.fabricdata.com'",
        "gatewayresponse.header.Access-Control-Allow-Headers": "'Authorization,Content-Type,Accept'",
        "gatewayresponse.header.Vary": "'Origin'"
      },
      "responseTemplates": {
        "application/json": "{\"jsonapi\":{\"version\":\"1.1\"},\"errors\":[{\"status\":\"403\",\"title\":\"WAF Filtered\",\"detail\":\"The request was filtered by the WAF.\"}]}"
      }
    },
    "INTEGRATION_TIMEOUT": {
      "statusCode": 504,
      "responseParameters": {
        "gatewayresponse.header.Access-Control-Allow-Origin": "'https://knowledgebase.fabricdata.com'",
        "gatewayresponse.header.Access-Control-Allow-Headers": "'Authorization,Content-Type,Accept'",
        "gatewayresponse.header.Vary": "'Origin'"
      },
      "responseTemplates": {
        "application/json": "{\"jsonapi\":{\"version\":\"1.1\"},\"errors\":[{\"status\":\"504\",\"title\":\"Integration Timeout\",\"detail\":\"The request timed out while waiting for a response from an external service.\"}]}"
      }
    },
    "INTEGRATION_FAILURE": {
      "statusCode": 504,
      "responseParameters": {
        "gatewayresponse.header.Access-Control-Allow-Origin": "'https://knowledgebase.fabricdata.com'",
        "gatewayresponse.header.Access-Control-Allow-Headers": "'Authorization,Content-Type,Accept'",
        "gatewayresponse.header.Vary": "'Origin'"
      },
      "responseTemplates": {
        "application/json": "{\"jsonapi\":{\"version\":\"1.1\"},\"errors\":[{\"status\":\"504\",\"title\":\"Integration Failure\",\"detail\":\"The request failed while waiting for a response from an external service.\"}]}"
      }
    },
    "DEFAULT_5XX": {
      "statusCode": 500,
      "responseParameters": {
        "gatewayresponse.header.Access-Control-Allow-Origin": "'https://knowledgebase.fabricdata.com'",
        "gatewayresponse.header.Access-Control-Allow-Headers": "'Authorization,Content-Type,Accept'",
        "gatewayresponse.header.Vary": "'Origin'"
      },
      "responseTemplates": {
        "application/json": "{\"jsonapi\":{\"version\":\"1.1\"},\"errors\":[{\"status\":\"500\",\"title\":\"Internal Server Error\",\"detail\":\"An unexpected error occurred.\"}]}"
      }
    },
    "API_CONFIGURATION_ERROR": {
      "statusCode": 500,
      "responseParameters": {
        "gatewayresponse.header.Access-Control-Allow-Origin": "'https://knowledgebase.fabricdata.com'",
        "gatewayresponse.header.Access-Control-Allow-Headers": "'Authorization,Content-Type,Accept'",
        "gatewayresponse.header.Vary": "'Origin'"
      },
      "responseTemplates": {
        "application/json": "{\"jsonapi\":{\"version\":\"1.1\"},\"errors\":[{\"status\":\"500\",\"title\":\"API Configuration Error\",\"detail\":\"An error occurred in the API configuration.\"}]}"
      }
    },
    "AUTHORIZER_CONFIGURATION_ERROR": {
      "statusCode": 500,
      "responseParameters": {
        "gatewayresponse.header.Access-Control-Allow-Origin": "'https://knowledgebase.fabricdata.com'",
        "gatewayresponse.header.Access-Control-Allow-Headers": "'Authorization,Content-Type,Accept'",
        "gatewayresponse.header.Vary": "'Origin'"
      },
      "responseTemplates": {
        "application/json": "{\"jsonapi\":{\"version\":\"1.1\"},\"errors\":[{\"status\":\"500\",\"title\":\"Authorizer Configuration Error\",\"detail\":\"An error occurred in the authorizer configuration.\"}]}"
      }
    },
    "AUTHORIZER_FAILURE": {
      "statusCode": 500,
      "responseParameters": {
        "gatewayresponse.header.Access-Control-Allow-Origin": "'https://knowledgebase.fabricdata.com'",
        "gatewayresponse.header.Access-Control-Allow-Headers": "'Authorization,Content-Type,Accept'",
        "gatewayresponse.header.Vary": "'Origin'"
      },
      "responseTemplates": {
        "application/json": "{\"jsonapi\":{\"version\":\"1.1\"},\"errors\":[{\"status\":\"500\",\"title\":\"Authorizer Failure\",\"detail\":\"An error occurred in the authorizer.\"}]}"
      }
    }
  }
}