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

# Create CrmOpportunity

> Create a new CrmOpportunity record.

A CRM opportunity (CrmOpportunity) is a potential customer deal in a location's CRM board, assigned to one CRM stage and tracked from enquiry through an in-progress, won, or lost outcome; moving it to a stage can run that stage's configured automation.

## 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 **`CrmOpportunity-Create`** role.
</Note>

## Enums

<Accordion title="eCrmOpportunitySource">
  | Value | Name |
  | - | - |
  | 1 | Web |
  | 2 | Phone |
  | 4 | Webinar |
  | 5 | Referral |
  | 6 | PrintAdvert |
  | 7 | PurchasedList |
  | 8 | WordOfMouth |
  | 9 | DirectEmail |
  | 10 | EmailMarketing |
  | 11 | Broker |
  | 12 | PropertyAgent |
  | 13 | Facebook |
  | 14 | Linkedin |
  | 15 | Instagram |
  | 16 | Twitter |
  | 17 | HubbleHq |
  | 18 | LiquidSpace |
  | 19 | GoogleSearch |
  | 20 | SpacePool |
  | 21 | InstantOffices |
  | 22 | OfficeFreedom |
  | 23 | FlexiOffices |
  | 24 | Workthere |
  | 25 | Kontor |
  | 26 | Valve |
  | 98 | OtherSocialNetwork |
  | 99 | Other |
</Accordion>

<Accordion title="eCrmOpportunityLossReason">
  | Value | Name |
  | - | - |
  | 1 | Timing |
  | 2 | Need |
  | 3 | PoorQualification |
  | 4 | Price |
  | 5 | Feature |
  | 6 | LostMomentum |
  | 7 | Competition |
  | 8 | ContractTerm |
  | 9 | Duplicate |
  | 10 | Waitlist |
  | 11 | NotReturningCalls |
  | 12 | LackOfFacilities |
  | 13 | NoPetPolicy |
  | 14 | NoRightFit |
  | 15 | Location |
  | 16 | Entrance |
  | 17 | Errors |
  | 18 | Archived |
  | 19 | SearchOnHold |
  | 20 | RelocationOnHold |
  | 99 | Other |
</Accordion>

<Accordion title="eCrmOpportunityStatus — Status values">
  | Value | Name |
  | - | - |
  | 1 | InProgress |
  | 2 | Won |
  | 3 | Lost |
</Accordion>

## Request Body

### Required Fields

<ParamField body="CrmBoardColumnId" type="integer" required>
  ID of the CRM stage that contains this opportunity and determines its location access; changing it moves the opportunity and runs that stage's arrival actions..
</ParamField>

<ParamField body="CoworkerId" type="integer" required>
  ID of the customer this opportunity tracks; a customer is required by backend validation even though the relationship metadata is nullable..
</ParamField>

<ParamField body="Status" type="integer" required>
  Lifecycle status: InProgress (1) is active, Won (2) records a successful outcome, and Lost (3) records an unsuccessful outcome; setting Won or Lost stamps the matching terminal timestamp if it is empty.. Defaults to `InProgress`.
</ParamField>

<ParamField body="Position" type="integer" required>
  Requested relative display order among in-progress opportunities in the current stage; the server normalizes the stage order after create or update..
</ParamField>

### Optional Fields

<ParamField body="Name" type="string">
  Optional operator-facing label for this opportunity, useful when a customer has opportunities in multiple CRM boards..
</ParamField>

<ParamField body="TeamId" type="integer">
  Optional ID of the team associated with this opportunity..
</ParamField>

<ParamField body="OpportunityTypeId" type="integer">
  Optional ID of the opportunity type used to categorize this CRM opportunity..
</ParamField>

<ParamField body="ResponsibleId" type="integer">
  Optional ID of the staff user responsible for following up this opportunity..
</ParamField>

<ParamField body="ReferrerId" type="integer">
  Optional ID of the customer who referred this opportunity..
</ParamField>

<ParamField body="AgentId" type="integer">
  Optional ID of the customer record representing the referring agent or broker..
</ParamField>

<ParamField body="Notes" type="string">
  Optional internal notes about this opportunity and its follow-up..
</ParamField>

<ParamField body="Completed" type="boolean">
  Whether this opportunity is marked complete; use Status to record whether it was won or lost..
</ParamField>

<ParamField body="DueDate" type="string">
  Optional date and time by which this opportunity requires follow-up; the backend compares it against UTC for overdue CRM counts..
</ParamField>

<ParamField body="Value" type="number">
  Optional expected revenue amount if this opportunity is won, in the parent CRM board location's currency..
</ParamField>

<ParamField body="Reminded" type="boolean">
  Whether a follow-up reminder has already been sent for this opportunity; this internal state is not exposed to Admin Tool schemas..
</ParamField>

<ParamField body="LeadSource" type="integer">
  Optional acquisition source: Web, Phone, Webinar, Referral, PrintAdvert, PurchasedList, WordOfMouth, DirectEmail, EmailMarketing, Broker, PropertyAgent, Facebook, Linkedin, Instagram, Twitter, HubbleHq, LiquidSpace, GoogleSearch, SpacePool, InstantOffices, OfficeFreedom, FlexiOffices, Workthere, Kontor, Valve, OtherSocialNetwork, or Other.. See `eCrmOpportunitySource?` enum above.
</ParamField>

<ParamField body="LossReason" type="integer">
  Optional reason for a lost opportunity: Timing, Need, PoorQualification, Price, Feature, LostMomentum, Competition, ContractTerm, Duplicate, Waitlist, NotReturningCalls, LackOfFacilities, NoPetPolicy, NoRightFit, Location, Entrance, Errors, Archived, SearchOnHold, RelocationOnHold, or Other; use only when Status is Lost.. See `eCrmOpportunityLossReason?` enum above.
</ParamField>

<ParamField body="WonOn" type="string">
  Read-only UTC timestamp set when Status first becomes Won; change Status rather than setting this date directly..
</ParamField>

<ParamField body="LostOn" type="string">
  Read-only UTC timestamp set when Status first becomes Lost; change Status rather than setting this date directly..
</ParamField>

<ParamField body="UtmSource" type="string">
  Optional UTM source attribution captured from the URL used to submit the originating contact or sign-up form..
</ParamField>

<ParamField body="UtmMedium" type="string">
  Optional UTM medium attribution captured from the URL used to submit the originating contact or sign-up form..
</ParamField>

<ParamField body="UtmCampaign" type="string">
  Optional UTM campaign attribution captured from the URL used to submit the originating contact or sign-up form..
</ParamField>

<ParamField body="UtmContent" type="string">
  Optional UTM content attribution captured from the URL used to submit the originating contact or sign-up form..
</ParamField>

<ParamField body="UtmTerm" type="string">
  Optional UTM search-term attribution captured from the URL used to submit the originating contact or sign-up form..
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST \
    "https://spaces.nexudus.com/api/crm/crmopportunities" \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "CrmBoardColumnId": 0,
      "CoworkerId": null,
      "Status": 0,
      "Position": 0
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/crm/crmopportunities',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        CrmBoardColumnId: 0,
        CoworkerId: null,
        Status: 0,
        Position: 0
      })
    }
  );

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

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

  response = requests.post(
      'https://spaces.nexudus.com/api/crm/crmopportunities',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN',
          'Content-Type': 'application/json'
      },
      json={
          'CrmBoardColumnId': 0,
          'CoworkerId': None,
          'Status': 0,
          'Position': 0
      }
  )

  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 creation.
</ResponseField>

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

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

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

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.