> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nexudus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update CoworkerDelivery

> Update an existing CoworkerDelivery record.

Updates an existing CoworkerDelivery record. You must include the `Id` of the record to update along with all required fields.

## Authentication

<Note>
  This endpoint requires OAuth2 authentication. Include a valid bearer token in the `Authorization` header.
  The authenticated user must be a full unrestricted administrator or have the **`CoworkerDelivery-Edit`** role.
</Note>

## Enums

<Accordion title="eDeliveryType — DeliveryType values">
  | Value | Name      |
  | ----- | --------- |
  | 0     | None      |
  | 1     | Mail      |
  | 2     | Parcel    |
  | 3     | Check     |
  | 4     | Publicity |
  | 5     | Other     |
</Accordion>

<Accordion title="eDeliveryHandlingPreference">
  | Value | Name                       |
  | ----- | -------------------------- |
  | 0     | None                       |
  | 1     | StoreForCollection         |
  | 2     | Forward                    |
  | 3     | OpenScanForward            |
  | 4     | OpenScanRecycle            |
  | 5     | OpenScanShred              |
  | 6     | OpenScanStoreForCollection |
  | 7     | Recycle                    |
  | 8     | ReturnToSender             |
  | 9     | Shred                      |
  | 10    | DepositCheck               |
  | 11    | Unknown                    |
</Accordion>

## Request Body

### Required Fields

<ParamField body="Id" type="integer" required>
  The Id of the CoworkerDelivery record to update.
</ParamField>

<ParamField body="BusinessId" type="integer" required>
  Business Id.
</ParamField>

<ParamField body="Name" type="string" required>
  Short label or description identifying the delivery item.
</ParamField>

<ParamField body="Location" type="string" required>
  Physical location where the delivery is being stored (e.g. mailroom shelf).
</ParamField>

<ParamField body="DeliveryType" type="integer" required>
  Type of delivery item (Mail, Parcel, Check, Publicity, or Other).
</ParamField>

### Optional Fields

<ParamField body="CoworkerId" type="integer">
  Coworker Id.
</ParamField>

<ParamField body="ContractContactId" type="integer">
  Contract Contact Id.
</ParamField>

<ParamField body="ReceivedBy" type="string">
  Name of the staff member who received the delivery.
</ParamField>

<ParamField body="Notes" type="string">
  Free-text notes about the delivery.
</ParamField>

<ParamField body="NewFileDataUrl" type="string">
  New File Data Url.
</ParamField>

<ParamField body="ClearFileDataFile" type="boolean">
  Clear File Data File.
</ParamField>

<ParamField body="NewSignatureUrl" type="string">
  New Signature Url.
</ParamField>

<ParamField body="ClearSignatureFile" type="boolean">
  Clear Signature File.
</ParamField>

<ParamField body="NewScannedFileDataUrl" type="string">
  New Scanned File Data Url.
</ParamField>

<ParamField body="ClearScannedFileDataFile" type="boolean">
  Clear Scanned File Data File.
</ParamField>

<ParamField body="NewForwardedFileDataUrl" type="string">
  New Forwarded File Data Url.
</ParamField>

<ParamField body="ClearForwardedFileDataFile" type="boolean">
  Clear Forwarded File Data File.
</ParamField>

<ParamField body="Collected" type="boolean">
  Whether the customer has collected the delivery.
</ParamField>

<ParamField body="RequiresSignature" type="boolean">
  Whether the customer must sign upon collection.
</ParamField>

<ParamField body="Signed" type="boolean">
  Whether the customer has signed for the delivery.
</ParamField>

<ParamField body="Notified" type="boolean">
  Notified.
</ParamField>

<ParamField body="CollectedOn" type="string">
  Date and time the customer collected the delivery.
</ParamField>

<ParamField body="Billed" type="boolean">
  Billed.
</ParamField>

<ParamField body="HandlingPreference" type="integer">
  How the customer wants this delivery handled (e.g. StoreForCollection, Forward, Shred). See `eDeliveryHandlingPreference?` enum above.
</ParamField>

<ParamField body="CheckDeposited" type="boolean">
  Whether the enclosed check has been deposited.
</ParamField>

<ParamField body="Forwarded" type="boolean">
  Whether the delivery has been forwarded to the customer.
</ParamField>

<ParamField body="Scanned" type="boolean">
  Whether the delivery contents have been scanned.
</ParamField>

<ParamField body="Recycled" type="boolean">
  Whether the delivery has been recycled.
</ParamField>

<ParamField body="Shredded" type="boolean">
  Whether the delivery has been shredded.
</ParamField>

<ParamField body="StoredForCollection" type="boolean">
  Whether the delivery is being held for customer collection.
</ParamField>

<ParamField body="ReturnedToSender" type="boolean">
  Whether the delivery has been returned to sender.
</ParamField>

<ParamField body="CheckDepositedOn" type="string">
  Date and time the check was deposited.
</ParamField>

<ParamField body="ForwardedOn" type="string">
  Date and time the delivery was forwarded.
</ParamField>

<ParamField body="ScannedOn" type="string">
  Date and time the delivery contents were scanned.
</ParamField>

<ParamField body="RecycledOn" type="string">
  Date and time the delivery was recycled.
</ParamField>

<ParamField body="ShreddedOn" type="string">
  Date and time the delivery was shredded.
</ParamField>

<ParamField body="StoredForCollectionOn" type="string">
  Date and time the delivery was placed in storage for collection.
</ParamField>

<ParamField body="ReturnedToSenderOn" type="string">
  Date and time the delivery was returned to sender.
</ParamField>

<ParamField body="ForwardingAddressUniqueId" type="string">
  Forwarding Address Unique Id.
</ParamField>

<ParamField body="CheckDepositedProductUniqueId" type="string">
  Check Deposited Product Unique Id.
</ParamField>

<ParamField body="ForwardedProductUniqueId" type="string">
  Forwarded Product Unique Id.
</ParamField>

<ParamField body="ScannedProductUniqueId" type="string">
  Scanned Product Unique Id.
</ParamField>

<ParamField body="RecycledProductUniqueId" type="string">
  Recycled Product Unique Id.
</ParamField>

<ParamField body="ShreddedProductUniqueId" type="string">
  Shredded Product Unique Id.
</ParamField>

<ParamField body="StoredForCollectionProductUniqueId" type="string">
  Stored For Collection Product Unique Id.
</ParamField>

<ParamField body="ReturnedToSenderProductUniqueId" type="string">
  Returned To Sender Product Unique Id.
</ParamField>

<ParamField body="CollectedProductUniqueId" type="string">
  Collected Product Unique Id.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT \
    "https://spaces.nexudus.com/api/spaces/coworkerdeliveries" \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "BusinessId": 0,
      "Name": "",
      "Location": "",
      "DeliveryType": 0,
      "Id": 87654321
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/spaces/coworkerdeliveries',
    {
      method: 'PUT',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        BusinessId: 0,
        Name: '',
        Location: '',
        DeliveryType: 0,
        Id: 87654321
      })
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.put(
      'https://spaces.nexudus.com/api/spaces/coworkerdeliveries',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN',
          'Content-Type': 'application/json'
      },
      json={
          'BusinessId': 0,
          'Name': '',
          'Location': '',
          'DeliveryType': 0,
          'Id': 87654321
      }
  )

  data = response.json()
  ```
</CodeGroup>

## Response

### 200

<ResponseField name="Status" type="integer">
  HTTP status code. `200` on success.
</ResponseField>

<ResponseField name="Message" type="string">
  A human-readable message confirming the update.
</ResponseField>

<ResponseField name="Value" type="object">
  Contains the `Id` of the updated record.
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `true` if the coworkerdelivery was updated successfully.
</ResponseField>

<ResponseField name="Errors" type="array">
  `null` on success.
</ResponseField>

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "CoworkerDelivery was successfully updated.",
  "Value": {
    "Id": 87654321
  },
  "OpenInDialog": false,
  "OpenInWindow": false,
  "RedirectURL": null,
  "JavaScript": null,
  "UpdatedOn": "2025-01-15T10:30:00Z",
  "UpdatedBy": "admin@example.com",
  "Errors": null,
  "WasSuccessful": true
}
```

### 400

<ResponseField name="Message" type="string">
  A summary of the validation error(s), in the format `PropertyName: error message`.
</ResponseField>

<ResponseField name="Value" type="any">
  `null` on validation failure.
</ResponseField>

<ResponseField name="Errors" type="object[]">
  Array of validation errors.

  <Expandable>
    <ResponseField name="AttemptedValue" type="any">
      The value that was submitted for the field, or `null` if missing.
    </ResponseField>

    <ResponseField name="Message" type="string">
      The validation error message.
    </ResponseField>

    <ResponseField name="PropertyName" type="string">
      The name of the property that failed validation.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `false` when the request fails validation.
</ResponseField>

```json Example Response theme={null}
{
  "Message": "Name: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "Name"
    }
  ],
  "WasSuccessful": false
}
```
