curl -X POST "https://api.applivery.io/v1/organizations/{organizationId}/mdm/windows/enterprise/enrollment-tokens" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"type": "object",
"children": {
"sendEmail": {},
"displayName": {},
"tags": {},
"duration": {},
"language": {},
"emailText": {},
"winPolicyId": {},
"winPolicyAssignments": {},
"segmentId": {}
},
"mdmUserId": "698efa6ed851667d9c0aec88"
}'const response = await fetch("https://api.applivery.io/v1/organizations/{organizationId}/mdm/windows/enterprise/enrollment-tokens", {
method: "POST",
headers: {
Authorization: "Bearer <YOUR_API_KEY>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"type": "object",
"children": {
"sendEmail": {},
"displayName": {},
"tags": {},
"duration": {},
"language": {},
"emailText": {},
"winPolicyId": {},
"winPolicyAssignments": {},
"segmentId": {}
},
"mdmUserId": "698efa6ed851667d9c0aec88"
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.applivery.io/v1/organizations/{organizationId}/mdm/windows/enterprise/enrollment-tokens",
headers={"Authorization": "Bearer <YOUR_API_KEY>"},
json={
"type": "object",
"children": {
"sendEmail": {},
"displayName": {},
"tags": {},
"duration": {},
"language": {},
"emailText": {},
"winPolicyId": {},
"winPolicyAssignments": {},
"segmentId": {}
},
"mdmUserId": "698efa6ed851667d9c0aec88"
},
)
data = response.json()Request
authorization
Authorization: Bearer <token>
application/json
{
"type": "object",
"children": {
"sendEmail": {
"type": "boolean",
"flags": {
"insensitive": true,
"presence": "required"
},
"truthy": true,
"falsy": true
},
"displayName": {
"type": "string",
"valids": "",
"rules": {
"name": "max",
"arg": 128
}
},
"tags": {
"type": "array",
"flags": {
"sparse": true
},
"items": {
"type": "string",
"valids": "",
"rules": {
"name": "max",
"arg": 128
}
}
},
"duration": {
"type": "number",
"flags": {
"unsafe": true
},
"invalids": null,
"rules": {
"name": "integer"
}
},
"language": {
"type": "string",
"flags": {
"allowOnly": true
},
"valids": "es",
"invalids": ""
},
"emailText": {
"type": "string",
"valids": ""
},
"winPolicyId": {
"type": "string",
"valids": "",
"rules": {
"name": "regex",
"arg": {
"pattern": "string"
}
}
},
"winPolicyAssignments": {
"type": "array",
"flags": {
"sparse": true
},
"items": {
"type": "object",
"children": {
"winPolicyId": {
"type": "string",
"invalids": "",
"rules": {
"name": "regex",
"arg": {
"pattern": "string"
}
}
},
"priority": {
"type": "number",
"flags": {
"unsafe": true,
"presence": "required"
},
"invalids": null,
"rules": {
"name": "integer"
}
}
}
}
},
"segmentId": {
"type": "number",
"flags": {
"unsafe": true
},
"invalids": null,
"rules": {
"name": "integer"
}
}
},
"mdmUserId": "698efa6ed851667d9c0aec88"
}
Responses
application/json
{
"status": true,
"data": {
"id": "698efa6ed851667d9c0aec88",
"organizationId": "698efa6ed851667d9c0aec88",
"winEnterpriseId": "698efa6ed851667d9c0aec88",
"winDeviceId": "698efa6ed851667d9c0aec88",
"mdmUser": {
"id": "698efa6ed851667d9c0aec88",
"email": "[email protected]"
},
"displayName": "Engineering Laptop - John Doe",
"tags": [
"engineering",
"laptop",
"corporate"
],
"state": "PENDING",
"config": {},
"type": "enrollment",
"subType": "standard",
"updatedAt": "2026-02-10T12: 00:00Z",
"createdAt": "2026-01-15T09: 30:00Z",
"expireAt": "2026-03-15T09: 30:00Z",
"enrollmentLink": "https://mdm.company.com/enroll?token=abc123def456",
"enrollCode": "ABC123",
"winPolicyId": "698efa6ed851667d9c0aec88",
"winPolicyAssignments": [
{
"winPolicyId": "698efa6ed851667d9c0aec88",
"winPolicy": {
"id": "698efa6ed851667d9c0aec88",
"name": "Corporate Security Policy"
},
"priority": 100
}
],
"summary": {
"expirationTimestamp": "2026-03-15T09: 30:00Z"
},
"sendEmail": true,
"emailText": "Welcome to the corporate device management program. Click the link to enroll your device.",
"segmentId": "1"
}
}
application/json
{
"status": false,
"error": {
"code": 5050,
"message": "Feature not allowed for you billing plan"
}
}
application/json
{
"status": false,
"error": {
"code": 4002,
"message": "No auth token"
}
}
application/json
{
"status": false,
"error": {
"code": 3001,
"message": "Entity not found"
}
}