{
  "openapi": "3.1.0",
  "info": {
    "title": "Edge Platform Custom Context API",
    "description": "Use the Custom Context API to create, retrieve, update, and delete the [context](https://doc.sitecore.com/portal/en/developers/sitecore-cloud-portal/context-ids.html). A context ID is a unified identifier that grants access to specific resources in a Sitecore Cloud Portal organization and is helps determine the context for an organization. \n\n To use this REST API, you must authenticate your API requests. Keep in mind: \n\n - All API requests are made in your production environment.\n\n - The base URL is `https://edge-platform-context-api.sitecorecloud.io`.\n\n<b>NOTE</b>: You must have an [*Organization Admin* or *Organization Owner* role](https://doc.sitecore.com/portal/en/developers/sitecore-cloud-portal/roles.html#organization-roles) in Sitecore Cloud Portal. \n\n## Authentication\n\nThe Edge Platform Context API uses [bearer](https://doc.sitecore.com/portal/en/developers/sitecore-cloud-portal/manage-api-tokens.html) authentication. Bearer tokens are generated in response to a login request.\n\nTo get a bearer token:\n\n 1. Log in to the [Sitecore Cloud Portal](https://portal.sitecorecloud.io/).\n\n 2. In the top-right corner of the menu bar, click your profile icon > **API tokens**.\n\n 3. Click **Copy to clipboard**.\n\nYou can now start making REST API requests. You must include this token in the authorization header of every request you make.",
    "version": "1.0",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0"
    },
    "x-metadata": {
      "product": "Cloud Portal"
    }
  },
  "tags": [
    {
      "name": "Context",
      "description": "The Context API lets you [create and manage context IDs](https://doc.sitecore.com/portal/en/developers/sitecore-cloud-portal/context-ids.html) for your organization."
    },
    {
      "name": "Resources",
      "description": "The Resource API lets you create and manage context resources in your organization (for example, add a key, list keys, or fetch a key)."
    },
    {
      "name": "Scoped context",
      "description": "The Scoped context API lets you create and manage the scoped context in your organization. Scoped contexts are tied to the specified parent."
    },
    {
      "name": "Products",
      "description": "Product endpoints let you work at the product/tenant level instead of manually adding individual resources. You can retrieve all available product instances and attach a context to a product."
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "servers": [
    {
      "url": "https://edge-platform-context-api.sitecorecloud.io"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {},
    "parameters": {}
  },
  "paths": {
    "/api/context/user/v1/contexts": {
      "post": {
        "tags": [
          "Context"
        ],
        "summary": "Create context",
        "description": "Create a context within your organization. Creating a context means issuing a new context ID and defining what it can access. \n\n <b>NOTE</b>: `products` and `resources` cannot be present together.",
        "operationId": "CreateUserContext",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "allowTracing": {
                    "type": "string",
                    "example": "false"
                  },
                  "products": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "productCode": {
                          "type": "string",
                          "description": "Available values: \"XMCloud\" | \"Personalize\" | \"CDP\" | \"contenthub\"",
                          "example": "XMCloud"
                        },
                        "tenantId": {
                          "type": "string",
                          "example": "g6c3b17d-1816-40ef-bbf3-ae670311452c"
                        },
                        "environment": {
                          "type": "string",
                          "description": "Only for XMCloud product. Available values: \"Live\" | \"Preview\"",
                          "example": "Live"
                        }
                      },
                      "required": [
                        "productCode",
                        "tenantId"
                      ]
                    },
                    "description": "Cannot be present with resources"
                  },
                  "resources": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "SitecorePesonalizeResource"
                        },
                        "name": {
                          "type": "string",
                          "example": "My Sitecore personalize resource"
                        },
                        "type": {
                          "type": "string",
                          "description": "personalize | edge | search | forms | files",
                          "example": "personalize"
                        },
                        "tenantId": {
                          "type": "string",
                          "example": "g6c3b17d-1816-40ef-bbf3-ae670311452c"
                        },
                        "properties": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "Property id",
                                "example": "POS"
                              },
                              "value": {
                                "type": "string",
                                "description": "Property value",
                                "example": "playwebsite"
                              }
                            },
                            "required": [
                              "id",
                              "value"
                            ]
                          }
                        }
                      },
                      "required": [
                        "type",
                        "tenantId"
                      ]
                    },
                    "description": "Cannot be present with products"
                  },
                  "name": {
                    "type": "string",
                    "example": "My Context"
                  },
                  "description": {
                    "type": "string",
                    "example": "This is my context"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "organizationId": {
                      "type": "string",
                      "example": "org_123ABC"
                    },
                    "sitecoreContextId": {
                      "type": "string",
                      "example": "f9c3b17d181640efbbf3ae670311452d"
                    },
                    "allowTracing": {
                      "type": "string",
                      "example": "false"
                    },
                    "type": {
                      "type": "string",
                      "example": "custom"
                    },
                    "accountId": {
                      "type": "string",
                      "example": "account001"
                    },
                    "resources": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "SitecoreSearchResource"
                            },
                            "name": {
                              "type": "string",
                              "example": "My Sitecore search resource"
                            },
                            "type": {
                              "type": "string",
                              "example": "search"
                            },
                            "tenantId": {
                              "type": "string",
                              "example": "g6c3b17d-1816-40ef-bbf3-ae670311452c"
                            },
                            "properties": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "description": "Property id",
                                    "example": "POS"
                                  },
                                  "value": {
                                    "type": "string",
                                    "description": "Property value",
                                    "example": "playwebsite"
                                  }
                                },
                                "required": [
                                  "id",
                                  "value"
                                ]
                              }
                            },
                            "tenantName": {
                              "type": "string",
                              "example": "tenant name"
                            },
                            "tenantProductCode": {
                              "type": "string",
                              "example": "Search"
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "type",
                            "tenantId",
                            "properties",
                            "tenantName",
                            "tenantProductCode"
                          ]
                        }
                      }
                    },
                    "name": {
                      "type": "string",
                      "example": "My Context"
                    },
                    "description": {
                      "type": "string",
                      "example": "This is my context"
                    },
                    "createdAt": {
                      "type": "string",
                      "example": "2025-09-22T01:00:00Z"
                    },
                    "updatedAt": {
                      "type": "string",
                      "example": "2025-09-22T01:00:00Z"
                    }
                  },
                  "required": [
                    "organizationId",
                    "sitecoreContextId",
                    "allowTracing",
                    "type",
                    "accountId"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server-side exception during request execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/context/user/v1/contexts/{sitecoreContextId}": {
      "get": {
        "tags": [
          "Context"
        ],
        "summary": "Retrieve a context by ID",
        "description": "Get a context within your organization by specifying a `sitecoreContextId `. When you get a context, you retrieve the configuration and metadata of the context. This tells you what the context ID grants access to.",
        "operationId": "GetUserContextById",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Sitecore Context ID",
              "example": "f9c3b17d181640efbbf3ae670311452d"
            },
            "required": true,
            "description": "Sitecore Context ID",
            "name": "sitecoreContextId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "organizationId": {
                      "type": "string",
                      "example": "org_123ABC"
                    },
                    "sitecoreContextId": {
                      "type": "string",
                      "example": "f9c3b17d181640efbbf3ae670311452d"
                    },
                    "allowTracing": {
                      "type": "string",
                      "example": "false"
                    },
                    "type": {
                      "type": "string",
                      "example": "custom"
                    },
                    "accountId": {
                      "type": "string",
                      "example": "account001"
                    },
                    "resources": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "SitecoreSearchResource"
                            },
                            "name": {
                              "type": "string",
                              "example": "My Sitecore search resource"
                            },
                            "type": {
                              "type": "string",
                              "example": "search"
                            },
                            "tenantId": {
                              "type": "string",
                              "example": "g6c3b17d-1816-40ef-bbf3-ae670311452c"
                            },
                            "properties": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "description": "Property id",
                                    "example": "POS"
                                  },
                                  "value": {
                                    "type": "string",
                                    "description": "Property value",
                                    "example": "playwebsite"
                                  }
                                },
                                "required": [
                                  "id",
                                  "value"
                                ]
                              }
                            },
                            "tenantName": {
                              "type": "string",
                              "example": "tenant name"
                            },
                            "tenantProductCode": {
                              "type": "string",
                              "example": "Search"
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "type",
                            "tenantId",
                            "properties",
                            "tenantName",
                            "tenantProductCode"
                          ]
                        }
                      }
                    },
                    "name": {
                      "type": "string",
                      "example": "My Context"
                    },
                    "description": {
                      "type": "string",
                      "example": "This is my context"
                    },
                    "createdAt": {
                      "type": "string",
                      "example": "2025-09-22T01:00:00Z"
                    },
                    "updatedAt": {
                      "type": "string",
                      "example": "2025-09-22T01:00:00Z"
                    }
                  },
                  "required": [
                    "organizationId",
                    "sitecoreContextId",
                    "allowTracing",
                    "type",
                    "accountId"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server-side exception during request execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Context"
        ],
        "summary": "Delete a context by ID",
        "description": "Delete a context within an organization by specifying a `sitecoreContextId `. When you delete a context, the context no longer grants access.",
        "operationId": "DeleteUserContextById",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Sitecore Context Id",
              "example": "f9c3b17d181640efbbf3ae670311452d"
            },
            "required": true,
            "description": "Sitecore Context Id",
            "name": "sitecoreContextId",
            "in": "path"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Request not valid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server-side exception during request execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Context"
        ],
        "summary": "Update a context",
        "description": "Update a context by specifying a `sitecoreContextId`. Updating a context, you update the context definition without creating a new context (for example, you can adjust the access time.",
        "operationId": "UpdateUserContext",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Sitecore Context ID",
              "example": "f9c3b17d181640efbbf3ae670311452d"
            },
            "required": true,
            "description": "Sitecore Context ID",
            "name": "sitecoreContextId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "example": "My Context"
                  },
                  "description": {
                    "type": "string",
                    "example": "This is my context"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "organizationId": {
                      "type": "string",
                      "example": "org_123ABC"
                    },
                    "sitecoreContextId": {
                      "type": "string",
                      "example": "f9c3b17d181640efbbf3ae670311452d"
                    },
                    "allowTracing": {
                      "type": "string",
                      "example": "false"
                    },
                    "type": {
                      "type": "string",
                      "example": "custom"
                    },
                    "accountId": {
                      "type": "string",
                      "example": "account001"
                    },
                    "resources": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "SitecoreSearchResource"
                            },
                            "name": {
                              "type": "string",
                              "example": "My Sitecore search resource"
                            },
                            "type": {
                              "type": "string",
                              "example": "search"
                            },
                            "tenantId": {
                              "type": "string",
                              "example": "g6c3b17d-1816-40ef-bbf3-ae670311452c"
                            },
                            "properties": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "description": "Property id",
                                    "example": "POS"
                                  },
                                  "value": {
                                    "type": "string",
                                    "description": "Property value",
                                    "example": "playwebsite"
                                  }
                                },
                                "required": [
                                  "id",
                                  "value"
                                ]
                              }
                            },
                            "tenantName": {
                              "type": "string",
                              "example": "tenant name"
                            },
                            "tenantProductCode": {
                              "type": "string",
                              "example": "Search"
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "type",
                            "tenantId",
                            "properties",
                            "tenantName",
                            "tenantProductCode"
                          ]
                        }
                      }
                    },
                    "name": {
                      "type": "string",
                      "example": "My Context"
                    },
                    "description": {
                      "type": "string",
                      "example": "This is my context"
                    },
                    "createdAt": {
                      "type": "string",
                      "example": "2025-09-22T01:00:00Z"
                    },
                    "updatedAt": {
                      "type": "string",
                      "example": "2025-09-22T01:00:00Z"
                    }
                  },
                  "required": [
                    "organizationId",
                    "sitecoreContextId",
                    "allowTracing",
                    "type",
                    "accountId"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server-side exception during request execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/context/user/v1/available-products": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "List available products",
        "description": "Lists products in your organization that can be added to a context.",
        "operationId": "ListUserAvailableProducts",
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "productCode": {
                      "type": "string",
                      "example": "XMCloud"
                    },
                    "tenantId": {
                      "type": "string",
                      "example": "f9c3b17d181640efbbf3ae670311452d"
                    },
                    "tenantName": {
                      "type": "string",
                      "example": "My XMC project | Production"
                    },
                    "environment": {
                      "type": "string",
                      "description": "Only for XM CLoud product. values will be \"Live\" or \"Preview\"",
                      "example": "Live"
                    }
                  },
                  "required": [
                    "productCode",
                    "tenantId",
                    "tenantName",
                    "environment"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server-side exception during request execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/context/user/v1/contexts/{sitecoreContextId}/regenerate": {
      "post": {
        "tags": [
          "Context"
        ],
        "summary": "Regenerate a custom context ID",
        "description": "Update a custom context ID by specifying a `sitecoreContextId`. When you regenerate a custom context ID, this means replacing the SitecoreContextId value with a new one.",
        "operationId": "RegenerateUserContextId",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Sitecore Context ID",
              "example": "f9c3b17d181640efbbf3ae670311452d"
            },
            "required": true,
            "description": "Sitecore Context ID",
            "name": "sitecoreContextId",
            "in": "path"
          }
        ],
        "responses": {
          "202": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "organizationId": {
                      "type": "string",
                      "example": "org_123ABC"
                    },
                    "sitecoreContextId": {
                      "type": "string",
                      "example": "f9c3b17d181640efbbf3ae670311452d"
                    },
                    "allowTracing": {
                      "type": "string",
                      "example": "false"
                    },
                    "type": {
                      "type": "string",
                      "example": "custom"
                    },
                    "accountId": {
                      "type": "string",
                      "example": "account001"
                    },
                    "resources": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "SitecoreSearchResource"
                            },
                            "name": {
                              "type": "string",
                              "example": "My Sitecore search resource"
                            },
                            "type": {
                              "type": "string",
                              "example": "search"
                            },
                            "tenantId": {
                              "type": "string",
                              "example": "g6c3b17d-1816-40ef-bbf3-ae670311452c"
                            },
                            "properties": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "description": "Property id",
                                    "example": "POS"
                                  },
                                  "value": {
                                    "type": "string",
                                    "description": "Property value",
                                    "example": "playwebsite"
                                  }
                                },
                                "required": [
                                  "id",
                                  "value"
                                ]
                              }
                            },
                            "tenantName": {
                              "type": "string",
                              "example": "tenant name"
                            },
                            "tenantProductCode": {
                              "type": "string",
                              "example": "Search"
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "type",
                            "tenantId",
                            "properties",
                            "tenantName",
                            "tenantProductCode"
                          ]
                        }
                      }
                    },
                    "name": {
                      "type": "string",
                      "example": "My Context"
                    },
                    "description": {
                      "type": "string",
                      "example": "This is my context"
                    },
                    "createdAt": {
                      "type": "string",
                      "example": "2025-09-22T01:00:00Z"
                    },
                    "updatedAt": {
                      "type": "string",
                      "example": "2025-09-22T01:00:00Z"
                    }
                  },
                  "required": [
                    "organizationId",
                    "sitecoreContextId",
                    "allowTracing",
                    "type",
                    "accountId"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Request does not contain required scopes (expected any of: `ep.usr.ctx:w`).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server-side exception during request execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/context/user/v1/contexts/{sitecoreContextId}/products": {
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Add product resources to a context",
        "description": "Adds product-based resources to a specific context.",
        "operationId": "CreateUserProduct",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Sitecore Context Id",
              "example": "f9c3b17d181640efbbf3ae670311452d"
            },
            "required": true,
            "description": "Sitecore Context Id",
            "name": "sitecoreContextId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "productCode": {
                    "type": "string",
                    "description": "Available values: \"XMCloud\" | \"Personalize\" | \"CDP\" | \"contenthub\"",
                    "example": "XMCloud"
                  },
                  "tenantId": {
                    "type": "string",
                    "example": "g6c3b17d-1816-40ef-bbf3-ae670311452c"
                  },
                  "environment": {
                    "type": "string",
                    "description": "Only for XMCloud product. Available values: \"Live\" | \"Preview\"",
                    "example": "Live"
                  }
                },
                "required": [
                  "productCode",
                  "tenantId"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "example": "SitecoreSearchResource"
                      },
                      "name": {
                        "type": "string",
                        "example": "My Sitecore search resource"
                      },
                      "type": {
                        "type": "string",
                        "example": "search"
                      },
                      "tenantId": {
                        "type": "string",
                        "example": "g6c3b17d-1816-40ef-bbf3-ae670311452c"
                      },
                      "properties": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "Property id",
                              "example": "POS"
                            },
                            "value": {
                              "type": "string",
                              "description": "Property value",
                              "example": "playwebsite"
                            }
                          },
                          "required": [
                            "id",
                            "value"
                          ]
                        }
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "type",
                      "tenantId",
                      "properties"
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server-side exception during request execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/context/user/v1/contexts/{sitecoreContextId}/resources": {
      "post": {
        "tags": [
          "Resources"
        ],
        "summary": "Create resources",
        "description": "Create a context resource. This means adding a specific access target, such as Edge, Personalize, and so on, to an existing context ID.",
        "operationId": "CreateUserResource",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Sitecore Context ID",
              "example": "f9c3b17d181640efbbf3ae670311452d"
            },
            "required": true,
            "description": "Sitecore Context ID",
            "name": "sitecoreContextId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "example": "SitecorePesonalizeResource"
                  },
                  "name": {
                    "type": "string",
                    "example": "My Sitecore personalize resource"
                  },
                  "type": {
                    "type": "string",
                    "description": "personalize | edge | search | forms | files",
                    "example": "personalize"
                  },
                  "tenantId": {
                    "type": "string",
                    "example": "g6c3b17d-1816-40ef-bbf3-ae670311452c"
                  },
                  "properties": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Property id",
                          "example": "POS"
                        },
                        "value": {
                          "type": "string",
                          "description": "Property value",
                          "example": "playwebsite"
                        }
                      },
                      "required": [
                        "id",
                        "value"
                      ]
                    }
                  }
                },
                "required": [
                  "type",
                  "tenantId"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "SitecoreSearchResource"
                    },
                    "name": {
                      "type": "string",
                      "example": "My Sitecore search resource"
                    },
                    "type": {
                      "type": "string",
                      "example": "search"
                    },
                    "tenantId": {
                      "type": "string",
                      "example": "g6c3b17d-1816-40ef-bbf3-ae670311452c"
                    },
                    "properties": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Property id",
                            "example": "POS"
                          },
                          "value": {
                            "type": "string",
                            "description": "Property value",
                            "example": "playwebsite"
                          }
                        },
                        "required": [
                          "id",
                          "value"
                        ]
                      }
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "type",
                    "tenantId",
                    "properties"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server-side exception during request execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Resources"
        ],
        "summary": "List resources",
        "description": "Lists all resources attached to a specific context. This is useful when you want to determine what that context can access.",
        "operationId": "ListUserResource",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Sitecore Context ID",
              "example": "f9c3b17d181640efbbf3ae670311452d"
            },
            "required": true,
            "description": "Sitecore Context ID",
            "name": "sitecoreContextId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "example": "SitecoreSearchResource"
                      },
                      "name": {
                        "type": "string",
                        "example": "My Sitecore search resource"
                      },
                      "type": {
                        "type": "string",
                        "example": "search"
                      },
                      "tenantId": {
                        "type": "string",
                        "example": "g6c3b17d-1816-40ef-bbf3-ae670311452c"
                      },
                      "properties": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "Property id",
                              "example": "POS"
                            },
                            "value": {
                              "type": "string",
                              "description": "Property value",
                              "example": "playwebsite"
                            }
                          },
                          "required": [
                            "id",
                            "value"
                          ]
                        }
                      },
                      "tenantName": {
                        "type": "string",
                        "example": "tenant name"
                      },
                      "tenantProductCode": {
                        "type": "string",
                        "example": "Search"
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "type",
                      "tenantId",
                      "properties",
                      "tenantName",
                      "tenantProductCode"
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server-side exception during request execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/context/user/v1/contexts/{sitecoreContextId}/resources/{resourceId}": {
      "get": {
        "tags": [
          "Resources"
        ],
        "summary": "Retrieve a context resource",
        "description": "Get a context' resource.",
        "operationId": "GetUserResource",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Sitecore Context ID",
              "example": "f9c3b17d181640efbbf3ae670311452d"
            },
            "required": true,
            "description": "Sitecore Context ID",
            "name": "sitecoreContextId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Resource Id",
              "example": "SitecorePesonalizeResource"
            },
            "required": true,
            "description": "Resource Id",
            "name": "resourceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "SitecoreSearchResource"
                    },
                    "name": {
                      "type": "string",
                      "example": "My Sitecore search resource"
                    },
                    "type": {
                      "type": "string",
                      "example": "search"
                    },
                    "tenantId": {
                      "type": "string",
                      "example": "g6c3b17d-1816-40ef-bbf3-ae670311452c"
                    },
                    "tenantName": {
                      "type": "string",
                      "example": "tenant name"
                    },
                    "tenantProductCode": {
                      "type": "string",
                      "example": "Search"
                    },
                    "properties": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Property id",
                            "example": "POS"
                          },
                          "value": {
                            "type": "string",
                            "description": "Property value",
                            "example": "playwebsite"
                          }
                        },
                        "required": [
                          "id",
                          "value"
                        ]
                      }
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "type",
                    "tenantId",
                    "tenantName",
                    "tenantProductCode",
                    "properties"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server-side exception during request execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/context/user/v1/available-resources": {
      "get": {
        "tags": [
          "Resources"
        ],
        "summary": "List resources available in the organization",
        "description": "Lists all available resources of the user's organization that can be added to a context.",
        "operationId": "ListUserAvailableResource",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "personalize | edge | search | forms | files",
              "example": "personalize"
            },
            "required": false,
            "description": "personalize | edge | search | forms | files",
            "name": "type",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "tenantId": {
                        "type": "string",
                        "example": "SitecoreSearchResource"
                      },
                      "tenantName": {
                        "type": "string",
                        "example": "My Sitecore search resource"
                      },
                      "type": {
                        "type": "string",
                        "example": "search"
                      }
                    },
                    "required": [
                      "tenantId",
                      "tenantName",
                      "type"
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server-side exception during request execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/context/user/v1/contexts/{masterSitecoreContextId}/filtered": {
      "post": {
        "tags": [
          "Scoped context"
        ],
        "summary": "Create a scoped context",
        "description": "Creates a scoped context for the `masterSitecoreContextId` within an organization. It defines subset access through the `allowedResourceIds`. ",
        "operationId": "CreateUserFilteredContext",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Sitecore Context ID of the master context",
              "example": "f9c3b17d181640efbbf3ae670311452d"
            },
            "required": true,
            "description": "Sitecore Context ID of the master context",
            "name": "masterSitecoreContextId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sitecoreContextId": {
                    "type": "string",
                    "example": "f9c3b17d181640efbbf3ae670311452d"
                  },
                  "name": {
                    "type": "string",
                    "example": "Scoped context name"
                  },
                  "allowedResourceIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "Allowed resource IDs",
                      "example": "sitecoreFormsResource"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Scoped context successfully created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sitecoreContextId": {
                      "type": "string",
                      "example": "fcb58fa476ebcc9df896d8e8608a718b"
                    },
                    "name": {
                      "type": "string",
                      "example": "Scoped context name"
                    },
                    "masterSitecoreContextId": {
                      "type": "string",
                      "example": "5f81f0627a2e9233d71e8e84f2c0b8e2"
                    },
                    "allowedResourceIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "description": "Allowed resource IDs",
                        "example": "sitecoreFormsResource"
                      }
                    },
                    "createdAt": {
                      "type": "string",
                      "example": "2025-09-22T01:00:00Z"
                    },
                    "updatedAt": {
                      "type": "string",
                      "example": "2025-09-22T01:00:00Z"
                    }
                  },
                  "required": [
                    "sitecoreContextId",
                    "masterSitecoreContextId"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid allowedResourceIds",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Request does not contain required scopes (expected any of: `ep.usr.ctx:w`).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Data not found by the provided organizationId or masterSitecoreContextId",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Data already exists by the provided sitecoreContextId",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Name at most 80 characters long",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server-side exception during request execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Scoped context"
        ],
        "summary": "List scoped contexts",
        "description": "List all scoped contexts under a given parent (`masterSitecoreContextId`), including allowed resouces and metadata.",
        "operationId": "ListUserFilteredContext",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Sitecore Context ID of the master context",
              "example": "f9c3b17d181640efbbf3ae670311452d"
            },
            "required": true,
            "description": "Sitecore Context ID of the master context",
            "name": "masterSitecoreContextId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "sitecoreContextId": {
                        "type": "string",
                        "example": "fcb58fa476ebcc9df896d8e8608a718b"
                      },
                      "name": {
                        "type": "string",
                        "example": "Scoped context name"
                      },
                      "masterSitecoreContextId": {
                        "type": "string",
                        "example": "5f81f0627a2e9233d71e8e84f2c0b8e2"
                      },
                      "allowedResourceIds": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "description": "Allowed resource Ids",
                          "example": "sitecoreFormsResource"
                        }
                      },
                      "createdAt": {
                        "type": "string",
                        "example": "2025-09-22T01:00:00Z"
                      },
                      "updatedAt": {
                        "type": "string",
                        "example": "2025-09-22T01:00:00Z"
                      }
                    },
                    "required": [
                      "sitecoreContextId",
                      "masterSitecoreContextId"
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Request does not contain required scopes (expected any of: `ep.usr.ctx:r`).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Data not found by the provided organizationId or masterSitecoreContextId",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server-side exception during request execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/context/user/v1/contexts/{masterSitecoreContextId}/filtered/{sitecoreContextId}": {
      "patch": {
        "tags": [
          "Scoped context"
        ],
        "summary": "Update a scoped context",
        "description": "Updates a scoped context for a `masterSitecoreContextId` and `sitecoreContextId` within an organization.",
        "operationId": "UpdateUserFilteredContext",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Sitecore Context ID of the master context",
              "example": "f9c3b17d181640efbbf3ae670311452d"
            },
            "required": true,
            "description": "Sitecore context ID of the master context",
            "name": "masterSitecoreContextId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "example": "fcb58fa476ebcc9df896d8e8608a718b"
            },
            "required": true,
            "name": "sitecoreContextId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "allowedResourceIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "Allowed resource IDs",
                      "example": "sitecoreFormsResource"
                    }
                  },
                  "name": {
                    "type": "string",
                    "example": "Scoped context name"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Scoped context successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sitecoreContextId": {
                      "type": "string",
                      "example": "fcb58fa476ebcc9df896d8e8608a718b"
                    },
                    "name": {
                      "type": "string",
                      "example": "Scoped context name"
                    },
                    "masterSitecoreContextId": {
                      "type": "string",
                      "example": "5f81f0627a2e9233d71e8e84f2c0b8e2"
                    },
                    "allowedResourceIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "description": "Allowed resource Ids",
                        "example": "sitecoreFormsResource"
                      }
                    },
                    "createdAt": {
                      "type": "string",
                      "example": "2025-09-22T01:00:00Z"
                    },
                    "updatedAt": {
                      "type": "string",
                      "example": "2025-09-22T01:00:00Z"
                    }
                  },
                  "required": [
                    "sitecoreContextId",
                    "masterSitecoreContextId"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid allowedResourceIds",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Request does not contain required scopes (expected any of: `ep.usr.ctx:w`).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Data not found by the provided organizationId or masterSitecoreContextId or sitecoreContextId",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Name - max 80 characters long",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server-side exception during request execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Scoped context"
        ],
        "summary": "Delete scoped context",
        "description": "Deletes the scoped context identified by `masterSitecoreContextId` and `sitecoreContextId` when it's no longer needed. This revokes access granted through that scoped context to its allowed `allowedResourceIds`.",
        "operationId": "DeleteUserFilteredContext",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Sitecore Context ID of the master context",
              "example": "f9c3b17d181640efbbf3ae670311452d"
            },
            "required": true,
            "description": "Sitecore Context ID of the master context",
            "name": "masterSitecoreContextId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "example": "fcb58fa476ebcc9df896d8e8608a718b"
            },
            "required": true,
            "name": "sitecoreContextId",
            "in": "path"
          }
        ],
        "responses": {
          "204": {
            "description": "Scoped context successfully deleted"
          },
          "401": {
            "description": "Unauthorized request or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Request does not contain required scopes (expected any of: `ep.usr.ctx:w`).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Data not found by the provided organizationId or masterSitecoreContextId or sitecoreContextId",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server-side exception during request execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Scoped context"
        ],
        "summary": "Retrieve scoped context data",
        "description": "Gets scoped context data for a `masterSitecoreContextId ` and `sitecoreContextId` within an organization.",
        "operationId": "GetUserFilteredContext",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Sitecore Context ID of the master context",
              "example": "f9c3b17d181640efbbf3ae670311452d"
            },
            "required": true,
            "description": "Sitecore Context ID of the master context",
            "name": "masterSitecoreContextId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "example": "fcb58fa476ebcc9df896d8e8608a718b"
            },
            "required": true,
            "name": "sitecoreContextId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Data successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sitecoreContextId": {
                      "type": "string",
                      "example": "fcb58fa476ebcc9df896d8e8608a718b"
                    },
                    "name": {
                      "type": "string",
                      "example": "Scoped context name"
                    },
                    "masterSitecoreContextId": {
                      "type": "string",
                      "example": "5f81f0627a2e9233d71e8e84f2c0b8e2"
                    },
                    "allowedResourceIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "description": "Allowed resource IDs",
                        "example": "sitecoreFormsResource"
                      }
                    },
                    "createdAt": {
                      "type": "string",
                      "example": "2025-09-22T01:00:00Z"
                    },
                    "updatedAt": {
                      "type": "string",
                      "example": "2025-09-22T01:00:00Z"
                    }
                  },
                  "required": [
                    "sitecoreContextId",
                    "masterSitecoreContextId"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Request does not contain required scopes (expected`ep.usr.ctx:r`)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Data not found with the organizationId, masterSitecoreContextId, or sitecoreContextId",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server-side exception during request execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/context/user/v2/contexts": {
      "get": {
        "tags": [
          "Context"
        ],
        "summary": "List custom-context pagination",
        "description": "Retrieve a paginated list of contexts within an organization.",
        "operationId": "ListUserContextPagination",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Returns IDs only",
              "example": "false"
            },
            "required": false,
            "description": "Returns IDs only",
            "name": "onlyId",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "example": 10
            },
            "required": false,
            "name": "pageSize",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "example": 1
            },
            "required": false,
            "name": "pageNumber",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "oneOf": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "data": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "organizationId": {
                                  "type": "string",
                                  "example": "org_123ABC"
                                },
                                "sitecoreContextId": {
                                  "type": "string",
                                  "example": "5tc3b17d-1816-40ef-bbf3-ae6703546552c"
                                },
                                "type": {
                                  "type": "string",
                                  "example": "xmcloud"
                                },
                                "accountId": {
                                  "type": "string",
                                  "example": "account001"
                                },
                                "name": {
                                  "type": "string",
                                  "example": "My Context"
                                },
                                "description": {
                                  "type": "string",
                                  "example": "This is my context"
                                },
                                "resources": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "example": "SitecoreSearchResource"
                                      },
                                      "name": {
                                        "type": "string",
                                        "example": "My Sitecore search resource"
                                      },
                                      "type": {
                                        "type": "string",
                                        "example": "search"
                                      },
                                      "tenantId": {
                                        "type": "string",
                                        "example": "g6c3b17d-1816-40ef-bbf3-ae670311452c"
                                      },
                                      "properties": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "description": "Property id",
                                              "example": "POS"
                                            },
                                            "value": {
                                              "type": "string",
                                              "description": "Property value",
                                              "example": "playwebsite"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "value"
                                          ]
                                        }
                                      },
                                      "tenantName": {
                                        "type": "string",
                                        "example": "tenant name"
                                      },
                                      "tenantProductCode": {
                                        "type": "string",
                                        "example": "Search"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "name",
                                      "type",
                                      "tenantId",
                                      "properties",
                                      "tenantName",
                                      "tenantProductCode"
                                    ]
                                  }
                                }
                              },
                              "required": [
                                "organizationId",
                                "type",
                                "accountId",
                                "resources"
                              ]
                            }
                          },
                          "pageNumber": {
                            "type": "integer",
                            "example": 1
                          },
                          "pageSize": {
                            "type": "integer",
                            "example": 10
                          },
                          "totalCount": {
                            "type": "integer",
                            "example": 100
                          }
                        },
                        "required": [
                          "data",
                          "pageNumber",
                          "pageSize",
                          "totalCount"
                        ]
                      }
                    }
                  },
                  "required": [
                    "oneOf"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request not valid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server-side exception during request execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "instance": {
                      "type": "string",
                      "example": "/v1/context"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "instance",
                    "status"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {}
}