(crm)
- createContact - Creates a new Contact
- getAccount - Get Account
- getContact - Get Contact
- getContactCustomFieldDefinition - Get Contact Custom Field Definition
- getList - Get List
- listAccounts - List Accounts
- listContactCustomFieldDefinitions - List Contact Custom Field Definitions
- listContacts - List Contacts
- listLists - Get all Lists
- updateContact - Update Contact (early access)
Creates a new Contact
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.crm.createContact({
crmCreateContactRequestDto: {
accountIds: [
"account-123",
"account-456",
],
companyName: "Apple Inc.",
customFields: [
{
id: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
name: "Training Completion Status",
remoteId: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
remoteValueId: "e3cb75bf-aa84-466e-a6c1-b8322b257a48",
value: "Completed",
valueId: "value_456",
},
{
id: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
name: "Training Completion Status",
remoteId: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
remoteValueId: "e3cb75bf-aa84-466e-a6c1-b8322b257a48",
value: "Completed",
valueId: "value_456",
},
{
id: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
name: "Training Completion Status",
remoteId: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
remoteValueId: "e3cb75bf-aa84-466e-a6c1-b8322b257a48",
value: "Completed",
valueId: "value_456",
},
],
dealIds: [
"deal-001",
"deal-002",
],
emails: [
"steve@apple.com",
],
firstName: "Steve",
lastName: "Wozniak",
passthrough: {
"other_known_names": "John Doe",
},
phoneNumbers: [
"123-456-7890",
],
},
xAccountId: "<id>",
});
// Handle the result
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { crmCreateContact } from "@stackone/stackone-client-ts/funcs/crmCreateContact.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await crmCreateContact(stackOne, {
crmCreateContactRequestDto: {
accountIds: [
"account-123",
"account-456",
],
companyName: "Apple Inc.",
customFields: [
{
id: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
name: "Training Completion Status",
remoteId: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
remoteValueId: "e3cb75bf-aa84-466e-a6c1-b8322b257a48",
value: "Completed",
valueId: "value_456",
},
{
id: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
name: "Training Completion Status",
remoteId: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
remoteValueId: "e3cb75bf-aa84-466e-a6c1-b8322b257a48",
value: "Completed",
valueId: "value_456",
},
{
id: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
name: "Training Completion Status",
remoteId: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
remoteValueId: "e3cb75bf-aa84-466e-a6c1-b8322b257a48",
value: "Completed",
valueId: "value_456",
},
],
dealIds: [
"deal-001",
"deal-002",
],
emails: [
"steve@apple.com",
],
firstName: "Steve",
lastName: "Wozniak",
passthrough: {
"other_known_names": "John Doe",
},
phoneNumbers: [
"123-456-7890",
],
},
xAccountId: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.CrmCreateContactRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.CrmCreateContactResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
Get Account
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.crm.getAccount({
fields: "id,remote_id,owner_id,remote_owner_id,name,description,industries,annual_revenue,website,addresses,phone_numbers,created_at,updated_at",
id: "<id>",
xAccountId: "<id>",
});
// Handle the result
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { crmGetAccount } from "@stackone/stackone-client-ts/funcs/crmGetAccount.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await crmGetAccount(stackOne, {
fields: "id,remote_id,owner_id,remote_owner_id,name,description,industries,annual_revenue,website,addresses,phone_numbers,created_at,updated_at",
id: "<id>",
xAccountId: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.CrmGetAccountRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.CrmGetAccountResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
Get Contact
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.crm.getContact({
fields: "id,remote_id,first_name,last_name,company_name,emails,phone_numbers,deal_ids,remote_deal_ids,account_ids,remote_account_ids,custom_fields,created_at,updated_at",
id: "<id>",
include: "custom_fields",
xAccountId: "<id>",
});
// Handle the result
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { crmGetContact } from "@stackone/stackone-client-ts/funcs/crmGetContact.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await crmGetContact(stackOne, {
fields: "id,remote_id,first_name,last_name,company_name,emails,phone_numbers,deal_ids,remote_deal_ids,account_ids,remote_account_ids,custom_fields,created_at,updated_at",
id: "<id>",
include: "custom_fields",
xAccountId: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.CrmGetContactRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.CrmGetContactResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
Get Contact Custom Field Definition
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.crm.getContactCustomFieldDefinition({
fields: "id,remote_id,name,description,type,options",
filter: {
updatedAfter: "2020-01-01T00:00:00.000Z",
},
id: "<id>",
updatedAfter: "2020-01-01T00:00:00.000Z",
xAccountId: "<id>",
});
// Handle the result
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { crmGetContactCustomFieldDefinition } from "@stackone/stackone-client-ts/funcs/crmGetContactCustomFieldDefinition.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await crmGetContactCustomFieldDefinition(stackOne, {
fields: "id,remote_id,name,description,type,options",
filter: {
updatedAfter: "2020-01-01T00:00:00.000Z",
},
id: "<id>",
updatedAfter: "2020-01-01T00:00:00.000Z",
xAccountId: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.CrmGetContactCustomFieldDefinitionRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.CrmGetContactCustomFieldDefinitionResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
Get List
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.crm.getList({
fields: "id,remote_id,name,created_at,updated_at,items,type",
id: "<id>",
xAccountId: "<id>",
});
// Handle the result
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { crmGetList } from "@stackone/stackone-client-ts/funcs/crmGetList.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await crmGetList(stackOne, {
fields: "id,remote_id,name,created_at,updated_at,items,type",
id: "<id>",
xAccountId: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.CrmGetListRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.CrmGetListResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
List Accounts
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.crm.listAccounts({
fields: "id,remote_id,owner_id,remote_owner_id,name,description,industries,annual_revenue,website,addresses,phone_numbers,created_at,updated_at",
filter: {
updatedAfter: "2020-01-01T00:00:00.000Z",
},
updatedAfter: "2020-01-01T00:00:00.000Z",
xAccountId: "<id>",
});
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { crmListAccounts } from "@stackone/stackone-client-ts/funcs/crmListAccounts.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await crmListAccounts(stackOne, {
fields: "id,remote_id,owner_id,remote_owner_id,name,description,industries,annual_revenue,website,addresses,phone_numbers,created_at,updated_at",
filter: {
updatedAfter: "2020-01-01T00:00:00.000Z",
},
updatedAfter: "2020-01-01T00:00:00.000Z",
xAccountId: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.CrmListAccountsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.CrmListAccountsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
List Contact Custom Field Definitions
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.crm.listContactCustomFieldDefinitions({
fields: "id,remote_id,name,description,type,options",
filter: {
updatedAfter: "2020-01-01T00:00:00.000Z",
},
updatedAfter: "2020-01-01T00:00:00.000Z",
xAccountId: "<id>",
});
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { crmListContactCustomFieldDefinitions } from "@stackone/stackone-client-ts/funcs/crmListContactCustomFieldDefinitions.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await crmListContactCustomFieldDefinitions(stackOne, {
fields: "id,remote_id,name,description,type,options",
filter: {
updatedAfter: "2020-01-01T00:00:00.000Z",
},
updatedAfter: "2020-01-01T00:00:00.000Z",
xAccountId: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.CrmListContactCustomFieldDefinitionsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.CrmListContactCustomFieldDefinitionsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
List Contacts
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.crm.listContacts({
fields: "id,remote_id,first_name,last_name,company_name,emails,phone_numbers,deal_ids,remote_deal_ids,account_ids,remote_account_ids,custom_fields,created_at,updated_at",
filter: {
updatedAfter: "2020-01-01T00:00:00.000Z",
},
include: "custom_fields",
updatedAfter: "2020-01-01T00:00:00.000Z",
xAccountId: "<id>",
});
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { crmListContacts } from "@stackone/stackone-client-ts/funcs/crmListContacts.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await crmListContacts(stackOne, {
fields: "id,remote_id,first_name,last_name,company_name,emails,phone_numbers,deal_ids,remote_deal_ids,account_ids,remote_account_ids,custom_fields,created_at,updated_at",
filter: {
updatedAfter: "2020-01-01T00:00:00.000Z",
},
include: "custom_fields",
updatedAfter: "2020-01-01T00:00:00.000Z",
xAccountId: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.CrmListContactsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.CrmListContactsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
Get all Lists
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.crm.listLists({
fields: "id,remote_id,name,created_at,updated_at,items,type",
filter: {
updatedAfter: "2020-01-01T00:00:00.000Z",
},
updatedAfter: "2020-01-01T00:00:00.000Z",
xAccountId: "<id>",
});
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { crmListLists } from "@stackone/stackone-client-ts/funcs/crmListLists.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await crmListLists(stackOne, {
fields: "id,remote_id,name,created_at,updated_at,items,type",
filter: {
updatedAfter: "2020-01-01T00:00:00.000Z",
},
updatedAfter: "2020-01-01T00:00:00.000Z",
xAccountId: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.CrmListListsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.CrmListListsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
Update Contact (early access)
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.crm.updateContact({
crmCreateContactRequestDto: {
accountIds: [
"account-123",
"account-456",
],
companyName: "Apple Inc.",
customFields: [
{
id: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
name: "Training Completion Status",
remoteId: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
remoteValueId: "e3cb75bf-aa84-466e-a6c1-b8322b257a48",
value: "Completed",
valueId: "value_456",
},
],
dealIds: [
"deal-001",
"deal-002",
],
emails: [
"steve@apple.com",
],
firstName: "Steve",
lastName: "Wozniak",
passthrough: {
"other_known_names": "John Doe",
},
phoneNumbers: [
"123-456-7890",
],
},
id: "<id>",
xAccountId: "<id>",
});
// Handle the result
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { crmUpdateContact } from "@stackone/stackone-client-ts/funcs/crmUpdateContact.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await crmUpdateContact(stackOne, {
crmCreateContactRequestDto: {
accountIds: [
"account-123",
"account-456",
],
companyName: "Apple Inc.",
customFields: [
{
id: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
name: "Training Completion Status",
remoteId: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
remoteValueId: "e3cb75bf-aa84-466e-a6c1-b8322b257a48",
value: "Completed",
valueId: "value_456",
},
],
dealIds: [
"deal-001",
"deal-002",
],
emails: [
"steve@apple.com",
],
firstName: "Steve",
lastName: "Wozniak",
passthrough: {
"other_known_names": "John Doe",
},
phoneNumbers: [
"123-456-7890",
],
},
id: "<id>",
xAccountId: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.CrmUpdateContactRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.CrmUpdateContactResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |