Skip to content

Latest commit

 

History

History
4080 lines (3156 loc) · 113 KB

CrmApi.md

File metadata and controls

4080 lines (3156 loc) · 113 KB

Apideck.Crm

Class Name

CrmApi

Methods

Create Activity

Method: activitiesAdd

crmApi.activitiesAdd(body)

Parameters

Name Type Description Notes
activity Activity
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

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

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] [Back to README]

List Activities

Method: activitiesAll

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

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

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] [Back to README]

Delete Activity

Method: activitiesDelete

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

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

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] [Back to README]

Get Activity

Method: activitiesOne

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

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

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] [Back to README]

Update Activity

Method: activitiesUpdate

crmApi.activitiesUpdate(body)

Parameters

Name Type Description Notes
activity Activity
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

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

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] [Back to README]

Create Company

Method: companiesAdd

crmApi.companiesAdd(body)

Parameters

Name Type Description Notes
company Company
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

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

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] [Back to README]

List Companies

Method: companiesAll

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

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

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] [Back to README]

Delete Company

Method: companiesDelete

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

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

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] [Back to README]

Get Company

Method: companiesOne

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

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

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] [Back to README]

Update Company

Method: companiesUpdate

crmApi.companiesUpdate(body)

Parameters

Name Type Description Notes
company Company
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

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

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] [Back to README]

Create Contact

Method: contactsAdd

crmApi.contactsAdd(body)

Parameters

Name Type Description Notes
contact Contact
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

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

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: [
      'string'
    ],
    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] [Back to README]

List Contacts

Method: contactsAll

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

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

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] [Back to README]

Delete Contact

Method: contactsDelete

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

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

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] [Back to README]

Get Contact

Method: contactsOne

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)

Response Type

GetContactResponse

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

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] [Back to README]

Update Contact

Method: contactsUpdate

crmApi.contactsUpdate(body)

Parameters

Name Type Description Notes
contact Contact
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

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

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: [
      'string'
    ],
    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] [Back to README]

Create Lead

Method: leadsAdd

crmApi.leadsAdd(body)

Parameters

Name Type Description Notes
lead Lead
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

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

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',
    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] [Back to README]

List Leads

Method: leadsAll

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

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

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] [Back to README]

Delete Lead

Method: leadsDelete

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

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

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] [Back to README]

Get Lead

Method: leadsOne

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

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

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] [Back to README]

Update Lead

Method: leadsUpdate

crmApi.leadsUpdate(body)

Parameters

Name Type Description Notes
lead Lead
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

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

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',
    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] [Back to README]

Create Note

Method: notesAdd

crmApi.notesAdd(body)

Parameters

Name Type Description Notes
note Note
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

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

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] [Back to README]

List Notes

Method: notesAll

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

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

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] [Back to README]

Delete Note

Method: notesDelete

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

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

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] [Back to README]

Get Note

Method: notesOne

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

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

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] [Back to README]

Update Note

Method: notesUpdate

crmApi.notesUpdate(body)

Parameters

Name Type Description Notes
note Note
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

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

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] [Back to README]

Create Opportunity

Method: opportunitiesAdd

crmApi.opportunitiesAdd(body)

Parameters

Name Type Description Notes
opportunity Opportunity
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

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

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] [Back to README]

List Opportunities

Method: opportunitiesAll

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

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

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] [Back to README]

Delete Opportunity

Method: opportunitiesDelete

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

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

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] [Back to README]

Get Opportunity

Method: opportunitiesOne

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

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

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] [Back to README]

Update Opportunity

Method: opportunitiesUpdate

crmApi.opportunitiesUpdate(body)

Parameters

Name Type Description Notes
opportunity Opportunity
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

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

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] [Back to README]

Create Pipeline

Method: pipelinesAdd

crmApi.pipelinesAdd(body)

Parameters

Name Type Description Notes
pipeline Pipeline
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

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

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] [Back to README]

List Pipelines

Method: pipelinesAll

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

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

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] [Back to README]

Delete Pipeline

Method: pipelinesDelete

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

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

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] [Back to README]

Get Pipeline

Method: pipelinesOne

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

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

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] [Back to README]

Update Pipeline

Method: pipelinesUpdate

crmApi.pipelinesUpdate(body)

Parameters

Name Type Description Notes
pipeline Pipeline
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

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

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] [Back to README]

Create User

Method: usersAdd

crmApi.usersAdd(body)

Parameters

Name Type Description Notes
user User
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

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

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] [Back to README]

List Users

Method: usersAll

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

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

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] [Back to README]

Delete User

Method: usersDelete

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

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

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] [Back to README]

Get User

Method: usersOne

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

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

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] [Back to README]

Update User

Method: usersUpdate

crmApi.usersUpdate(body)

Parameters

Name Type Description Notes
user User
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

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

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] [Back to README]