# Enroll a machine on this edge with a protocol + poll config (/docs/api-reference/edges/EdgesController_enrollDevice)

`POST /api/edges/{id}/devices`

Base URL: https://api.xentr.ai

Authentication: bearer token (`Authorization: Bearer <token>`).

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `id` | path | yes | string | Edge UUID |
| `organizationId` | query | yes | string |  |

## Request body

Required.

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "machineId": {
      "type": "string",
      "description": "Machine ID this edge will poll (must exist in the same organization)",
      "example": "uuid-of-machine"
    },
    "protocol": {
      "type": "string",
      "description": "Protocol the edge will speak to this machine (canonical vocabulary)",
      "enum": [
        "fanuc-focas",
        "opc-ua",
        "modbus-tcp",
        "mtconnect",
        "mqtt",
        "andon",
        "manual"
      ],
      "example": "fanuc-focas"
    },
    "address": {
      "description": "Network address of the machine on the factory LAN",
      "allOf": [
        {
          "type": "object",
          "properties": {
            "host": {
              "type": "string",
              "description": "Machine IP or hostname",
              "example": "192.168.1.50"
            },
            "port": {
              "type": "number",
              "description": "Protocol port",
              "example": 8193
            }
          },
          "required": [
            "host",
            "port"
          ]
        }
      ]
    },
    "templateId": {
      "type": "string",
      "description": "Optional device-type template ID to apply (if omitted, dataPoints must be provided explicitly)",
      "example": "fanuc-31i-b-machining-center"
    },
    "dataPoints": {
      "type": "array",
      "description": "Resolved list of data points to poll. If templateId is set, this is populated from the template + customer overrides.",
      "items": {
        "type": "object"
      }
    },
    "pollIntervalMs": {
      "type": "number",
      "description": "Poll interval in milliseconds",
      "example": 1000,
      "default": 1000
    },
    "enabled": {
      "type": "boolean",
      "description": "Whether this device is enabled at creation",
      "default": true
    }
  },
  "required": [
    "machineId",
    "protocol",
    "address"
  ]
}
```

## Responses

### 201: Device enrolled

### 404: Edge, machine, or template not found