cURL
curl --request PATCH \
--url https://api.dock.us/{version}/deals/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customFields": [
{
"id": "<string>",
"value": "Single line of text"
}
]
}
'import requests
url = "https://api.dock.us/{version}/deals/{id}"
payload = { "customFields": [
{
"id": "<string>",
"value": "Single line of text"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({customFields: [{id: '<string>', value: 'Single line of text'}]})
};
fetch('https://api.dock.us/{version}/deals/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dock.us/{version}/deals/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'customFields' => [
[
'id' => '<string>',
'value' => 'Single line of text'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dock.us/{version}/deals/{id}"
payload := strings.NewReader("{\n \"customFields\": [\n {\n \"id\": \"<string>\",\n \"value\": \"Single line of text\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.dock.us/{version}/deals/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customFields\": [\n {\n \"id\": \"<string>\",\n \"value\": \"Single line of text\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dock.us/{version}/deals/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customFields\": [\n {\n \"id\": \"<string>\",\n \"value\": \"Single line of text\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"deal": {
"id": "RiHO4e0Ju3DS",
"updatedAt": "2021-01-01T00:00:00.000Z",
"createdAt": "2021-01-01T00:00:00.000Z",
"hubspotDealId": "1234567890",
"object": "deal",
"url": "https://api.dock.us/v1/deals/RiHO4e0Ju3DS",
"createdDate": "2024-01-01T00:00:00Z",
"closeDate": "2024-01-01T00:00:00Z",
"name": "Deal 1",
"amount": "100000",
"type": "New Business",
"stage": "Proposal Sent"
}
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "The request could not be understood or was missing required parameters"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Access denied. You are not authorized to access this resource"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Access to this resource is restricted"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource could not be found"
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Please try again later"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "The server has encountered a situation it does not know how to handle"
}
}Deals
Update a deal
Update a deal by ID. Currently this endpoint only supports updating deal custom field values.
PATCH
/
deals
/
{id}
cURL
curl --request PATCH \
--url https://api.dock.us/{version}/deals/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customFields": [
{
"id": "<string>",
"value": "Single line of text"
}
]
}
'import requests
url = "https://api.dock.us/{version}/deals/{id}"
payload = { "customFields": [
{
"id": "<string>",
"value": "Single line of text"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({customFields: [{id: '<string>', value: 'Single line of text'}]})
};
fetch('https://api.dock.us/{version}/deals/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dock.us/{version}/deals/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'customFields' => [
[
'id' => '<string>',
'value' => 'Single line of text'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dock.us/{version}/deals/{id}"
payload := strings.NewReader("{\n \"customFields\": [\n {\n \"id\": \"<string>\",\n \"value\": \"Single line of text\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.dock.us/{version}/deals/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customFields\": [\n {\n \"id\": \"<string>\",\n \"value\": \"Single line of text\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dock.us/{version}/deals/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customFields\": [\n {\n \"id\": \"<string>\",\n \"value\": \"Single line of text\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"deal": {
"id": "RiHO4e0Ju3DS",
"updatedAt": "2021-01-01T00:00:00.000Z",
"createdAt": "2021-01-01T00:00:00.000Z",
"hubspotDealId": "1234567890",
"object": "deal",
"url": "https://api.dock.us/v1/deals/RiHO4e0Ju3DS",
"createdDate": "2024-01-01T00:00:00Z",
"closeDate": "2024-01-01T00:00:00Z",
"name": "Deal 1",
"amount": "100000",
"type": "New Business",
"stage": "Proposal Sent"
}
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "The request could not be understood or was missing required parameters"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Access denied. You are not authorized to access this resource"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Access to this resource is restricted"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource could not be found"
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Please try again later"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "The server has encountered a situation it does not know how to handle"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier
Example:
"RiHO4e0Ju3DS"
Query Parameters
Select the deal properties that should be returned
Available options:
hubspotDealId, salesforceOpportunityId, name, amount, closeDate, createdDate, stage, type, customFields.name, customFields.type, customFields.variableName, customFields.value, createdAt, updatedAt Body
application/json
customFields
(Single-line text · object | Multi-line text · object | Rich text · object | Date · object | Number · object | Single checkbox · object | Multiple checkboxes · object | Dropdown select · object | Radio select · object)[]
Custom fields to update
- Single-line text
- Multi-line text
- Rich text
- Date
- Number
- Single checkbox
- Multiple checkboxes
- Dropdown select
- Radio select
Show child attributes
Show child attributes
Response
Deal updated
Show child attributes
Show child attributes
⌘I