---
title: Model Contracts
slug: devicepark/sdk-documentation/reference/model-contracts
description: Review request, response and nullable field contracts.
docTags: 
createdAt: 2026-08-10T08:03:44.631Z
---

These contracts describe the Device Park public API request and response payloads used by the official SDKs. Java response models expose fields through record-style accessors such as `device.serial()` and `allocation.allocationId()`.

In the .NET SDK every field below maps to a read-only property with the same name in PascalCase, for example `device.Serial` and `allocation.AllocationId`. Request models are built through a nested `Builder` type, for example `new ListDevicesRequest.Builder()`.

## Page

```typescript
interface PageDto<T> {
  size: number;
  page: number;
  totalPages: number;
  totalElements: number;
  data: T[];
}
```

```json
{
  "size": 20,
  "page": 0,
  "totalPages": 1,
  "totalElements": 1,
  "data": []
}
```

## Device and Pool

```typescript
interface Device {
  id: number | null;
  serial: string | null;
  marketName: string | null;
  model: string | null;
  manufacturer: string | null;
  platform: string | null;
  platformVersion: string | null;
  version: string | null;
  state: string | null;
  isSimulator: boolean | null;
  isPublic: boolean | null;
}

interface DeviceApp {
  id: number | null;
  bundleIdentifier: string | null;
  installedAt: string | null;
  updatedAt: string | null;
  isDefault: boolean | null;
}

interface Pool {
  id: string | null;
  name: string | null;
  isDefault: boolean | null;
}

interface CreatePoolRequest {
  name: string;
}
```

`Device.state` is represented as a string by the SDK. Use the documented API constants such as `HEALTHY`, `ALLOCATED` and `RUNNING`, not interface labels such as `Online` or `Busy`. See [Device State Values](docId\:T2lFRSsG2mhohPOA4K26-) for the complete list and meanings.

`DeviceApp` and `ListDeviceAppsRequest` are available in the Node.js and .NET SDKs; the Java SDK does not expose this operation. See [List Device Apps](docId\:JOQ1A2pU5ih-Rqb7TDx_4) for filters, pagination and response behavior.

`isSimulator` and `isPublic` were added to the Java and Node.js `Device` models for master parity. They are also present in the .NET model. They remain nullable because older or environment-specific responses may omit them.

`Pool.isDefault` is also nullable response metadata. `true` means Device Park marks the pool as default, `false` means it does not and `null` means the response omitted the status. It is not an availability flag. Use `pool.id` as `devicePoolId` when creating an allocation. For default-only listing behavior, see [Understanding  isDefault](docId\:fmKLq2CPwGu4aurSboUFg).

`CreatePoolRequest.name` is required, must not be blank and must be unique within the authenticated account. Pool membership methods accept a non-empty list of device serials and return the serials present after the operation. See [Manage Pools](docId\:ObX8hTXvKifuvFe9uTuit).

## Allocation

Request:

```typescript
interface DeviceAllocationRequest {
  serial?: string;
  manufacturer?: string;
  model?: string;
  platform?: string;
  platformVersion?: string;
  devicePoolId?: string;
  priority: number;
  removeApps: RemoveAppSelectionType;
}
```

Response:

```typescript
interface Allocation {
  allocationId: string | null;
  deviceSerial: string | null;
  requestId: string | null;
  position: number | null;
  expiresAt: string | null;
}
```

```json
{
  "allocationId": "allocation-123",
  "deviceSerial": null,
  "requestId": "request-456",
  "position": 2,
  "expiresAt": "2026-07-14T12:30:00Z"
}
```

`priority` defaults to `3` and accepts `1` through `5`. `removeApps` defaults to `NO_REMOVE`; use `REMOVE_WITHOUT_IS_DEFAULT_APPS` to remove non-default applications before allocation. A `null` `deviceSerial` means the allocation response does not yet identify an assigned device. Keep the same `allocationId` while waiting.

## Session

Request:

```typescript
interface DeviceStartSessionRequest {
  allocationId: string;
  companyPoolId?: string;
  videoRecording?: boolean;
  videoRecordingScope?: "FULL_SESSION" | "APPIUM_SESSION";
  userId: number;
  userEmail: string;
  companyId: number;
  companyName: string;
  customVideoRecordingPath?: string;
  appiumVersion?: string;
}
```

The Java, Node.js and .NET SDKs send `videoRecordingScope`. It accepts `FULL_SESSION` or `APPIUM_SESSION` and defaults to `FULL_SESSION`. The Java builder includes that default in the JSON body. Read it from a session with `session.videoRecordingScope()`.

`Session` responses carry the same field. It can be absent on environments that predate the feature, so Java and .NET expose it as a nullable value.

Device Park generates `sessionId`; it is present in the `Session` response and is not accepted as a Start Session request field.

Response:

```typescript
interface Session {
  id: number | null;
  state: string | null;
  client: string | null;
  sessionId: string | null;
  allocationId: string | null;
  startDate: string | null;
  endDate: string | null;
  latestInteractionTime: string | null;
  userId: number | null;
  userEmail: string | null;
  companyId: number | null;
  companyName: string | null;
  deviceSerial: string | null;
  deviceName: string | null;
  deviceModel: string | null;
  deviceManufacturer: string | null;
  devicePlatform: string | null;
  deviceVersion: string | null;
  videoRecording: boolean | null;
  videoRecordingScope: "FULL_SESSION" | "APPIUM_SESSION" | null;
  videoRecordUrl: string | null;
  appiumVersion: string | null;
  createdAt: string | null;
  updatedAt: string | null;
  dataAccessEndDate: string | null;
}
```

`Session.state` is represented as a string by the SDK. Use `ACTIVE`, `CLOSING`, `CLOSED` or `FAILED_TO_CLOSE` when filtering. See [Session State Values](docId\:yDnbFyoHkKjGUefb_-6rf) for their meanings.

## Application and Screen Record

```typescript
interface Application {
  revision: number | null;
  sizeInBytes: number | null;
  version: string | null;
  fileKey: string | null;
  filePath: string | null;
  downloadUrl: string | null;
  createdAt: string | null;
  bundleId: string | null;
  title: string | null;
  ipaVersion: string | null;
  enterprise: boolean | null;
  minimumOsVersion: string | null;
  minSdkVersion: number | null;
}

interface ScreenRecord {
  fileKey: string | null;
  filePath: string | null;
  downloadUrl: string | null;
  createdAt: string | null;
  updatedAt: string | null;
  duration: number | null;
}
```

Download URLs can expire. Persist `fileKey`, not `downloadUrl`, when a stable application or recording identifier is required.

The last six `Application` members are artifact metadata read during upload and returned by both the upload and the list operation. `bundleId`, `title`, `ipaVersion`, `enterprise` and `minimumOsVersion` are populated for IPA artifacts, `minSdkVersion` for APK artifacts, and every one of them is `null` when it cannot be read from the artifact. The Java, Node.js and .NET SDKs expose them as typed members. See [List Applications](docId\:SPDXnMADbDctpaPsO1gbH) for details.

Each `ScreenRecord` describes one stored recording segment. The complete RFC 8216 HLS stream is exposed separately as `Session.videoRecordUrl`; it is not a field of `ScreenRecord`. See [List Screen Records](docId:9voFjQy3NQ7olg4uHLhTK) for readiness, authorization and browser playback guidance.

## Published Constants

```typescript
const SortDirection = {
  ASC: "ASC",
  DESC: "DESC"
} as const;

const SearchOperation = {
  EQUAL: "EQUAL",
  NOT_EQUAL: "NOT_EQUAL",
  GREATER_THAN: "GREATER_THAN",
  LESS_THAN: "LESS_THAN"
} as const;

const RemoveAppSelection = {
  NO_REMOVE: "NO_REMOVE",
  REMOVE_WITHOUT_IS_DEFAULT_APPS: "REMOVE_WITHOUT_IS_DEFAULT_APPS"
} as const;
```

Java and .NET expose the same values as `SortDirection`, `SearchOperation` and `RemoveAppSelection` enums. Filter-key constants and compatibility are documented on each list-operation page and summarized in [Pagination and Filtering](docId\:dGs4iHB5eEr5U28AOL8T_).
