# Pipedrive

### Overview

The Stacksync Pipedrive API Proxy provides centralized access to Pipedrive APIs through a single HTTPS endpoint.\
You authenticate with your Stacksync service token. Stacksync manages the underlying Pipedrive OAuth connection.

Use it for on‑demand operational tasks and low‑volume reads/writes.\
For continuous, high‑volume sync, use Stacksync Syncs instead.

Operations:

* [Pass Through](#pass-through)

### Pass Through

The Pipedrive Pass Through operation is the primary way to interact with Pipedrive through the Stacksync API Proxy. It lets you invoke any Pipedrive API endpoint that supports OAuth by specifying the full Pipedrive URL, HTTP method, and optional request body.\
\
Use this operation for all Pipedrive use cases, including working with core CRM objects, custom fields, and newly released endpoints. Authentication and routing are managed by Stacksync, so your services, scripts, and internal tools can call Pipedrive securely with a single integration pattern, without embedding Pipedrive credentials or implementing the OAuth flow in each system.

```bash
curl -X [GET | POST | PUT | PATCH | DELETE] 
https://eu.api-proxy.stacksync.com/v1/proxy/INSERT_REQUEST_URL_HERE \
-H "Authorization: Bearer your_api_proxy_service_token" \
-d 'Optional'
```

Example request:

**Read Deal Object Data**

{% tabs %}
{% tab title="cURL" %}

```url
curl -X GET https://eu.api-proxy.stacksync.com/v1/proxy/https://api.pipedrive.com/api/v2/deals \
        -H "Authorization: Bearer your_api_proxy_service_token" \
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://eu.api-proxy.stacksync.com/v1/proxy/https://api.pipedrive.com/api/v2/deals"

headers = {
    "Authorization": "Bearer your_api_proxy_service_token",
}

response = requests.get(url, headers=headers)
print(response.json())
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
const url =
  "https://eu.api-proxy.stacksync.com/v1/proxy/https://api.pipedrive.com/api/v2/deals";

fetch(url, {
  method: "GET",
  headers: {
    Authorization: "Bearer your_api_proxy_service_token",
  },
})
  .then((r) => r.json())
  .then((json) => console.log(json))
  .catch((e) => console.error(e));
```

{% endtab %}
{% endtabs %}

Example response:

```json
{
	"additional_data": {
		"next_cursor": null
	},
	"data": [
		{
			"add_time": "2023-07-28T15:01:14Z",
			"channel": null,
			"channel_id": "1",
			"close_time": null,
			"creator_user_id": 21725832,
			"currency": "USD",
			"custom_fields": {
				"602f3785a3745bd31ed7cfce2be32aeafa99ae92": null,
				"b7e99a09aa681bbf5e17e6275c2cac4df14b622d": null,
				"b9e386b59b4016c602a13078ce7bd355af7fa60a": null,
				"cb6aed1d25e684ecfaf7f7289a59ff4b5dbbc4f7": null,
				"f52877bbb7ada88b5c9e724d16e218f73de9c740": null
			},
			"expected_close_date": "2024-07-31",
			"id": 24,
			"is_deleted": false,
			"label_ids": [
				27,
				28
			],
			"local_close_date": null,
			"local_lost_date": null,
			"local_won_date": null,
			"lost_reason": null,
			"lost_time": null,
			"org_id": 2,
			"origin": "ManuallyCreated",
			"origin_id": null,
			"owner_id": 21725832,
			"person_id": 1,
			"pipeline_id": 1,
			"probability": null,
			"stage_change_time": "2024-07-31T18:24:43Z",
			"stage_id": 5,
			"status": "open",
			"title": "Demo Deal 1",
			"update_time": "2024-08-05T09:27:54Z",
			"value": 0.0,
			"visible_to": 3,
			"won_time": null
		},
		{
			"add_time": "2024-07-28T15:19:21Z",
			"channel": null,
			"channel_id": "1",
			"close_time": null,
			"creator_user_id": 21725832,
			"currency": "USD",
			"custom_fields": {
				"602f3785a3745bd31ed7cfce2be32aeafa99ae92": null,
				"b7e99a09aa681bbf5e17e6275c2cac4df14b622d": null,
				"b9e386b59b4016c602a13078ce7bd355af7fa60a": null,
				"cb6aed1d25e684ecfaf7f7289a59ff4b5dbbc4f7": null,
				"f52877bbb7ada88b5c9e724d16e218f73de9c740": null
			},
			"expected_close_date": "2024-07-25",
			"id": 25,
			"is_deleted": false,
			"label_ids": [
				27,
				28
			],
			"local_close_date": null,
			"local_lost_date": null,
			"local_won_date": null,
			"lost_reason": null,
			"lost_time": null,
			"org_id": 2,
			"origin": "ManuallyCreated",
			"origin_id": null,
			"owner_id": 21725832,
			"person_id": 1,
			"pipeline_id": 1,
			"probability": null,
			"stage_change_time": "2024-07-28T15:38:45Z",
			"stage_id": 2,
			"status": "open",
			"title": "Demo Deal 2",
			"update_time": "2024-08-05T09:27:54Z",
			"value": 4000.0,
			"visible_to": 3,
			"won_time": null
		}
	],
	"success": true
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stacksync.com/api-proxy/pipedrive.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
