Skip to content

REST API: CRM Deals ​

← All modules

6 endpoints.

GET /api/v1/rest/pipelines ​

Pipelines and their stages

200 — Successful Response

json
{
  "additionalProperties": true,
  "type": "object",
  "title": "Response List Pipelines Api V1 Rest Pipelines Get"
}

GET /api/v1/rest/deals ​

List deals

Parameters

NameInRequiredTypeDescription
pagequerynointeger
per_pagequerynointeger
statusquerynoopen | won | lost
stage_idqueryno
created_sincequeryno
updated_sincequeryno
sortqueryno

200 — Successful Response

json
{
  "type": "object",
  "additionalProperties": true,
  "title": "Response List Deals Api V1 Rest Deals Get"
}

422 — Validation Error

json
{
  "properties": {
    "detail": {
      "items": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}

POST /api/v1/rest/deals ​

Create a deal

Request body

json
{
  "properties": {
    "title": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 300
        },
        {
          "type": "null"
        }
      ],
      "title": "Title"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Description"
    },
    "category": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 120
        },
        {
          "type": "null"
        }
      ],
      "title": "Category"
    },
    "value": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Value"
    },
    "currency": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 8
        },
        {
          "type": "null"
        }
      ],
      "title": "Currency"
    },
    "probability": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 100,
          "minimum": 0
        },
        {
          "type": "null"
        }
      ],
      "title": "Probability"
    },
    "expected_close": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Expected Close"
    },
    "stage_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Stage Id"
    },
    "contact_name": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ],
      "title": "Contact Name"
    },
    "email": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 320
        },
        {
          "type": "null"
        }
      ],
      "title": "Email"
    },
    "phone": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 64
        },
        {
          "type": "null"
        }
      ],
      "title": "Phone"
    },
    "company": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ],
      "title": "Company"
    }
  },
  "type": "object",
  "title": "DealCreateIn"
}

201 — Successful Response

json
{
  "type": "object",
  "additionalProperties": true,
  "title": "Response Create Deal Api V1 Rest Deals Post"
}

422 — Validation Error

json
{
  "properties": {
    "detail": {
      "items": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}

GET /api/v1/rest/deals/stage-changes ​

Recent deal stage changes (polling)

The polling twin of the deal.stage_changed webhook, read from the stage-change activity every move writes. Newest first; id is the activity's, so a poller de-duplicates on it.

Parameters

NameInRequiredTypeDescription
sincequeryno
limitquerynointeger

200 — Successful Response

json
{
  "type": "object",
  "additionalProperties": true,
  "title": "Response Deal Stage Changes Api V1 Rest Deals Stage Changes Get"
}

422 — Validation Error

json
{
  "properties": {
    "detail": {
      "items": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}

GET /api/v1/rest/deals/{deal_id} ​

Get a deal

Parameters

NameInRequiredTypeDescription
deal_idpathyesstring

200 — Successful Response

json
{
  "type": "object",
  "additionalProperties": true,
  "title": "Response Get Deal Api V1 Rest Deals  Deal Id  Get"
}

422 — Validation Error

json
{
  "properties": {
    "detail": {
      "items": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}

PATCH /api/v1/rest/deals/{deal_id} ​

Update a deal / move its stage

Parameters

NameInRequiredTypeDescription
deal_idpathyesstring

Request body

json
{
  "properties": {
    "title": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 300
        },
        {
          "type": "null"
        }
      ],
      "title": "Title"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Description"
    },
    "value": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Value"
    },
    "currency": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 8
        },
        {
          "type": "null"
        }
      ],
      "title": "Currency"
    },
    "probability": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 100,
          "minimum": 0
        },
        {
          "type": "null"
        }
      ],
      "title": "Probability"
    },
    "expected_close": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Expected Close"
    },
    "stage_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Stage Id",
      "description": "Move the deal to this stage (same pipeline)"
    }
  },
  "type": "object",
  "title": "DealUpdateIn"
}

200 — Successful Response

json
{
  "type": "object",
  "additionalProperties": true,
  "title": "Response Update Deal Api V1 Rest Deals  Deal Id  Patch"
}

422 — Validation Error

json
{
  "properties": {
    "detail": {
      "items": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}

Lubb One Documentation