{
  "openapi": "3.0.0",
  "paths": {
    "/ownerships": {
      "post": {
        "operationId": "register",
        "summary": "Register a device",
        "description": "Allows users to claim ownership of a physical device.\n\n       Calling this endpoint validates the device against the Manufacturing Service,\n       provisions it as an active entity in the Resources Service, and automatically\n       updates the user's policies to grant access to the device's data.\n\n       [Read the Internal Workflow documentation](https://connhex.com/docs/devices-ownerships/internal-workflow) for a complete step-by-step architectural breakdown.\n    .\n\nRequired Permission:\n\n- Resource: ```resource:devices```\n\n- Action: ```resource:devices:register```",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/CreateOwnershipDto" }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/CreatedResourceDto" }
              }
            }
          },
          "403": { "description": "" },
          "404": { "description": "" }
        },
        "tags": ["Ownerships"],
        "security": [{ "chx_auth_session": [] }, { "bearer": [] }]
      }
    }
  },
  "info": {
    "title": "connhex-devices-ownerships",
    "description": "",
    "version": "1.0.2",
    "contact": {}
  },
  "tags": [],
  "servers": [{ "url": "https://apis.connhex.com" }],
  "components": {
    "securitySchemes": {
      "bearer": { "type": "http", "scheme": "bearer" },
      "chx_auth_session": {
        "type": "apiKey",
        "in": "cookie",
        "name": "chx_auth_session"
      }
    },
    "schemas": {
      "CreateOwnershipDto": {
        "type": "object",
        "properties": {
          "deviceId": {
            "type": "string",
            "description": "Identifier of the device for which ownership is requested (e.g. serial number)",
            "example": "CTP-0139836"
          }
        },
        "required": ["deviceId"]
      },
      "CreatedResourceDto": {
        "type": "object",
        "properties": {
          "resourceId": {
            "type": "string",
            "description": "The id of the created resource"
          }
        },
        "required": ["resourceId"]
      }
    }
  }
}
