Docly

Docly

Did You Know?

You can create any type of product documentation with Docly

Opportunity

Estimated reading: 12 minutes 22 views

GET /v1/pipelines/:pipelineId/opportunities

				
					https://rest.gohighlevel.com/v1/pipelines/:pipelineId/opportunities?startAfterId=UIaE1WjAwWKdlyD7osQI&startAfter=1603870249758&limit=20				
			

Get opportunities.

 

Allowed filter in the query

Fields Types Example Allowed Options
stageId
string
7915dedc-8f18-44d5-8bc3-77c04e994a10
monetaryValue
number
220
assignedTo
string
082goXVW3lIExEQPOnd3
campaignId
string
Y2I9XM7aO1hncuSOlc9L
startDate
number
epoch timestamp. for ex: 1598107050459
endDate
number
epoch timestamp. for ex: 1614091050459
query
string
?query=john@deo.com
status
string
open
open, won, lost, abandoned

Authorization:

Provide your location api key (Bearer Token). You can find here

AUTHORIZATION Bearer Token

Token

<token>

PARAMS

startAfterId

UIaE1WjAwWKdlyD7osQI

Start After Id

startAfter

1603870249758

Start After

limit

20

Limit Per Page records count. will allow maximum up to 100 and default will be 20

PATH VARIABLES

pipelineId

bCkKGpDsyPP4peuKowkG

(Required) Pipeline Id

EXAMPLE REQUEST (curl)

				
					curl --location 'https://rest.gohighlevel.com/v1/pipelines/bCkKGpDsyPP4peuKowkG/opportunities?startAfterId=UIaE1WjAwWKdlyD7osQI&startAfter=1603870249758&limit=20' \
--header 'Authorization: Bearer <token>'				
			

EXAMPLE RESPONSE (json)

				
					{
  "opportunities": [
    {
      "id": "7XExm1wr8gFeZpl6rQny",
      "name": "First Opp",
      "monetaryValue": 120,
      "pipelineId": "bCkKGpDsyPP4peuKowkG",
      "pipelineStageId": "8b897c8f-b859-49c1-88f2-ed590708a85c",
      "assignedTo": "hxHGVRb1YJUscrCB8eXK",
      "status": "open",
      "source": "form",
      "lastStatusChangeAt": "2020-10-29T09:39:35.472Z",
      "createdAt": "2020-10-29T09:31:30.255Z",
      "updatedAt": "2020-10-29T09:44:02.263Z",
      "contact": {
        "id": "byMEV0NQinDhq8ZfiOi2",
        "name": "John Deo",
        "companyName": "Tesla Inc",
        "email": "john@deo.com",
        "phone": "+1202-555-0107",
        "tags": [
          "ipsum sunt",
          "ipsum mollit deserunt id veniam"
        ]
      }
    },
    {
      "id": "7XExm1wr8gFeZpl6rQny",
      "name": "First Opp",
      "monetaryValue": 120,
      "pipelineId": "bCkKGpDsyPP4peuKowkG",
      "pipelineStageId": "8b897c8f-b859-49c1-88f2-ed590708a85c",
      "assignedTo": "hxHGVRb1YJUscrCB8eXK",
      "status": "open",
      "source": "form",
      "lastStatusChangeAt": "2020-10-29T09:39:35.472Z",
      "createdAt": "2020-10-29T09:31:30.255Z",
      "updatedAt": "2020-10-29T09:44:02.263Z",
      "contact": {
        "id": "byMEV0NQinDhq8ZfiOi2",
        "name": "John Deo",
        "companyName": "Tesla Inc",
        "email": "john@deo.com",
        "phone": "+1202-555-0107",
        "tags": [
          "laborum officia consequat consectetur",
          "amet ea pariatur cupidatat"
        ]
      }
    }
  ],
  "meta": {
    "total": 250,
    "nextPageUrl": "https://rest.gohighlevel.com/v1/pipelines/bCkKGpDsyPP4peuKowkG/opportunities?limit=1&startAfter=1603870249758&startAfterId=UIaE1WjAwWKdlyD7osQI",
    "startAfterId": "UIaE1WjAwWKdlyD7osQI",
    "startAfter": 1603870249758,
    "currentPage": 2,
    "nextPage": 3,
    "prevPage": 1
  }
}				
			

GET /v1/pipelines/:pipelineId/opportunities/:opportunityId

				
					https://rest.gohighlevel.com/v1/pipelines/:pipelineId/opportunities/:opportunityId				
			

Get opportunity by id.

Authorization:

Provide your location api key (Bearer Token). You can find here

AUTHORIZATION Bearer Token

Token

<token>

PATH VARIABLES

pipelineId

bCkKGpDsyPP4peuKowkG

(Required) Pipeline Id

opportunityId

123akv4LFn6C9frZoy3e

(Required) Opportunity Id

EXAMPLE REQUEST (curl)

				
					curl --location 'https://rest.gohighlevel.com/v1/pipelines/bCkKGpDsyPP4peuKowkG/opportunities/123akv4LFn6C9frZoy3e' \
--header 'Authorization: Bearer <token>'				
			

EXAMPLE RESPONSE (json)

				
					{
  "id": "7XExm1wr8gFeZpl6rQny",
  "name": "First Opp",
  "monetaryValue": 120,
  "pipelineId": "bCkKGpDsyPP4peuKowkG",
  "pipelineStageId": "8b897c8f-b859-49c1-88f2-ed590708a85c",
  "assignedTo": "hxHGVRb1YJUscrCB8eXK",
  "status": "open",
  "source": "form",
  "lastStatusChangeAt": "2020-10-29T09:39:35.472Z",
  "createdAt": "2020-10-29T09:31:30.255Z",
  "updatedAt": "2020-10-29T09:44:02.263Z",
  "contact": {
    "id": "byMEV0NQinDhq8ZfiOi2",
    "name": "John Deo",
    "companyName": "Tesla Inc",
    "email": "john@deo.com",
    "phone": "+1202-555-0107",
    "tags": [
      "occaecat do Lorem",
      "magna ipsum in"
    ]
  }
}				
			

PUT /v1/pipelines/:pipelineId/opportunities/:opportunityId

				
					https://rest.gohighlevel.com/v1/pipelines/:pipelineId/opportunities/:opportunityId				
			

Update Opportunity.

Required JSON fields in the body

Fields Types Example Allowed Options
title
string
First Opps
stageId
string
7915dedc-8f18-44d5-8bc3-77c04e994a10
status
string
open
open, won, lost, abandoned

Allowed JSON fields in the body

Fields Types Example
monetaryValue
number
220
assignedTo
string
082goXVW3lIExEQPOnd3
contactId
string
mTkSCb1UBjb5tk4OvB69
email
string
john@deo.com
name
string
John Deo
phone
string
+1202-555-0107
tags
array
["tag1", "tag2"]
companyName
string
Tesla Inc

Authorization:

Provide your location api key (Bearer Token). You can find here

AUTHORIZATION Bearer Token

Token

<token>

HEADERS

Content-Type

application/json

PATH VARIABLES

pipelineId

bCkKGpDsyPP4peuKowkG

(Required) Pipeline Id

opportunityId

123akv4LFn6C9frZoy3e

(Required) Opportunity Id

BODY raw (json)

				
					{
    "title": "First Opp",
    "status": "open",
    "stageId": "7915dedc-8f18-44d5-8bc3-77c04e994a10",
    "email": "elon@musk.com",
    "phone": "+1202-555-0107",
    "assignedTo": "082goXVW3lIExEQPOnd3",
    "monetaryValue": 122.22,
    "source": "public api",
    "contactId": "mTkSCb1UBjb5tk4OvB69",
    "name": "Elon Musk",
    "companyName": "Tesla",
    "tags": [
        "voluptate do et sed",
        "voluptate dolore Ut"
    ]
}				
			

EXAMPLE REQUEST (curl)

				
					curl --location --request PUT 'https://rest.gohighlevel.com/v1/pipelines/bCkKGpDsyPP4peuKowkG/opportunities/123akv4LFn6C9frZoy3e' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
    "title": "First Opp",
    "status": "open",
    "stageId": "7915dedc-8f18-44d5-8bc3-77c04e994a10",
    "email": "elon@musk.com",
    "phone": "+1202-555-0107",
    "assignedTo": "082goXVW3lIExEQPOnd3",
    "monetaryValue": 122.22,
    "source": "public api",
    "contactId": "mTkSCb1UBjb5tk4OvB69",
    "name": "Elon Musk",
    "companyName": "Tesla",
    "tags": [
        "tempor ea adipisicing ut amet",
        "voluptate irure"
    ]
}'				
			

EXAMPLE RESPONSE (json)

				
					{
  "id": "7XExm1wr8gFeZpl6rQny",
  "name": "First Opp",
  "monetaryValue": 120,
  "pipelineId": "bCkKGpDsyPP4peuKowkG",
  "pipelineStageId": "8b897c8f-b859-49c1-88f2-ed590708a85c",
  "assignedTo": "hxHGVRb1YJUscrCB8eXK",
  "status": "open",
  "source": "form",
  "lastStatusChangeAt": "2020-10-29T09:39:35.472Z",
  "createdAt": "2020-10-29T09:31:30.255Z",
  "updatedAt": "2020-10-29T09:44:02.263Z",
  "contact": {
    "id": "byMEV0NQinDhq8ZfiOi2",
    "name": "John Deo",
    "companyName": "Tesla Inc",
    "email": "john@deo.com",
    "phone": "+1202-555-0107",
    "tags": [
      "occaecat do Lorem",
      "magna ipsum in"
    ]
  }
}				
			

DELETE /v1/pipelines/:pipelineId/opportunities/:opportunityId

				
					https://rest.gohighlevel.com/v1/pipelines/:pipelineId/opportunities/:opportunityId				
			

Delete opportunity

Authorization:

Provide your location api key (Bearer Token). You can find here

AUTHORIZATION Bearer Token

Token

<token>

PATH VARIABLES

pipelineId

bCkKGpDsyPP4peuKowkG

(Required) Pipeline Id

opportunityId

123akv4LFn6C9frZoy3e

(Required) Opportunity Id

EXAMPLE REQUEST (curl)

				
					curl --location --request DELETE 'https://rest.gohighlevel.com/v1/pipelines/bCkKGpDsyPP4peuKowkG/opportunities/123akv4LFn6C9frZoy3e' \
--header 'Authorization: Bearer <token>'				
			

EXAMPLE RESPONSE (json)

				
					""				
			

POST /v1/pipelines/:pipelineId/opportunities/

				
					https://rest.gohighlevel.com/v1/pipelines/:pipelineId/opportunities/				
			

Create opportunity.

Required JSON fields in the body

Fields Types Example Allowed Options
title
string
First Opps
stageId
string
7915dedc-8f18-44d5-8bc3-77c04e994a10
contactId (or email or phone)
string
mTkSCb1UBjb5tk4OvB69
email (or contactId or phone)
string
john@deo.com
phone (or contactId or email)
string
+1202-555-0107
status
string
open
open, won, lost, abandoned

Allowed JSON fields in the body

Fields Types Example
monetaryValue
number
220
assignedTo
string
082goXVW3lIExEQPOnd3
name
string
John Deo
tags
array
["tag1", "tag2"]
companyName
string
Tesla Inc

Authorization:

Provide your location api key (Bearer Token). You can find here

AUTHORIZATION Bearer Token

Token

<token>

HEADERS

Content-Type

application/json

PATH VARIABLES

pipelineId

bCkKGpDsyPP4peuKowkG

(Required) Pipeline Id

BODY raw (json)

				
					{
    "title": "First Opp",
    "status": "open",
    "stageId": "7915dedc-8f18-44d5-8bc3-77c04e994a10",
    "email": "elon@musk.com",
    "phone": "+1202-555-0107",
    "assignedTo": "082goXVW3lIExEQPOnd3",
    "monetaryValue": 122.22,
    "source": "public api",
    "contactId": "mTkSCb1UBjb5tk4OvB69",
    "name": "Elon Musk",
    "companyName": "Tesla",
    "tags": [
        "tempor ea adipisicing ut amet",
        "voluptate irure"
    ]
}				
			

EXAMPLE REQUEST (curl)

				
					curl --location 'https://rest.gohighlevel.com/v1/pipelines/bCkKGpDsyPP4peuKowkG/opportunities/' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
    "title": "First Opp",
    "status": "open",
    "stageId": "7915dedc-8f18-44d5-8bc3-77c04e994a10",
    "email": "elon@musk.com",
    "phone": "+1202-555-0107",
    "assignedTo": "082goXVW3lIExEQPOnd3",
    "monetaryValue": 122.22,
    "source": "public api",
    "contactId": "mTkSCb1UBjb5tk4OvB69",
    "name": "Elon Musk",
    "companyName": "Tesla",
    "tags": [
        "tempor ea adipisicing ut amet",
        "voluptate irure"
    ]
}'				
			

EXAMPLE RESPONSE (json)

				
					{
  "id": "7XExm1wr8gFeZpl6rQny",
  "name": "First Opp",
  "monetaryValue": 120,
  "pipelineId": "bCkKGpDsyPP4peuKowkG",
  "pipelineStageId": "8b897c8f-b859-49c1-88f2-ed590708a85c",
  "assignedTo": "hxHGVRb1YJUscrCB8eXK",
  "status": "open",
  "source": "form",
  "lastStatusChangeAt": "2020-10-29T09:39:35.472Z",
  "createdAt": "2020-10-29T09:31:30.255Z",
  "updatedAt": "2020-10-29T09:44:02.263Z",
  "contact": {
    "id": "byMEV0NQinDhq8ZfiOi2",
    "name": "John Deo",
    "companyName": "Tesla Inc",
    "email": "john@deo.com",
    "phone": "+1202-555-0107",
    "tags": [
      "occaecat do Lorem",
      "magna ipsum in"
    ]
  }
}				
			

PUT /v1/pipelines/:pipelineId/opportunities/:opportunityId/status

				
					https://rest.gohighlevel.com/v1/pipelines/:pipelineId/opportunities/:opportunityId/status				
			

Update opportunity status and stage.

Authorization:

Provide your location api key (Bearer Token). You can find here

AUTHORIZATION Bearer Token

Token

<token>

HEADERS

Content-Type

application/json

PATH VARIABLES

pipelineId

bCkKGpDsyPP4peuKowkG

(Required) Pipeline Id

opportunityId

123akv4LFn6C9frZoy3e

(Required) Opportunity Id

BODY raw (json)

				
					{
    "status": "open",
    "stageId": "7915dedc-8f18-44d5-8bc3-77c04e994a10"
}				
			

EXAMPLE REQUEST (curl)

				
					curl --location --request PUT 'https://rest.gohighlevel.com/v1/pipelines/bCkKGpDsyPP4peuKowkG/opportunities/123akv4LFn6C9frZoy3e/status' \
--header 'Authorization: Bearer <token>' \
--data '{
    "status": "open",
    "stageId": "7915dedc-8f18-44d5-8bc3-77c04e994a10"
}'				
			

EXAMPLE RESPONSE (json)

				
					""				
			

Leave a Comment

Share this Doc

Opportunity

Or copy link

CONTENTS