> For the complete documentation index, see [llms.txt](https://dronebridge.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dronebridge.gitbook.io/docs/dronebridge-for-esp32-drone-light-show-edition/developers-dlse-api-definition/license.md).

# License

Upload and download DroneBridge license files

## Download the currently loaded license file

> Returns the raw binary license file as an octet stream. The \`Content-Disposition\` header will contain a filename derived from the activation key encoded in Base64, e.g. \`attachment; filename="ABCD1234.dlselic"\`.<br>

```json
{"openapi":"3.0.3","info":{"title":"DroneBridge ESP32 REST API","version":"1.0.0"},"tags":[{"name":"License","description":"Upload and download DroneBridge license files"}],"servers":[{"url":"http://192.168.2.1","description":"Default ESP32 AP address"}],"paths":{"/api/license":{"get":{"tags":["License"],"summary":"Download the currently loaded license file","description":"Returns the raw binary license file as an octet stream. The `Content-Disposition` header will contain a filename derived from the activation key encoded in Base64, e.g. `attachment; filename=\"ABCD1234.dlselic\"`.\n","operationId":"downloadLicense","responses":{"200":{"description":"Binary license file","headers":{"Content-Disposition":{"description":"Suggested filename for the downloaded file","schema":{"type":"string"}}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"500":{"description":"Failed to encode activation key to Base64"}}}}}}
```

## Upload and activate a license file

> Accepts a raw binary license file. Example cURL invocation: \`curl -X POST -H "Content-Type: application/octet-stream" --data-binary @license.dlselic <http://192.168.2.1/api/license\\`><br>

```json
{"openapi":"3.0.3","info":{"title":"DroneBridge ESP32 REST API","version":"1.0.0"},"tags":[{"name":"License","description":"Upload and download DroneBridge license files"}],"servers":[{"url":"http://192.168.2.1","description":"Default ESP32 AP address"}],"paths":{"/api/license":{"post":{"tags":["License"],"summary":"Upload and activate a license file","description":"Accepts a raw binary license file. Example cURL invocation: `curl -X POST -H \"Content-Type: application/octet-stream\" --data-binary @license.dlselic http://192.168.2.1/api/license`\n","operationId":"uploadLicense","requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary","description":"Raw binary license key file (.dlselic)"}}}},"responses":{"200":{"description":"Activation attempted; check `success` field for result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseUploadResponse"}}}},"400":{"description":"Content-Length is 0 or exceeds the size of the license key","content":{"text/plain":{"schema":{"type":"string"}}}},"408":{"description":"Receive timeout while uploading the file"},"500":{"description":"Server-side memory allocation failure","content":{"text/plain":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"LicenseUploadResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the license was activated successfully"},"message":{"type":"string","description":"Human-readable success message (only present on success)"},"type":{"type":"string","description":"License type string (only present on success)"},"expiration":{"type":"string","description":"Expiration date string (only present on success)"},"error":{"type":"string","description":"Error message (only present on failure)"}}}}}}
```
