> ## 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>
  ID of the issued by linked to this record.
</ParamField>

<ParamField body="ResponsibleId" type="integer" required>
  ID of the responsible linked to this record.
</ParamField>

<ParamField body="CoworkerId" type="integer" required>
  ID of the coworker linked to this record.
</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>
  ID of the tariff linked to this record.
</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">
  Optional notes or comments about this proposal.
</ParamField>

<ParamField body="DocumentToSendId" type="integer">
  ID of the document to send linked to this record.
</ParamField>

<ParamField body="DocumentToSignId" type="integer">
  ID of the document to sign linked to this record.
</ParamField>

<ParamField body="DocumentToSignHtml" type="string">
  The document to sign html value for this proposal.
</ParamField>

<ParamField body="NewDocumentToSignBinaryDocumentUrl" type="string">
  URL of a new file to upload as the document to sign binary document.
</ParamField>

<ParamField body="ClearDocumentToSignBinaryDocumentFile" type="boolean">
  Set to true to remove the current document to sign binary document file.
</ParamField>

<ParamField body="DocumentToSendHtml" type="string">
  The document to send html value for this proposal.
</ParamField>

<ParamField body="NewDocumentToSendBinaryDocumentUrl" type="string">
  URL of a new file to upload as the document to send binary document.
</ParamField>

<ParamField body="ClearDocumentToSendBinaryDocumentFile" type="boolean">
  Set to true to remove the current document to send binary document file.
</ParamField>

<ParamField body="NewProposalFileUrl" type="string">
  URL of a new file to upload as the proposal file.
</ParamField>

<ParamField body="ClearProposalFileFile" type="boolean">
  Set to true to remove the current proposal file file.
</ParamField>

<ParamField body="Desks" type="integer[]">
  List of desks linked to this record.
</ParamField>

<ParamField body="AddedDesks" type="integer[]">
  The added desks value for this proposal.
</ParamField>

<ParamField body="RemovedDesks" type="integer[]">
  The removed desks value for this proposal.
</ParamField>

<ParamField body="Variants" type="integer[]">
  List of variants linked to this record.
</ParamField>

<ParamField body="AddedVariants" type="integer[]">
  The added variants value for this proposal.
</ParamField>

<ParamField body="RemovedVariants" type="integer[]">
  The removed variants value for this proposal.
</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">
  ID of the discount code linked to this record.
</ParamField>

<ParamField body="StartDateLocal" type="string">
  Date/time value for start date local.
</ParamField>

<ParamField body="SentOnLocal" type="string">
  Date/time value for 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
}
```
