# Restore device backup

post ` https://app.mk.io/api/v1/projects/:project_name/fleet/devices/:name/restore`

Restores a backup to a specific device.

RBAC Capability Required: `fleet.device.update`

## Authentication

Authorization Bearer

Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Path parameters

- **project_name** `string` Required
- **name** `string` Required

## Request

This endpoint expects an object.

- **metadata** `object` [DefaultMetadata](https://docs.mediakind.com/api-reference/fleets-api/schemas/defaultmetadata) Required

- **displayName** `string` Required  
    A human-readable name for the resource.
  - **labels** `map from strings to string` Optional  
    A dictionary of labels associated with the resource.
    - Maximum number of labels: 32.
    - Maximum length of a label or value: 256 characters.
    - Label: alphanumeric, hyphens and underscores.
    - Value: alphanumeric, hyphens, underscores and spaces.

- **spec** `object` [DeviceRestoreBodySpec](https://docs.mediakind.com/api-reference/fleets-api/schemas/devicerestorebodyspec) Required

- **restoreAssetFile** `boolean` Optional; Defaults to false  
    If the asset file should be restored or not, assuming the backup contains the asset file
  - **restoreFilePath** `string` Required; <=255 characters  
    The relative path to the backup file to restore to the device.

## Response

- **202** The device backup was successfully restored.  
  No response body.

## Errors

### 400 Bad Request

- **error** `object` [ErrorDetail](https://docs.mediakind.com/api-reference/fleets-api/schemas/errordetail) Required  
  Pertinent information about the error  
  - **code** `string` Required  
  - **detail** `string` Required  
  - **extraDetail** `map from strings to any` Optional  
    Extra information regarding this error.
  - **ref** `string` Required  
  - **status** `integer` Required

### 401 Unauthorized

- Same structure as above.

### 403 Forbidden

- Same structure as above.

### 404 Not Found

- Same structure as above.

### 409 Conflict

- Same structure as above.

### 429 Too Many Requests

- Same structure as above.

### 500 Internal Server Error

- Same structure as above.
