> ## 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 Proposal

> Update an existing Proposal record.

Updates an existing Proposal 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 **`Proposal-Edit`** role.
</Note>

## Enums

<Accordion title="eProposalStatus — ProposalStatus values">
  | Value | Name     |
  | ----- | -------- |
  | 1     | Draft    |
  | 2     | Sent     |
  | 3     | Accepted |
  | 4     | Rejected |
</Accordion>

## Request Body

### Required Fields

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

<ParamField body="IssuedById" type="integer" required>
  Issued By Id.
</ParamField>

<ParamField body="ResponsibleId" type="integer" required>
  Responsible Id.
</ParamField>

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

<ParamField body="Reference" type="string" required>
  Proposal reference.
</ParamField>

<ParamField body="ProposalStatus" type="integer" required>
  Proposal status.
</ParamField>

<ParamField body="TariffId" type="integer" required>
  Tariff Id.
</ParamField>

<ParamField body="BillingDay" type="integer" required>
  Billing day of month for the initial contract. Becomes read-only after creation; edit via ProposalContract.
</ParamField>

<ParamField body="Quantity" type="integer" required>
  Quantity for the initial contract. Becomes read-only after creation; edit via ProposalContract.
</ParamField>

### Optional Fields

<ParamField body="Notes" type="string">
  Notes.
</ParamField>

<ParamField body="DocumentToSendId" type="integer">
  Document To Send Id.
</ParamField>

<ParamField body="DocumentToSignId" type="integer">
  Document To Sign Id.
</ParamField>

<ParamField body="DocumentToSignHtml" type="string">
  Document To Sign Html.
</ParamField>

<ParamField body="NewDocumentToSignBinaryDocumentUrl" type="string">
  New Document To Sign Binary Document Url.
</ParamField>

<ParamField body="ClearDocumentToSignBinaryDocumentFile" type="boolean">
  Clear Document To Sign Binary Document File.
</ParamField>

<ParamField body="DocumentToSendHtml" type="string">
  Document To Send Html.
</ParamField>

<ParamField body="NewDocumentToSendBinaryDocumentUrl" type="string">
  New Document To Send Binary Document Url.
</ParamField>

<ParamField body="ClearDocumentToSendBinaryDocumentFile" type="boolean">
  Clear Document To Send Binary Document File.
</ParamField>

<ParamField body="NewProposalFileUrl" type="string">
  New Proposal File Url.
</ParamField>

<ParamField body="ClearProposalFileFile" type="boolean">
  Clear Proposal File File.
</ParamField>

<ParamField body="Desks" type="integer[]">
  Desks.
</ParamField>

<ParamField body="AddedDesks" type="integer[]">
  Added Desks.
</ParamField>

<ParamField body="RemovedDesks" type="integer[]">
  Removed Desks.
</ParamField>

<ParamField body="Variants" type="integer[]">
  Variants.
</ParamField>

<ParamField body="AddedVariants" type="integer[]">
  Added Variants.
</ParamField>

<ParamField body="RemovedVariants" type="integer[]">
  Removed Variants.
</ParamField>

<ParamField body="Price" type="number">
  Price override for the initial contract. Becomes read-only after creation; edit via ProposalContract.
</ParamField>

<ParamField body="StartDate" type="string">
  Start date for the initial contract. Becomes read-only after creation; edit via ProposalContract.
</ParamField>

<ParamField body="CancellationLimitDays" type="integer">
  Cancellation limit in days for the initial contract. Becomes read-only after creation; edit via ProposalContract.
</ParamField>

<ParamField body="ContractTerm" type="string">
  Contract term end date for the initial contract. Becomes read-only after creation; edit via ProposalContract.
</ParamField>

<ParamField body="CancellationDate" type="string">
  Cancellation date for the initial contract. Becomes read-only after creation; edit via ProposalContract.
</ParamField>

<ParamField body="ExpirationDate" type="string">
  Proposal expiration date. Becomes read-only after creation; edit via ProposalContract.
</ParamField>

<ParamField body="DiscountCodeId" type="integer">
  Discount Code Id.
</ParamField>

<ParamField body="StartDateLocal" type="string">
  Start Date Local.
</ParamField>

<ParamField body="SentOnLocal" type="string">
  Sent On Local.
</ParamField>

<ParamField body="DoNotIssueInvoice" type="boolean">
  If true, the first invoice is not issued automatically when the proposal is accepted.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT \
    "https://spaces.nexudus.com/api/billing/proposals" \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "IssuedById": 0,
      "ResponsibleId": 0,
      "CoworkerId": 0,
      "Reference": "",
      "ProposalStatus": 0,
      "TariffId": 0,
      "BillingDay": 0,
      "Quantity": 0,
      "Id": 87654321
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/billing/proposals',
    {
      method: 'PUT',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        IssuedById: 0,
        ResponsibleId: 0,
        CoworkerId: 0,
        Reference: '',
        ProposalStatus: 0,
        TariffId: 0,
        BillingDay: 0,
        Quantity: 0,
        Id: 87654321
      })
    }
  );

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

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

  response = requests.put(
      'https://spaces.nexudus.com/api/billing/proposals',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN',
          'Content-Type': 'application/json'
      },
      json={
          'IssuedById': 0,
          'ResponsibleId': 0,
          'CoworkerId': 0,
          'Reference': '',
          'ProposalStatus': 0,
          'TariffId': 0,
          'BillingDay': 0,
          'Quantity': 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 proposal was updated successfully.
</ResponseField>

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

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "Proposal 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": "Reference: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "Reference"
    }
  ],
  "WasSuccessful": false
}
```
