Stacksync Documentation
Ask or search…
βŒƒK

Salesforce

The simplest Salesforce API you have every seen!
Salesforce API proxy, get started in seconds without having to setup a connected app in Salesforce. No-code!

TL;DR

This API proxy lets you do any operation on your Salesforce data but removes from you all the complexity of setting up and using the classic Salesforce API 🀩
No need to worry about setting up a connected app, rotating the security token, using bulk API or not, record formatting and more! Everything is managed for you πŸ’†β€β™€οΈ
Operations:

Regions 🌍

Depending on your region, you can use
πŸ‡ͺπŸ‡Ί https://eu.api-proxy.stacksync.cloud/
πŸ‡ΊπŸ‡Έ https://us.api-proxy.stacksync.cloud/

Insert

Insert up to 10 000 records with a single query. Simply supply the field values for each record you want to create. The response will contain one success confirmation per record meaning that, within the same request, each record can succeed or fail independently of each other. For each sent record, you will receive a detailed success or error message.
cURL
Python
Javascript
curl -X POST https://eu.api-proxy.stacksync.cloud/v1/object/insert/Account \
-H "Authorization: Bearer your_api_proxy_service_token" \
-H "Content-Type: application/json" \
-d '{"data":[{"name": "John Doe"},{"name": "Jane Smith"}]}'
import requests
​
object_name = 'Account'
url = f"https://eu.api-proxy.stacksync.cloud/v1/object/insert/{object_name}"
​
data ={
"data" :
[
{
'name': 'John Doe',
'site': 'example.com'
},
{
'name': 'Jane Smith',
'site': 'example.com'
}
]
}
​
api_proxy_service_token = "your_api_proxy_service_token"
​
headers = {
'Authorization': f'Bearer {api_proxy_service_token}',
'Content-Type': 'application/json'
}
​
response = requests.post(url, json=data, headers=headers)
​
const objectName = 'Account';
const url = `https://eu.api-proxy.stacksync.cloud/v1/object/insert/${objectName}`;
​
const data ={
data:
[
{
name: 'John Doe',
},
{
name: 'Jane Smith',
}
]
};
​
const apiProxyServiceToken = 'your_api_proxy_service_token';
​
const headers = {
'Authorization': `Bearer ${apiProxyServiceToken}`,
'Content-Type': 'application/json'
};
​
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => {
console.error(error);
});
Example response body:
{
"data": [
{
"errors": [],
"id": "0010600002BpRZDAA3",
"success": true
},
{
"errors": [],
"id": "0010600002BpRZEAA3",
"success": true
}
]
}
​

Upsert

Create or update (upsert) up to one record per request based on a match_key which can be the record Id or any custom field.
  • If the key is not matched, then a new object record is created.
  • If the key is matched once, then the existing object record is updated.
  • If the key is matched multiple times, then an error is generated and the object record is neither inserted or updated.
cURL
Python
Javascript
curl -X POST https://eu.api-proxy.stacksync.cloud/v1/object/upsert/Account \
-H "Authorization: Bearer your_api_proxy_service_token" \
-H "Content-Type: application/json" \
-d '{"data":[{"name":"Jon Doe"}],"match_key":"name"}'
import requests
​
​
object_name = 'Account'
​
url = f"https://eu.api-proxy.stacksync.cloud/v1/object/upsert/{object_name}"
​
data = {
"data":
[
{
"name": "Jon Doe",
"site": "example.com"
}
],
"match_key": "name"
}
​
api_proxy_service_token = "your_api_proxy_service_token"
​
headers = {
'Authorization': f'Bearer {api_proxy_service_token}',
'Content-Type': 'application/json'
}
​
response = requests.post(url, json=data, headers=headers)
​
const object_name = 'Account';
const url = `https://eu.api-proxy.stacksync.cloud/v1/object/upsert/${object_name}`;
​
const data ={
data:
[
{
name: 'Jon Doe',
"site": "example.com"
}
],
match_key: "name"
};
​
const api_proxy_service_token = 'your_api_proxy_service_token';
​
const headers = {
'Authorization': `Bearer ${apiProxyServiceToken}`,
'Content-Type': 'application/json'
};
​
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => {
console.error(error);
});
​
Example response body:
{
"data": [
{
"errors": [],
"id": "0010600002BpLWtAAN",
"success": true
}
]
}
​

Update

Update up to 10 000 records per request. Existing field values in Salesforce will be overwritten with the new values provided.
cURL
Python
Javascript
curl -X POST https://eu.api-proxy.stacksync.cloud/v1/object/update/Account \
-H "Authorization: Bearer your_api_proxy_service_token" \
-H "Content-Type: application/json" \
-d '{"data":[{"id": "0010600002BpLWtAAN", "name": "John Doe"}, {"id": "0010600002BpLWuAAN", "name": "Jane Smith"}]}'
import requests
​
object_name = 'Account'
​
url = f"https://eu.api-proxy.stacksync.cloud/v1/object/update/{object_name}"
​
data ={
"data":
[
{
'id': '0010600002BpLWtAAN',
'name': 'John Doe',
'site': 'www.example.com'
},
{
'id': '0010600002BpLWuAAN',
'name': 'Jane Smith',
'site': 'www.example.com'
}
]
}
api_proxy_service_token = "your_api_proxy_service_token"
​
headers = {
'Authorization': f'Bearer {api_proxy_service_token}',
'Content-Type': 'application/json'
}
​
response = requests.post(url, json=data, headers=headers)
​
const objectName = 'Account';
const url = `https://eu.api-proxy.stacksync.cloud/v1/object/update/${objectName}`;
​
const data ={
data:
[
{
id: '0010600002BpLWtAAN',
name: 'John Doe',
site: 'www.example.com'
},
{
id: '0010600002BpLWuAAN',
name: 'Jane Smith',
site: 'www.example.com'
}
]
};
​
const apiProxyServiceToken = 'your_api_proxy_service_token';
​
const headers = {
'Authorization': `Bearer ${apiProxyServiceToken}`,
'Content-Type': 'application/json'
};
​
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => {
console.error(error);
});
​
Example response body:
{
"data": [
{
"errors": [],
"id": "0010600002BpLWtAAN",
"success": true
},
{
"errors": [],
"id": "0010600002BpLWuAAN",
"success": true
}
]
}
​

Delete

Delete up to 10 000 records per request.
cURL
Python
Javascript
curl -X POST https://eu.api-proxy.stacksync.cloud/v1/object/delete \
-H "Authorization: Bearer your_api_proxy_service_token" \
-H "Content-Type: application/json" \
-d '{"data": {"ids":["0010600002BpLWtAAN","0010600002BpLWuAAN"]}}'
import requests
​
url = f"https://eu.api-proxy.stacksync.cloud/v1/object/delete"
​
data ={
"data":
{
"ids" : ["0010600002BpLWtAAN","0010600002BpLWuAAN"]
}
}
​
api_proxy_service_token = "your_api_proxy_service_token"
​
headers = {
'Authorization': f'Bearer {api_proxy_service_token}',
'Content-Type': 'application/json'
}
​
response = requests.post(url, json=data, headers=headers)
​
const url = 'https://eu.api-proxy.stacksync.cloud/v1/object/delete';
const data ={
data :
{
ids : ['0010600002BpLWtAAN','0010600002BpLWuAAN']
}
};
​
const api_proxy_service_token = 'your_api_proxy_service_token';
​
const headers = {
'Authorization': `Bearer ${apiProxyServiceToken}`,
'Content-Type': 'application/json'
};
​
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => {
console.error(error);
});
​
Example response body:
{
"data": [
{
"id" : "0010600002BpLWtAAN",
"success" : true,
"errors" : [ ]
},
{
"id" : "0010600002BpLWuAAN",
"success" : true,
"errors" : [ ]
}
]
}
​

Get

Get the content of up to 10 000 records. The number of sObjects returned matches the number of Ids passed in the request.
You can pass the optional fields parameter (list of field names that you want to be returned for each record). If the list of fields is not passed or is empty "fields":[], all fields are returned.
cURL
Python
Javascript
curl -X POST https://eu.api-proxy.stacksync.cloud/v1/object/get/Account \
-H "Authorization: Bearer your_api_proxy_service_token" \
-H "Content-Type: application/json" \
-d '{"data": {"ids": ["0010600002BpLWuAAN", "0010600002BpLWtAAN"], "fields": ["Name"]}}'
import requests
​
object_name = 'Account'
​
url = f"https://eu.api-proxy.stacksync.cloud/v1/object/get/{object_name}"
​
data ={
"data":
{
"ids" : ["0010600002BpLWuAAN", "0010600002BpLWtAAN"],
"fields" : ["Name"]
}
}
​
api_proxy_service_token = "your_api_proxy_service_token"
​
headers = {
'Authorization': f'Bearer {api_proxy_service_token}',
'Content-Type': 'application/json'
}
​
response = requests.post(url, json=data, headers=headers)
​
const object_name = 'Account';
const url = `https://eu.api-proxy.stacksync.cloud/v1/object/get/${object_name}`;
​
const data ={
data:
{
ids: ["0010600002BpLWuAAN", "0010600002BpLWtAAN"],
fields: ["Name"]
}
};
​
const api_proxy_service_token = 'your_api_proxy_service_token';
​
const headers = {
'Authorization': `Bearer ${apiProxyServiceToken}`,
'Content-Type': 'application/json'
};
​
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => {
console.error(error);
});
​
Example response body:
{
"data": [
{
"Id": "0010600002BpLWuAAN",
"Name": "John Doe",
"attributes": {
"type": "Account",
"url": "/services/data/v57.0/sobjects/Account/0010600002BpLWuAAN"
}
},
{
"Id": "0010600002BpLWtAAN",
"Name": "Jane Smith",
"attributes": {
"type": "Account",
"url": "/services/data/v57.0/sobjects/Account/0010600002BpLWtAAN"
}
}
]
}
​

SOQL

Executes an SOQL query on your Salesforce instance.
cURL
Python
Javascript
curl -X POST https://eu.api-proxy.stacksync.cloud/v1/object/soql \
-H "Authorization: Bearer your_api_proxy_service_token" \
-H "Content-Type: application/json" \
-d '{"data": "SELECT Id, Name, Email FROM Contacts"}'
import requests
​
url = f"https://eu.api-proxy.stacksync.cloud/v1/object/soql"
​
data = {
'data': 'SELECT Id, Name, Email FROM contacts'
}
​
api_proxy_service_token = "your_api_proxy_service_token"
​
headers = {
'Authorization': f'Bearer {api_proxy_service_token}',
'Content-Type': 'application/json'
}
​
response = requests.post(url, json=data, headers=headers)
const url = "https://eu.api-proxy.stacksync.cloud/v1/object/soql";
​
const data = {
data: "SELECT Id, Name, Email FROM contacts",
};
​
const api_proxy_service_token = "your_api_proxy_service_token";
​
const headers = {
"Authorization": `Bearer ${apiProxyServiceToken}`,
"Content-Type": "application/json",
};
​
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(data),
})
.then((response) => response.json())
.then((data) => {
console.log(data);
})
.catch((error) => {
console.error(error);
});
​
​

Describe Salesforce Instance

Retrieves metadata for the Salesforce instance, containing a list of every available objects.
cURL
Python
Javascript
curl -X POST https://eu.api-proxy.stacksync.cloud/v1/describe \
-H "Authorization: Bearer your_api_proxy_service_token" \
-H "Content-Type: application/json"
import requests
​
url = f"https://eu.api-proxy.stacksync.cloud/v1/describe"
​
api_proxy_service_token = "your_api_proxy_service_token"
​
headers = {
'Authorization': f'Bearer {api_proxy_service_token}',
'Content-Type': 'application/json'
}
​
response = requests.post(url, headers=headers)
const url = "https://api-proxy.stacksync.cloud/v1/describe";
const api_proxy_service_token = "your_api_proxy_service_token";
​
const headers = {
"Authorization": `Bearer ${apiProxyServiceToken}`,
"Content-Type": "application/json",
};
​
fetch(url, {
method: "POST",
headers: headers
})
.then((response) => response.json())
.then((data) => {
console.log(data);
})
.catch((error) => {
console.error(error);
});
​
​

Describe Object

Retrieves the metadata for a specific Salesforce table.
cURL
Python
Javascript
curl -X POST https://eu.api-proxy.stacksync.cloud/v1/describe/{object_name} \
-H "Authorization: Bearer your_api_proxy_service_token" \
-H "Content-Type: application/json"
import requests
​
object_name = "Account"
​
url = f"https://eu.api-proxy.stacksync.cloud/v1/describe/{object_name}"
​
api_proxy_service_token = "your_api_proxy_service_token"
​
headers = {
'Authorization': f'Bearer {api_proxy_service_token}',
'Content-Type': 'application/json'
}
​
response = requests.post(url, headers=headers)
const objectName = "Account";
const url = `https://eu.api-proxy.stacksync.cloud/v1/describe/${objectName}`;
​
const apiProxyServiceToken = "your_api_proxy_service_token";
​
const headers = {
'Authorization': `Bearer ${apiProxyServiceToken}`,
'Content-Type': 'application/json'
};
​
fetch(url, {
method: 'POST',
headers: headers
})
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => {
console.error(error);
});
​

Add a custom field to a Salesforce object

Add a custom field to a Salesforce object. Standard and custom objects are supported
the required request body parameters are:
  • type the type of the custom field you wish to create
  • name the name of the custom field you wish to create
  • label the label associated to the custom field you wish to create
type can be any of the Fieldtypes presented here​
Unless otherwise noted, all fields are creatable, filterable, and nillable.
some optional parameters may be required depending on the type, (eg: length is required when creating a custom field of type Text)
Learn more about the API behavior here.
cURL
Python
Javascript
curl -X POST https://eu.api-proxy.stacksync.cloud/v1/object/add_custom_field/{object_name} \
-H "Authorization: Bearer your_api_proxy_service_token" \
-H "Content-Type: application/json" \
-d '{"data": {"name": "field_name", "type": "field_type", "label": "field_label"}}'
import requests
​
headers = {
'Authorization': 'Bearer your_api_proxy_service_token',
# Already added when you pass json=
# 'Content-Type': 'application/json',
}
​
json_data = {
'data': {
'name': 'field_name',
'type': 'field_type',
'label': 'field_label'
},
}
​
response = requests.post(
'https://eu.api-proxy.stacksync.cloud/v1/object/add_custom_field/{object_name}',
headers=headers,
json=json_data,
)
fetch('https://eu.api-proxy.stacksync.cloud/v1/object/add_custom_field/{object_name}'
method: 'POST',
headers: {
'Authorization': 'Bearer your_api_proxy_service_token',
'Content-Type': 'application/json'
},
// body: '{"data": {"field_name": "field_name", "field_type": "field_type"}}',
body: JSON.stringify({
'data': {
'field_name': 'field_name',
'field_type': 'field_type'
}
})
});
Example Response Body:
{
"data": {
"errors": [],
"id": "01N7R00000FlUGDUA3",
"infos": [],
"success": true,
"warnings": []
},
"msg": "custom field added successfully"
}
Example requests for different field types:
Text
Picklist field
curl -X POST https://eu.api-proxy.stacksync.cloud/v1/object/add_custom_field/{object_name} \
-H "Authorization: Bearer *****" \
-H "Content-Type: application/json" \
-d '{"data":
{"name": "field_name",
"type": "Text",
"label": "list_field",
"length":100}}'
Example:
curl -X POST
​
https://eu.api-proxy.stacksync.cloud/v1/object/add_custom_field/{object_name} \
-H "Authorization: Bearer ******" \
-H "Content-Type: application/json" \
-d '{
"data": {
"name": "picklistField",
"type": "Picklist",
"label": "picklistField",
"valueSet": {
"restricted": false,
"valueSetDefinition": {
"sorted": false,
"value": [
{
"fullName": "Option1",
"default": false
},
{
"fullName": "Option2",
"default": false
},
{
"fullName": "Option3",
"default": false
}
]
}
}
}
}'
When a custom field is created, it is by default not visible to all profiles of the Salesforce organization. Users with different roles cannot see the newly created custom field.
The Field-Level Security needs to be modified after the Custom Field is created to enable other Salesforce profiles to see the field. Stacksync enables Custom Field Visibility for the following profiles:
  • System Administrator
  • Standard User
How to enable custom field for other profiles:
  1. 1.
    Click on Setup
    ​
  2. 2.
    Go to Object Manager
    ​
    ​
  3. 3.
    Select the related Object
​
  1. 4.
    Select Fields & Relationships
​
  1. 5.
    Select the Custom Field
​
  1. 6.
    Select Field-Level Security & make it visible to the user groups you want
​
​
To make the custom Field visible in a layout:
  1. 1.
    Click on Setup
    ​
  2. 2.
    Go to Object Manager
    ​
  3. 3.
    Select the related Object
    ​
  4. 4.
    Go to the Page Layout section
    ​
  5. 5.
    Select and edit the Layout you want to include the custom field you have just created

Pass Through

Make a request to any Salesforce API by providing the URL, Request Method and the Request Body.
A request will be sent to the URL provided using the request method and request body. The request body can be empty.
curl -X [GET | POST | PUT | PATCH | DELETE]
https://eu.api-proxy.stacksync.cloud/v1/proxy/INSERT_REQUEST_URL_HERE \
-H "Authorization: Bearer your_api_proxy_service_token" \
-d 'Optional'
​
Example request:
Get Account Record
cURL
Python
Javascript
curl -X GET https://eu.api-proxy.stacksync.cloud/v1/proxy/https://MyDomainName.my.salesforce.com/services/data/v60.0/sobjects/Account/0017S00000GYoL3QAL \
-H "Authorization: Bearer your_api_proxy_service_token"
import requests
​
url = "https://eu.api-proxy.stacksync.cloud/v1/proxy/https://MyDomainName.my.salesforce.com/services/data/v60.0/sobjects/Account/0017S00000GYoL3QAL"
​
api_proxy_service_token = "your_api_proxy_service_token"
​
headers = {
'Authorization': f'Bearer {api_proxy_service_token}'
}
​
response = requests.get(url, headers=headers)
​
const url = `https://eu.api-proxy.stacksync.cloud/v1/proxy/https://MyDomainName.my.salesforce.com/services/data/v60.0/sobjects/Account/0017S00000GYoL3QAL`;
​
const api_proxy_service_token = 'your_api_proxy_service_token';
​
const headers = {
'Authorization': `Bearer ${apiProxyServiceToken}`
};
​
fetch(url, {
method: 'GET',
headers: headers
})
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => {
console.error(error);
});
​