---
title: "Create Or Update OTA Package Info (saveOtaPackageInfo)"
method: POST
path: "/api/otaPackage"
tags: ["ota-package-controller"]
---

# Create Or Update OTA Package Info (saveOtaPackageInfo)

`POST /api/otaPackage`

Create or update the OTA Package Info. When creating OTA Package Info, platform generates OTA Package id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created OTA Package id will be present in the response. Specify existing OTA Package id to update the OTA Package Info. Referencing non-existing OTA Package Id will cause 'Not Found' error. 

OTA Package combination of the title with the version is unique in the scope of tenant. 

Available for users with 'TENANT_ADMIN' authority.

## Request body

- SaveOtaPackageInfoRequest — A JSON value representing the OTA Package.
  - `id` OtaPackageId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'OTA_PACKAGE', required — string
  - `createdTime` integer — Timestamp of the ota package creation, in milliseconds
  - `tenantId` TenantId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'TENANT', required — string
  - `deviceProfileId` DeviceProfileId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'DEVICE_PROFILE', required — string
  - `type` 'FIRMWARE' | 'SOFTWARE' — OTA Package type.
  - `title` string — OTA Package title.
  - `version` string — OTA Package version.
  - `tag` string — OTA Package tag.
  - `url` string — OTA Package url.
  - `hasData` boolean — Indicates OTA Package 'has data'. Field is returned from DB ('true' if data exists or url is set). If OTA Package 'has data' is 'false' we can not assign the OTA Package to the Device or Device Profile.
  - `fileName` string — OTA Package file name.
  - `contentType` string — OTA Package content type.
  - `checksumAlgorithm` 'MD5' | 'SHA256' | 'SHA384' | 'SHA512' | 'CRC32' | 'MURMUR3_32' | 'MURMUR3_128' — OTA Package checksum algorithm.
  - `checksum` string — OTA Package checksum.
  - `dataSize` integer — OTA Package data size.
  - `usesUrl` boolean — Indicates OTA Package uses url. Should be 'true' if uses url or 'false' if will be used data.
  - `name` string
  - `additionalInfo` unknown

## Response `200`

OK

- OtaPackageInfo
  - `id` OtaPackageId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'OTA_PACKAGE', required — string
  - `createdTime` integer — Timestamp of the ota package creation, in milliseconds
  - `tenantId` TenantId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'TENANT', required — string
  - `deviceProfileId` DeviceProfileId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'DEVICE_PROFILE', required — string
  - `type` 'FIRMWARE' | 'SOFTWARE' — OTA Package type.
  - `title` string — OTA Package title.
  - `version` string — OTA Package version.
  - `tag` string — OTA Package tag.
  - `url` string — OTA Package url.
  - `hasData` boolean — Indicates OTA Package 'has data'. Field is returned from DB ('true' if data exists or url is set). If OTA Package 'has data' is 'false' we can not assign the OTA Package to the Device or Device Profile.
  - `fileName` string — OTA Package file name.
  - `contentType` string — OTA Package content type.
  - `checksumAlgorithm` 'MD5' | 'SHA256' | 'SHA384' | 'SHA512' | 'CRC32' | 'MURMUR3_32' | 'MURMUR3_128' — OTA Package checksum algorithm.
  - `checksum` string — OTA Package checksum.
  - `dataSize` integer — OTA Package data size.
  - `name` string
  - `additionalInfo` unknown

---

[API](https://skmtc.net/thingsboard/apis/thingsboard-rest-api.md) · [All operations](https://skmtc.net/thingsboard/apis/thingsboard-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/thingsboard/thingsboard-rest-api/revisions/40169ccdec5c/schema)
