# Apideck.Crm
## Class Name
**CrmApi**
## Methods
* [Create Activity](#activitiesAdd)
* [List Activities](#activitiesAll)
* [Delete Activity](#activitiesDelete)
* [Get Activity](#activitiesOne)
* [Update Activity](#activitiesUpdate)
* [Create Company](#companiesAdd)
* [List Companies](#companiesAll)
* [Delete Company](#companiesDelete)
* [Get Company](#companiesOne)
* [Update Company](#companiesUpdate)
* [Create Contact](#contactsAdd)
* [List Contacts](#contactsAll)
* [Delete Contact](#contactsDelete)
* [Get Contact](#contactsOne)
* [Update Contact](#contactsUpdate)
* [Create Lead](#leadsAdd)
* [List Leads](#leadsAll)
* [Delete Lead](#leadsDelete)
* [Get Lead](#leadsOne)
* [Update Lead](#leadsUpdate)
* [Create Note](#notesAdd)
* [List Notes](#notesAll)
* [Delete Note](#notesDelete)
* [Get Note](#notesOne)
* [Update Note](#notesUpdate)
* [Create Opportunity](#opportunitiesAdd)
* [List Opportunities](#opportunitiesAll)
* [Delete Opportunity](#opportunitiesDelete)
* [Get Opportunity](#opportunitiesOne)
* [Update Opportunity](#opportunitiesUpdate)
* [Create Pipeline](#pipelinesAdd)
* [List Pipelines](#pipelinesAll)
* [Delete Pipeline](#pipelinesDelete)
* [Get Pipeline](#pipelinesOne)
* [Update Pipeline](#pipelinesUpdate)
* [Create User](#usersAdd)
* [List Users](#usersAll)
* [Delete User](#usersDelete)
* [Get User](#usersOne)
* [Update User](#usersUpdate)
# Create Activity
Method: **activitiesAdd**
```typescript
crmApi.activitiesAdd(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**activity** | [Activity](../models/Activity.md)| |
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
### Response Type
[`CreateActivityResponse`](../models/CreateActivityResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**201** | Activity created |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
activity: {
activity_datetime: '2021-05-01T12:00:00.000Z',
duration_seconds: 1800,
user_id: '12345',
account_id: '12345',
contact_id: '12345',
company_id: '12345',
opportunity_id: '12345',
lead_id: '12345',
owner_id: '12345',
campaign_id: '12345',
case_id: '12345',
asset_id: '12345',
contract_id: '12345',
product_id: '12345',
solution_id: '12345',
custom_object_id: '12345',
type: 'meeting',
title: 'Meeting',
description: 'More info about the meeting',
note: 'An internal note about the meeting',
location: 'Space',
location_address: {
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: 'elon@musk.com',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
},
all_day_event: false,
private: true,
group_event: true,
event_sub_type: 'debrief',
group_event_type: 'Proposed',
child: false,
archived: false,
deleted: false,
show_as: 'busy',
done: false,
start_datetime: '2021-05-01T12:00:00.000Z',
end_datetime: '2021-05-01T12:30:00.000Z',
activity_date: '2021-05-01',
end_date: '2021-05-01',
recurrent: false,
reminder_datetime: '2021-05-01T17:00:00.000Z',
reminder_set: false,
video_conference_url: 'https://us02web.zoom.us/j/88120759396',
video_conference_id: 'zoom:88120759396',
custom_fields: [
{
id: '2389328923893298',
name: 'employee_level',
description: 'Employee Level',
value: 'Uses Salesforce and Marketo'
}
],
attendees: [
{
name: 'Elon Musk',
first_name: 'Elon',
middle_name: 'D.',
last_name: 'Musk',
prefix: 'Mr.',
suffix: 'PhD',
email_address: 'elon@musk.com',
is_organizer: true,
status: 'accepted'
}
],
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.crm.activitiesAdd(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# List Activities
Method: **activitiesAll**
```typescript
crmApi.activitiesAll(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**cursor** | [**string**] | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | (optional)
**limit** | [**number**] | Number of results to return. Minimum 1, Maximum 200, Default 20 | (optional) defaults to 20
**filter** | **ActivitiesFilter** | Apply filters | (optional)
**sort** | **ActivitiesSort** | Apply sorting | (optional)
**passThrough** | **PassThroughQuery** | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | (optional)
**fields** | [**string**] | The \'fields\' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.
Example: `fields=name,email,addresses.city`
In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded. | (optional)
### Response Type
[`GetActivitiesResponse`](../models/GetActivitiesResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Activities |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {}
try {
const { data } = await apideck.crm.activitiesAll(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Delete Activity
Method: **activitiesDelete**
```typescript
crmApi.activitiesDelete(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
### Response Type
[`DeleteActivityResponse`](../models/DeleteActivityResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Activity deleted |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.crm.activitiesDelete(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Get Activity
Method: **activitiesOne**
```typescript
crmApi.activitiesOne(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**fields** | [**string**] | The \'fields\' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.
Example: `fields=name,email,addresses.city`
In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded. | (optional)
### Response Type
[`GetActivityResponse`](../models/GetActivityResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Activity |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.crm.activitiesOne(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Update Activity
Method: **activitiesUpdate**
```typescript
crmApi.activitiesUpdate(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**activity** | [Activity](../models/Activity.md)| |
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
### Response Type
[`UpdateActivityResponse`](../models/UpdateActivityResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Activity updated |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example',
activity: {
activity_datetime: '2021-05-01T12:00:00.000Z',
duration_seconds: 1800,
user_id: '12345',
account_id: '12345',
contact_id: '12345',
company_id: '12345',
opportunity_id: '12345',
lead_id: '12345',
owner_id: '12345',
campaign_id: '12345',
case_id: '12345',
asset_id: '12345',
contract_id: '12345',
product_id: '12345',
solution_id: '12345',
custom_object_id: '12345',
type: 'meeting',
title: 'Meeting',
description: 'More info about the meeting',
note: 'An internal note about the meeting',
location: 'Space',
location_address: {
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: 'elon@musk.com',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
},
all_day_event: false,
private: true,
group_event: true,
event_sub_type: 'debrief',
group_event_type: 'Proposed',
child: false,
archived: false,
deleted: false,
show_as: 'busy',
done: false,
start_datetime: '2021-05-01T12:00:00.000Z',
end_datetime: '2021-05-01T12:30:00.000Z',
activity_date: '2021-05-01',
end_date: '2021-05-01',
recurrent: false,
reminder_datetime: '2021-05-01T17:00:00.000Z',
reminder_set: false,
video_conference_url: 'https://us02web.zoom.us/j/88120759396',
video_conference_id: 'zoom:88120759396',
custom_fields: [
{
id: '2389328923893298',
name: 'employee_level',
description: 'Employee Level',
value: 'Uses Salesforce and Marketo'
}
],
attendees: [
{
name: 'Elon Musk',
first_name: 'Elon',
middle_name: 'D.',
last_name: 'Musk',
prefix: 'Mr.',
suffix: 'PhD',
email_address: 'elon@musk.com',
is_organizer: true,
status: 'accepted'
}
],
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.crm.activitiesUpdate(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Create Company
Method: **companiesAdd**
```typescript
crmApi.companiesAdd(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**company** | [Company](../models/Company.md)| |
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
### Response Type
[`CreateCompanyResponse`](../models/CreateCompanyResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**201** | Company created |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
company: {
name: 'SpaceX',
owner_id: '12345',
image: 'https://www.spacex.com/static/images/share.jpg',
description: 'Space Exploration Technologies Corp. is an American aerospace manufacturer, space transportation services and communications company headquartered in Hawthorne, California.',
vat_number: 'BE0689615164',
currency: 'USD',
status: 'Open',
fax: '+12129876543',
annual_revenue: '+$35m',
number_of_employees: '500-1000',
industry: 'Apparel',
ownership: 'Public',
sales_tax_number: '12456EN',
payee_number: '78932EN',
abn_or_tfn: '46 115 614 695',
abn_branch: '123',
acn: 'XXX XXX XXX',
first_name: 'Elon',
last_name: 'Musk',
bank_accounts: [
{
bank_name: 'Monzo',
account_number: '123465',
account_name: 'SPACEX LLC',
account_type: 'credit_card',
iban: 'CH2989144532982975332',
bic: 'AUDSCHGGXXX',
routing_number: '012345678',
bsb_number: '062-001',
branch_identifier: '001',
bank_code: 'BNH',
currency: 'USD'
}
],
websites: [
{
id: '12345',
url: 'http://example.com',
type: 'primary'
}
],
addresses: [
{
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: 'elon@musk.com',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
}
],
social_links: [
{
id: '12345',
url: 'https://www.twitter.com/apideck',
type: 'twitter'
}
],
phone_numbers: [
{
id: '12345',
country_code: '1',
area_code: '323',
number: '111-111-1111',
extension: '105',
type: 'primary'
}
],
emails: [
{
id: '123',
email: 'elon@musk.com',
type: 'primary'
}
],
row_type: {
id: '12345',
name: 'Customer Account'
},
custom_fields: [
{
id: '2389328923893298',
name: 'employee_level',
description: 'Employee Level',
value: 'Uses Salesforce and Marketo'
}
],
tags: [
'New'
],
read_only: false,
salutation: 'Mr',
birthday: '2000-08-12',
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.crm.companiesAdd(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# List Companies
Method: **companiesAll**
```typescript
crmApi.companiesAll(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**cursor** | [**string**] | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | (optional)
**limit** | [**number**] | Number of results to return. Minimum 1, Maximum 200, Default 20 | (optional) defaults to 20
**filter** | **CompaniesFilter** | Apply filters | (optional)
**sort** | **CompaniesSort** | Apply sorting | (optional)
**passThrough** | **PassThroughQuery** | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | (optional)
**fields** | [**string**] | The \'fields\' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.
Example: `fields=name,email,addresses.city`
In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded. | (optional)
### Response Type
[`GetCompaniesResponse`](../models/GetCompaniesResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Companies |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {}
try {
const { data } = await apideck.crm.companiesAll(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Delete Company
Method: **companiesDelete**
```typescript
crmApi.companiesDelete(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**string**] | ID of the record you are acting upon. |
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
### Response Type
[`DeleteCompanyResponse`](../models/DeleteCompanyResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Company deleted |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.crm.companiesDelete(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Get Company
Method: **companiesOne**
```typescript
crmApi.companiesOne(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**string**] | ID of the record you are acting upon. |
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**fields** | [**string**] | The \'fields\' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.
Example: `fields=name,email,addresses.city`
In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded. | (optional)
### Response Type
[`GetCompanyResponse`](../models/GetCompanyResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Company |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.crm.companiesOne(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Update Company
Method: **companiesUpdate**
```typescript
crmApi.companiesUpdate(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**company** | [Company](../models/Company.md)| |
**id** | [**string**] | ID of the record you are acting upon. |
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
### Response Type
[`UpdateCompanyResponse`](../models/UpdateCompanyResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Company updated |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example',
company: {
name: 'SpaceX',
owner_id: '12345',
image: 'https://www.spacex.com/static/images/share.jpg',
description: 'Space Exploration Technologies Corp. is an American aerospace manufacturer, space transportation services and communications company headquartered in Hawthorne, California.',
vat_number: 'BE0689615164',
currency: 'USD',
status: 'Open',
fax: '+12129876543',
annual_revenue: '+$35m',
number_of_employees: '500-1000',
industry: 'Apparel',
ownership: 'Public',
sales_tax_number: '12456EN',
payee_number: '78932EN',
abn_or_tfn: '46 115 614 695',
abn_branch: '123',
acn: 'XXX XXX XXX',
first_name: 'Elon',
last_name: 'Musk',
bank_accounts: [
{
bank_name: 'Monzo',
account_number: '123465',
account_name: 'SPACEX LLC',
account_type: 'credit_card',
iban: 'CH2989144532982975332',
bic: 'AUDSCHGGXXX',
routing_number: '012345678',
bsb_number: '062-001',
branch_identifier: '001',
bank_code: 'BNH',
currency: 'USD'
}
],
websites: [
{
id: '12345',
url: 'http://example.com',
type: 'primary'
}
],
addresses: [
{
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: 'elon@musk.com',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
}
],
social_links: [
{
id: '12345',
url: 'https://www.twitter.com/apideck',
type: 'twitter'
}
],
phone_numbers: [
{
id: '12345',
country_code: '1',
area_code: '323',
number: '111-111-1111',
extension: '105',
type: 'primary'
}
],
emails: [
{
id: '123',
email: 'elon@musk.com',
type: 'primary'
}
],
row_type: {
id: '12345',
name: 'Customer Account'
},
custom_fields: [
{
id: '2389328923893298',
name: 'employee_level',
description: 'Employee Level',
value: 'Uses Salesforce and Marketo'
}
],
tags: [
'New'
],
read_only: false,
salutation: 'Mr',
birthday: '2000-08-12',
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.crm.companiesUpdate(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Create Contact
Method: **contactsAdd**
```typescript
crmApi.contactsAdd(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**contact** | [Contact](../models/Contact.md)| |
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
### Response Type
[`CreateContactResponse`](../models/CreateContactResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**201** | Contact created |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
contact: {
name: 'Elon Musk',
owner_id: '54321',
type: 'personal',
company_id: '23456',
company_name: '23456',
lead_id: '34567',
first_name: 'Elon',
middle_name: 'D.',
last_name: 'Musk',
prefix: 'Mr.',
suffix: 'PhD',
title: 'CEO',
department: 'Engineering',
language: 'EN',
gender: 'female',
birthday: '2000-08-12',
image: 'https://unavatar.io/elon-musk',
photo_url: 'https://unavatar.io/elon-musk',
lead_source: 'Cold Call',
fax: '+12129876543',
description: 'Internal champion',
current_balance: 10.5,
status: 'open',
active: true,
websites: [
{
id: '12345',
url: 'http://example.com',
type: 'primary'
}
],
addresses: [
{
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: 'elon@musk.com',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
}
],
social_links: [
{
id: '12345',
url: 'https://www.twitter.com/apideck',
type: 'twitter'
}
],
phone_numbers: [
{
id: '12345',
country_code: '1',
area_code: '323',
number: '111-111-1111',
extension: '105',
type: 'primary'
}
],
emails: [
{
id: '123',
email: 'elon@musk.com',
type: 'primary'
}
],
email_domain: 'gmail.com',
custom_fields: [
{
id: '2389328923893298',
name: 'employee_level',
description: 'Employee Level',
value: 'Uses Salesforce and Marketo'
}
],
tags: [
'New'
],
opportunity_ids: [
'12345'
],
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.crm.contactsAdd(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# List Contacts
Method: **contactsAll**
```typescript
crmApi.contactsAll(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**cursor** | [**string**] | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | (optional)
**limit** | [**number**] | Number of results to return. Minimum 1, Maximum 200, Default 20 | (optional) defaults to 20
**filter** | **ContactsFilter** | Apply filters | (optional)
**sort** | **ContactsSort** | Apply sorting | (optional)
**passThrough** | **PassThroughQuery** | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | (optional)
**fields** | [**string**] | The \'fields\' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.
Example: `fields=name,email,addresses.city`
In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded. | (optional)
### Response Type
[`GetContactsResponse`](../models/GetContactsResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Contacts |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {}
try {
const { data } = await apideck.crm.contactsAll(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Delete Contact
Method: **contactsDelete**
```typescript
crmApi.contactsDelete(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
### Response Type
[`DeleteContactResponse`](../models/DeleteContactResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Contact deleted |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.crm.contactsDelete(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Get Contact
Method: **contactsOne**
```typescript
crmApi.contactsOne(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**fields** | [**string**] | The \'fields\' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.
Example: `fields=name,email,addresses.city`
In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded. | (optional)
**filter** | **ContactsFilter** | Apply filters | (optional)
### Response Type
[`GetContactResponse`](../models/GetContactResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Contact |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.crm.contactsOne(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Update Contact
Method: **contactsUpdate**
```typescript
crmApi.contactsUpdate(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**contact** | [Contact](../models/Contact.md)| |
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
### Response Type
[`UpdateContactResponse`](../models/UpdateContactResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Contact updated |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example',
contact: {
name: 'Elon Musk',
owner_id: '54321',
type: 'personal',
company_id: '23456',
company_name: '23456',
lead_id: '34567',
first_name: 'Elon',
middle_name: 'D.',
last_name: 'Musk',
prefix: 'Mr.',
suffix: 'PhD',
title: 'CEO',
department: 'Engineering',
language: 'EN',
gender: 'female',
birthday: '2000-08-12',
image: 'https://unavatar.io/elon-musk',
photo_url: 'https://unavatar.io/elon-musk',
lead_source: 'Cold Call',
fax: '+12129876543',
description: 'Internal champion',
current_balance: 10.5,
status: 'open',
active: true,
websites: [
{
id: '12345',
url: 'http://example.com',
type: 'primary'
}
],
addresses: [
{
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: 'elon@musk.com',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
}
],
social_links: [
{
id: '12345',
url: 'https://www.twitter.com/apideck',
type: 'twitter'
}
],
phone_numbers: [
{
id: '12345',
country_code: '1',
area_code: '323',
number: '111-111-1111',
extension: '105',
type: 'primary'
}
],
emails: [
{
id: '123',
email: 'elon@musk.com',
type: 'primary'
}
],
email_domain: 'gmail.com',
custom_fields: [
{
id: '2389328923893298',
name: 'employee_level',
description: 'Employee Level',
value: 'Uses Salesforce and Marketo'
}
],
tags: [
'New'
],
opportunity_ids: [
'12345'
],
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.crm.contactsUpdate(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Create Lead
Method: **leadsAdd**
```typescript
crmApi.leadsAdd(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**lead** | [Lead](../models/Lead.md)| |
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
### Response Type
[`CreateLeadResponse`](../models/CreateLeadResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**201** | Lead created |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
lead: {
name: 'Elon Musk',
company_name: 'Spacex',
owner_id: '54321',
owner_name: 'John Doe',
company_id: '2',
lead_id: '2',
lead_source: 'Cold Call',
first_name: 'Elon',
last_name: 'Musk',
description: 'A thinker',
prefix: 'Sir',
title: 'CEO',
language: 'EN',
status: 'New',
monetary_amount: 75000,
currency: 'USD',
fax: '+12129876543',
websites: [
{
id: '12345',
url: 'http://example.com',
type: 'primary'
}
],
addresses: [
{
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: 'elon@musk.com',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
}
],
social_links: [
{
id: '12345',
url: 'https://www.twitter.com/apideck',
type: 'twitter'
}
],
phone_numbers: [
{
id: '12345',
country_code: '1',
area_code: '323',
number: '111-111-1111',
extension: '105',
type: 'primary'
}
],
emails: [
{
id: '123',
email: 'elon@musk.com',
type: 'primary'
}
],
custom_fields: [
{
id: '2389328923893298',
name: 'employee_level',
description: 'Employee Level',
value: 'Uses Salesforce and Marketo'
}
],
tags: [
'New'
],
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.crm.leadsAdd(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# List Leads
Method: **leadsAll**
```typescript
crmApi.leadsAll(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**cursor** | [**string**] | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | (optional)
**limit** | [**number**] | Number of results to return. Minimum 1, Maximum 200, Default 20 | (optional) defaults to 20
**filter** | **LeadsFilter** | Apply filters | (optional)
**sort** | **LeadsSort** | Apply sorting | (optional)
**passThrough** | **PassThroughQuery** | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | (optional)
**fields** | [**string**] | The \'fields\' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.
Example: `fields=name,email,addresses.city`
In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded. | (optional)
### Response Type
[`GetLeadsResponse`](../models/GetLeadsResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Leads |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {}
try {
const { data } = await apideck.crm.leadsAll(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Delete Lead
Method: **leadsDelete**
```typescript
crmApi.leadsDelete(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
### Response Type
[`DeleteLeadResponse`](../models/DeleteLeadResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Lead deleted |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.crm.leadsDelete(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Get Lead
Method: **leadsOne**
```typescript
crmApi.leadsOne(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**fields** | [**string**] | The \'fields\' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.
Example: `fields=name,email,addresses.city`
In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded. | (optional)
### Response Type
[`GetLeadResponse`](../models/GetLeadResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Lead |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.crm.leadsOne(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Update Lead
Method: **leadsUpdate**
```typescript
crmApi.leadsUpdate(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**lead** | [Lead](../models/Lead.md)| |
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
### Response Type
[`UpdateLeadResponse`](../models/UpdateLeadResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Lead updated |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example',
lead: {
name: 'Elon Musk',
company_name: 'Spacex',
owner_id: '54321',
owner_name: 'John Doe',
company_id: '2',
lead_id: '2',
lead_source: 'Cold Call',
first_name: 'Elon',
last_name: 'Musk',
description: 'A thinker',
prefix: 'Sir',
title: 'CEO',
language: 'EN',
status: 'New',
monetary_amount: 75000,
currency: 'USD',
fax: '+12129876543',
websites: [
{
id: '12345',
url: 'http://example.com',
type: 'primary'
}
],
addresses: [
{
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: 'elon@musk.com',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
}
],
social_links: [
{
id: '12345',
url: 'https://www.twitter.com/apideck',
type: 'twitter'
}
],
phone_numbers: [
{
id: '12345',
country_code: '1',
area_code: '323',
number: '111-111-1111',
extension: '105',
type: 'primary'
}
],
emails: [
{
id: '123',
email: 'elon@musk.com',
type: 'primary'
}
],
custom_fields: [
{
id: '2389328923893298',
name: 'employee_level',
description: 'Employee Level',
value: 'Uses Salesforce and Marketo'
}
],
tags: [
'New'
],
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.crm.leadsUpdate(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Create Note
Method: **notesAdd**
```typescript
crmApi.notesAdd(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**note** | [Note](../models/Note.md)| |
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
### Response Type
[`CreateNoteResponse`](../models/CreateNoteResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**201** | Note created |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
note: {
title: 'Meeting Notes',
content: 'Office hours are 9AM-6PM',
owner_id: '12345',
contact_id: '12345',
company_id: '12345',
opportunity_id: '12345',
lead_id: '12345',
active: true,
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.crm.notesAdd(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# List Notes
Method: **notesAll**
```typescript
crmApi.notesAll(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**cursor** | [**string**] | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | (optional)
**limit** | [**number**] | Number of results to return. Minimum 1, Maximum 200, Default 20 | (optional) defaults to 20
**passThrough** | **PassThroughQuery** | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | (optional)
**fields** | [**string**] | The \'fields\' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.
Example: `fields=name,email,addresses.city`
In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded. | (optional)
### Response Type
[`GetNotesResponse`](../models/GetNotesResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Notes |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {}
try {
const { data } = await apideck.crm.notesAll(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Delete Note
Method: **notesDelete**
```typescript
crmApi.notesDelete(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
### Response Type
[`DeleteNoteResponse`](../models/DeleteNoteResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Note deleted |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.crm.notesDelete(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Get Note
Method: **notesOne**
```typescript
crmApi.notesOne(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**fields** | [**string**] | The \'fields\' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.
Example: `fields=name,email,addresses.city`
In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded. | (optional)
### Response Type
[`GetNoteResponse`](../models/GetNoteResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Note |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.crm.notesOne(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Update Note
Method: **notesUpdate**
```typescript
crmApi.notesUpdate(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**note** | [Note](../models/Note.md)| |
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
### Response Type
[`UpdateNoteResponse`](../models/UpdateNoteResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Note updated |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example',
note: {
title: 'Meeting Notes',
content: 'Office hours are 9AM-6PM',
owner_id: '12345',
contact_id: '12345',
company_id: '12345',
opportunity_id: '12345',
lead_id: '12345',
active: true,
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.crm.notesUpdate(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Create Opportunity
Method: **opportunitiesAdd**
```typescript
crmApi.opportunitiesAdd(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**opportunity** | [Opportunity](../models/Opportunity.md)| |
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
### Response Type
[`CreateOpportunityResponse`](../models/CreateOpportunityResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**201** | Opportunity created |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
opportunity: {
title: 'New Rocket',
primary_contact_id: '12345',
description: 'Opportunities are created for People and Companies that are interested in buying your products or services. Create Opportunities for People and Companies to move them through one of your Pipelines.',
type: 'Existing Customer - Upgrade',
monetary_amount: 75000,
currency: 'USD',
win_probability: 40,
close_date: '2020-10-30',
loss_reason_id: '12345',
loss_reason: 'No budget',
won_reason_id: '12345',
won_reason: 'Best pitch',
pipeline_id: '12345',
pipeline_stage_id: '12345',
source_id: '12345',
lead_id: '12345',
lead_source: 'Website',
contact_id: '12345',
contact_ids: [
'12345'
],
company_id: '12345',
company_name: 'Copper',
owner_id: '12345',
priority: 'None',
status: 'Open',
status_id: '12345',
tags: [
'New'
],
custom_fields: [
{
id: '2389328923893298',
name: 'employee_level',
description: 'Employee Level',
value: 'Uses Salesforce and Marketo'
}
],
stage_last_changed_at: '2020-09-30T07:43:32.000Z',
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.crm.opportunitiesAdd(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# List Opportunities
Method: **opportunitiesAll**
```typescript
crmApi.opportunitiesAll(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**cursor** | [**string**] | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | (optional)
**limit** | [**number**] | Number of results to return. Minimum 1, Maximum 200, Default 20 | (optional) defaults to 20
**filter** | **OpportunitiesFilter** | Apply filters | (optional)
**sort** | **OpportunitiesSort** | Apply sorting | (optional)
**passThrough** | **PassThroughQuery** | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | (optional)
**fields** | [**string**] | The \'fields\' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.
Example: `fields=name,email,addresses.city`
In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded. | (optional)
### Response Type
[`GetOpportunitiesResponse`](../models/GetOpportunitiesResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Opportunities |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {}
try {
const { data } = await apideck.crm.opportunitiesAll(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Delete Opportunity
Method: **opportunitiesDelete**
```typescript
crmApi.opportunitiesDelete(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
### Response Type
[`DeleteOpportunityResponse`](../models/DeleteOpportunityResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Opportunity deleted |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.crm.opportunitiesDelete(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Get Opportunity
Method: **opportunitiesOne**
```typescript
crmApi.opportunitiesOne(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**fields** | [**string**] | The \'fields\' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.
Example: `fields=name,email,addresses.city`
In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded. | (optional)
### Response Type
[`GetOpportunityResponse`](../models/GetOpportunityResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Opportunity |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.crm.opportunitiesOne(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Update Opportunity
Method: **opportunitiesUpdate**
```typescript
crmApi.opportunitiesUpdate(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**opportunity** | [Opportunity](../models/Opportunity.md)| |
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
### Response Type
[`UpdateOpportunityResponse`](../models/UpdateOpportunityResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Opportunity updated |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example',
opportunity: {
title: 'New Rocket',
primary_contact_id: '12345',
description: 'Opportunities are created for People and Companies that are interested in buying your products or services. Create Opportunities for People and Companies to move them through one of your Pipelines.',
type: 'Existing Customer - Upgrade',
monetary_amount: 75000,
currency: 'USD',
win_probability: 40,
close_date: '2020-10-30',
loss_reason_id: '12345',
loss_reason: 'No budget',
won_reason_id: '12345',
won_reason: 'Best pitch',
pipeline_id: '12345',
pipeline_stage_id: '12345',
source_id: '12345',
lead_id: '12345',
lead_source: 'Website',
contact_id: '12345',
contact_ids: [
'12345'
],
company_id: '12345',
company_name: 'Copper',
owner_id: '12345',
priority: 'None',
status: 'Open',
status_id: '12345',
tags: [
'New'
],
custom_fields: [
{
id: '2389328923893298',
name: 'employee_level',
description: 'Employee Level',
value: 'Uses Salesforce and Marketo'
}
],
stage_last_changed_at: '2020-09-30T07:43:32.000Z',
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.crm.opportunitiesUpdate(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Create Pipeline
Method: **pipelinesAdd**
```typescript
crmApi.pipelinesAdd(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pipeline** | [Pipeline](../models/Pipeline.md)| |
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
### Response Type
[`CreatePipelineResponse`](../models/CreatePipelineResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**201** | Pipeline created |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
pipeline: {
id: 'default',
name: 'Sales Pipeline',
currency: 'USD',
archived: false,
active: false,
display_order: 1,
win_probability_enabled: true,
stages: [
{
name: 'Contract Sent',
value: 'CONTRACT_SENT',
win_probability: 50,
display_order: 1
}
],
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.crm.pipelinesAdd(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# List Pipelines
Method: **pipelinesAll**
```typescript
crmApi.pipelinesAll(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**cursor** | [**string**] | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | (optional)
**limit** | [**number**] | Number of results to return. Minimum 1, Maximum 200, Default 20 | (optional) defaults to 20
**passThrough** | **PassThroughQuery** | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | (optional)
**fields** | [**string**] | The \'fields\' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.
Example: `fields=name,email,addresses.city`
In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded. | (optional)
### Response Type
[`GetPipelinesResponse`](../models/GetPipelinesResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Pipelines |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {}
try {
const { data } = await apideck.crm.pipelinesAll(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Delete Pipeline
Method: **pipelinesDelete**
```typescript
crmApi.pipelinesDelete(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
### Response Type
[`DeletePipelineResponse`](../models/DeletePipelineResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Pipeline deleted |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.crm.pipelinesDelete(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Get Pipeline
Method: **pipelinesOne**
```typescript
crmApi.pipelinesOne(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**fields** | [**string**] | The \'fields\' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.
Example: `fields=name,email,addresses.city`
In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded. | (optional)
### Response Type
[`GetPipelineResponse`](../models/GetPipelineResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Pipeline |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.crm.pipelinesOne(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Update Pipeline
Method: **pipelinesUpdate**
```typescript
crmApi.pipelinesUpdate(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pipeline** | [Pipeline](../models/Pipeline.md)| |
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
### Response Type
[`UpdatePipelineResponse`](../models/UpdatePipelineResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Pipeline updated |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example',
pipeline: {
id: 'default',
name: 'Sales Pipeline',
currency: 'USD',
archived: false,
active: false,
display_order: 1,
win_probability_enabled: true,
stages: [
{
name: 'Contract Sent',
value: 'CONTRACT_SENT',
win_probability: 50,
display_order: 1
}
],
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.crm.pipelinesUpdate(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Create User
Method: **usersAdd**
```typescript
crmApi.usersAdd(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [User](../models/User.md)| |
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
### Response Type
[`CreateUserResponse`](../models/CreateUserResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**201** | User created |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
user: {
parent_id: '54321',
username: 'masterofcoin',
first_name: 'Elon',
last_name: 'Musk',
title: 'CEO',
division: 'Europe',
department: 'R&D',
company_name: 'SpaceX',
employee_number: '123456-AB',
description: 'A description',
image: 'https://logo.clearbit.com/spacex.com?s=128',
language: 'EN',
status: 'active',
password: 'supersecretpassword',
addresses: [
{
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: 'elon@musk.com',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
}
],
phone_numbers: [
{
id: '12345',
country_code: '1',
area_code: '323',
number: '111-111-1111',
extension: '105',
type: 'primary'
}
],
emails: [
{
id: '123',
email: 'elon@musk.com',
type: 'primary'
}
],
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.crm.usersAdd(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# List Users
Method: **usersAll**
```typescript
crmApi.usersAll(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**cursor** | [**string**] | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | (optional)
**limit** | [**number**] | Number of results to return. Minimum 1, Maximum 200, Default 20 | (optional) defaults to 20
**passThrough** | **PassThroughQuery** | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | (optional)
**fields** | [**string**] | The \'fields\' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.
Example: `fields=name,email,addresses.city`
In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded. | (optional)
### Response Type
[`GetUsersResponse`](../models/GetUsersResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | Users |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {}
try {
const { data } = await apideck.crm.usersAll(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Delete User
Method: **usersDelete**
```typescript
crmApi.usersDelete(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
### Response Type
[`DeleteUserResponse`](../models/DeleteUserResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | User deleted |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.crm.usersDelete(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Get User
Method: **usersOne**
```typescript
crmApi.usersOne(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
**fields** | [**string**] | The \'fields\' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.
Example: `fields=name,email,addresses.city`
In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded. | (optional)
### Response Type
[`GetUserResponse`](../models/GetUserResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | User |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.crm.usersOne(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)
# Update User
Method: **usersUpdate**
```typescript
crmApi.usersUpdate(body)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [User](../models/User.md)| |
**id** | [**string**] | ID of the record you are acting upon. |
**consumerId** | [**string**] | ID of the consumer which you want to get or push data from | (optional)
**appId** | [**string**] | The ID of your Unify application | (optional)
**serviceId** | [**string**] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional)
**raw** | [**boolean**] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false
### Response Type
[`UpdateUserResponse`](../models/UpdateUserResponse.md)
### HTTP response details
| Status code | Description |
|-------------|-------------|
**200** | User updated |
**400** | Bad Request |
**401** | Unauthorized |
**402** | Payment Required |
**404** | The specified resource was not found |
**422** | Unprocessable |
4/5xx | Unexpected error |
## Example Usage
```typescript
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example',
user: {
parent_id: '54321',
username: 'masterofcoin',
first_name: 'Elon',
last_name: 'Musk',
title: 'CEO',
division: 'Europe',
department: 'R&D',
company_name: 'SpaceX',
employee_number: '123456-AB',
description: 'A description',
image: 'https://logo.clearbit.com/spacex.com?s=128',
language: 'EN',
status: 'active',
password: 'supersecretpassword',
addresses: [
{
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: 'elon@musk.com',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
}
],
phone_numbers: [
{
id: '12345',
country_code: '1',
area_code: '323',
number: '111-111-1111',
extension: '105',
type: 'primary'
}
],
emails: [
{
id: '123',
email: 'elon@musk.com',
type: 'primary'
}
],
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.crm.usersUpdate(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
```
[[Back to top]](#) [[Back to API list]](../../../../README.md#documentation-for-api-endpoints) [[Back to README]](../../../../README.md)