<!--
{
  "availability" : [
    "iOS: 26.1.0 -",
    "iPadOS: 26.1.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PhotoKit",
  "identifier" : "/documentation/Photos/PHAssetResourceUploadJob",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Photos"
    ],
    "preciseIdentifier" : "c:objc(cs)PHAssetResourceUploadJob"
  },
  "title" : "PHAssetResourceUploadJob"
}
-->

# PHAssetResourceUploadJob

An object that represents a request to upload an asset resource.

```
class PHAssetResourceUploadJob
```

## Overview

Use within an application’s `com.apple.photos.background-upload` extension to request an upload of a [`PHAssetResource`](/documentation/Photos/PHAssetResource) to a destination <doc://com.apple.documentation/documentation/Foundation/NSURLRequest>.

When the extension’s principal class receives a call to [`process()`](/documentation/Photos/PHBackgroundResourceUploadExtension/process()) background uploads, it can create new [`PHAssetResourceUploadJob`](/documentation/Photos/PHAssetResourceUploadJob) objects using [`PHAssetResourceUploadJobChangeRequest`](/documentation/Photos/PHAssetResourceUploadJobChangeRequest).

The maximum number of jobs that can be in flight is limited to the [`jobLimit`](/documentation/Photos/PHAssetResourceUploadJob/jobLimit). To make space for new jobs, you must call [`fetchJobs(action:options:)`](/documentation/Photos/PHAssetResourceUploadJob/fetchJobs(action:options:)) and retry/acknowledge them with [`acknowledge()`](/documentation/Photos/PHAssetResourceUploadJobChangeRequest/acknowledge()) or [`retry(destination:)`](/documentation/Photos/PHAssetResourceUploadJobChangeRequest/retry(destination:)) respectively.

## Topics

### Fetching jobs

[`class var jobLimit: Int`](/documentation/Photos/PHAssetResourceUploadJob/jobLimit)

The maximum number of unacknowledged upload jobs allowed.

[`class func fetchJobs(action: PHAssetResourceUploadJob.Action, options: PHFetchOptions?) -> PHFetchResult<PHAssetResourceUploadJob>`](/documentation/Photos/PHAssetResourceUploadJob/fetchJobs(action:options:))

Returns all asset resource upload jobs applicable for a given action.

[`enum Action`](/documentation/Photos/PHAssetResourceUploadJob/Action)

An action to perform on an upload job.

### Inspecting a job

[`var type: PHAssetResourceUploadJob.Type`](/documentation/Photos/PHAssetResourceUploadJob/type-swift.property)

The type of this upload job.

[`enum Type`](/documentation/Photos/PHAssetResourceUploadJob/Type-swift.enum)

Indicates whether a job downloads and then uploads an asset to the server or only downloads it.

[`var destination: URLRequest`](/documentation/Photos/PHAssetResourceUploadJob/destination)

The destination to send the job’s resource.

[`var resource: PHAssetResource`](/documentation/Photos/PHAssetResourceUploadJob/resource)

The asset resource this job promises to upload.

[`var state: PHAssetResourceUploadJob.State`](/documentation/Photos/PHAssetResourceUploadJob/state-swift.property)

The state of this upload job.

[`enum State`](/documentation/Photos/PHAssetResourceUploadJob/State-swift.enum)

The stages of an upload job’s life cycle, from registered with the system through to completion.

[`var error: (any Error)?`](/documentation/Photos/PHAssetResourceUploadJob/error)

The error that caused the job to fail.

[`var responseHeaderFields: [String : String]?`](/documentation/Photos/PHAssetResourceUploadJob/responseHeaderFields)

The HTTP response headers received from the server upon completion of the upload.

## Relationships

### Conforms To

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Sendable`](/documentation/Swift/Sendable)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Hashable`](/documentation/Swift/Hashable)

[`CVarArg`](/documentation/Swift/CVarArg)

### Inherits From

[`PHObject`](/documentation/Photos/PHObject)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)