/** * Pipedrive API v1 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosInstance } from 'axios'; import { RequestArgs, BaseAPI } from '../base'; import { AddLeadRequest } from '../models'; import { GetLeadIdResponse } from '../models'; import { GetLeadResponse } from '../models'; import { GetLeadSearchResponse } from '../models'; import { GetLeadsResponse } from '../models'; import { UpdateLeadRequest } from '../models'; import { UserIds } from '../models'; /** * LeadsApi - axios parameter creator * @export */ export declare const LeadsApiAxiosParamCreator: (configuration?: Configuration) => { /** * Creates a lead. A lead always has to be linked to a person or an organization or both. All leads created through the Pipedrive API will have a lead source and origin set to `API`. Here\'s the tutorial for adding a lead. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields\' structure from deals. See an example given in the updating custom fields\' values tutorial. * @summary Add a lead * @param {AddLeadRequest} [AddLeadRequest] * @throws {RequiredError} */ addLead: (AddLeadRequest?: AddLeadRequest) => Promise; /** * Deletes a specific lead. * @summary Delete a lead * @param {string} id The ID of the lead * @throws {RequiredError} */ deleteLead: (id: string) => Promise; /** * Returns multiple archived leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields\' structure from deals. * @summary Get all archived leads * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. * @param {number} [start] For pagination, the position that represents the first result for the page * @param {number} [owner_id] If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. * @param {number} [person_id] If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. * @param {number} [organization_id] If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. * @param {number} [filter_id] The ID of the filter to use * @param {'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time'} [sort] The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). * @throws {RequiredError} */ getArchivedLeads: (limit?: number, start?: number, owner_id?: number, person_id?: number, organization_id?: number, filter_id?: number, sort?: 'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time') => Promise; /** * Returns details of a specific lead. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from deals. * @summary Get one lead * @param {string} id The ID of the lead * @throws {RequiredError} */ getLead: (id: string) => Promise; /** * Lists the users permitted to access a lead. * @summary List permitted users * @param {string} id The ID of the lead * @throws {RequiredError} */ getLeadUsers: (id: string) => Promise; /** * Returns multiple not archived leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields\' structure from deals. * @summary Get all leads * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. * @param {number} [start] For pagination, the position that represents the first result for the page * @param {number} [owner_id] If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. * @param {number} [person_id] If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. * @param {number} [organization_id] If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. * @param {number} [filter_id] The ID of the filter to use * @param {string} [updated_since] If set, only leads with an `update_time` later than or equal to this time are returned. In ISO 8601 format, e.g. 2025-01-01T10:20:00Z. * @param {'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time'} [sort] The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). * @throws {RequiredError} */ getLeads: (limit?: number, start?: number, owner_id?: number, person_id?: number, organization_id?: number, filter_id?: number, updated_since?: string, sort?: 'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time') => Promise; /** * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. * @summary Search leads * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @param {number} [person_id] Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. * @param {number} [organization_id] Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. * @param {'lead.was_seen'} [include_fields] Supports including optional fields in the results which are not provided by default * @param {number} [start] Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. * @param {number} [limit] Items shown per page * @throws {RequiredError} */ searchLeads: (term: string, fields?: 'custom_fields' | 'notes' | 'title', exact_match?: boolean, person_id?: number, organization_id?: number, include_fields?: 'lead.was_seen', start?: number, limit?: number) => Promise; /** * Updates one or more properties of a lead. Only properties included in the request will be updated. Send `null` to unset a property (applicable for example for `value`, `person_id` or `organization_id`). If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from deals. See an example given in the updating custom fields’ values tutorial. * @summary Update a lead * @param {string} id The ID of the lead * @param {UpdateLeadRequest} [UpdateLeadRequest] * @throws {RequiredError} */ updateLead: (id: string, UpdateLeadRequest?: UpdateLeadRequest) => Promise; }; /** * LeadsApi - functional programming interface * @export */ export declare const LeadsApiFp: (configuration?: Configuration) => { /** * Creates a lead. A lead always has to be linked to a person or an organization or both. All leads created through the Pipedrive API will have a lead source and origin set to `API`. Here\'s the tutorial for adding a lead. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields\' structure from deals. See an example given in the updating custom fields\' values tutorial. * @summary Add a lead * @param {AddLeadRequest} [AddLeadRequest] * @throws {RequiredError} */ addLead(AddLeadRequest?: AddLeadRequest): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Deletes a specific lead. * @summary Delete a lead * @param {string} id The ID of the lead * @throws {RequiredError} */ deleteLead(id: string): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Returns multiple archived leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields\' structure from deals. * @summary Get all archived leads * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. * @param {number} [start] For pagination, the position that represents the first result for the page * @param {number} [owner_id] If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. * @param {number} [person_id] If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. * @param {number} [organization_id] If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. * @param {number} [filter_id] The ID of the filter to use * @param {'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time'} [sort] The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). * @throws {RequiredError} */ getArchivedLeads(limit?: number, start?: number, owner_id?: number, person_id?: number, organization_id?: number, filter_id?: number, sort?: 'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time'): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Returns details of a specific lead. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from deals. * @summary Get one lead * @param {string} id The ID of the lead * @throws {RequiredError} */ getLead(id: string): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Lists the users permitted to access a lead. * @summary List permitted users * @param {string} id The ID of the lead * @throws {RequiredError} */ getLeadUsers(id: string): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Returns multiple not archived leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields\' structure from deals. * @summary Get all leads * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. * @param {number} [start] For pagination, the position that represents the first result for the page * @param {number} [owner_id] If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. * @param {number} [person_id] If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. * @param {number} [organization_id] If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. * @param {number} [filter_id] The ID of the filter to use * @param {string} [updated_since] If set, only leads with an `update_time` later than or equal to this time are returned. In ISO 8601 format, e.g. 2025-01-01T10:20:00Z. * @param {'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time'} [sort] The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). * @throws {RequiredError} */ getLeads(limit?: number, start?: number, owner_id?: number, person_id?: number, organization_id?: number, filter_id?: number, updated_since?: string, sort?: 'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time'): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. * @summary Search leads * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @param {number} [person_id] Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. * @param {number} [organization_id] Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. * @param {'lead.was_seen'} [include_fields] Supports including optional fields in the results which are not provided by default * @param {number} [start] Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. * @param {number} [limit] Items shown per page * @throws {RequiredError} */ searchLeads(term: string, fields?: 'custom_fields' | 'notes' | 'title', exact_match?: boolean, person_id?: number, organization_id?: number, include_fields?: 'lead.was_seen', start?: number, limit?: number): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; /** * Updates one or more properties of a lead. Only properties included in the request will be updated. Send `null` to unset a property (applicable for example for `value`, `person_id` or `organization_id`). If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from deals. See an example given in the updating custom fields’ values tutorial. * @summary Update a lead * @param {string} id The ID of the lead * @param {UpdateLeadRequest} [UpdateLeadRequest] * @throws {RequiredError} */ updateLead(id: string, UpdateLeadRequest?: UpdateLeadRequest): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>; }; /** * LeadsApi - factory interface * @export */ export declare const LeadsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => { /** * Creates a lead. A lead always has to be linked to a person or an organization or both. All leads created through the Pipedrive API will have a lead source and origin set to `API`. Here\'s the tutorial for adding a lead. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields\' structure from deals. See an example given in the updating custom fields\' values tutorial. * @summary Add a lead * @param {LeadsApiAddLeadRequest} requestParameters Request parameters. * @throws {RequiredError} */ addLead(requestParameters?: LeadsApiAddLeadRequest): Promise; /** * Deletes a specific lead. * @summary Delete a lead * @param {LeadsApiDeleteLeadRequest} requestParameters Request parameters. * @throws {RequiredError} */ deleteLead(requestParameters: LeadsApiDeleteLeadRequest): Promise; /** * Returns multiple archived leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields\' structure from deals. * @summary Get all archived leads * @param {LeadsApiGetArchivedLeadsRequest} requestParameters Request parameters. * @throws {RequiredError} */ getArchivedLeads(requestParameters?: LeadsApiGetArchivedLeadsRequest): Promise; /** * Returns details of a specific lead. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from deals. * @summary Get one lead * @param {LeadsApiGetLeadRequest} requestParameters Request parameters. * @throws {RequiredError} */ getLead(requestParameters: LeadsApiGetLeadRequest): Promise; /** * Lists the users permitted to access a lead. * @summary List permitted users * @param {LeadsApiGetLeadUsersRequest} requestParameters Request parameters. * @throws {RequiredError} */ getLeadUsers(requestParameters: LeadsApiGetLeadUsersRequest): Promise; /** * Returns multiple not archived leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields\' structure from deals. * @summary Get all leads * @param {LeadsApiGetLeadsRequest} requestParameters Request parameters. * @throws {RequiredError} */ getLeads(requestParameters?: LeadsApiGetLeadsRequest): Promise; /** * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. * @summary Search leads * @param {LeadsApiSearchLeadsRequest} requestParameters Request parameters. * @throws {RequiredError} */ searchLeads(requestParameters: LeadsApiSearchLeadsRequest): Promise; /** * Updates one or more properties of a lead. Only properties included in the request will be updated. Send `null` to unset a property (applicable for example for `value`, `person_id` or `organization_id`). If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from deals. See an example given in the updating custom fields’ values tutorial. * @summary Update a lead * @param {LeadsApiUpdateLeadRequest} requestParameters Request parameters. * @throws {RequiredError} */ updateLead(requestParameters: LeadsApiUpdateLeadRequest): Promise; }; /** * Request parameters for addLead operation in LeadsApi. * @export * @interface LeadsApiAddLeadRequest */ export interface LeadsApiAddLeadRequest { /** * * @type {AddLeadRequest} * @memberof LeadsApiAddLead */ readonly AddLeadRequest?: AddLeadRequest; } /** * Request parameters for deleteLead operation in LeadsApi. * @export * @interface LeadsApiDeleteLeadRequest */ export interface LeadsApiDeleteLeadRequest { /** * The ID of the lead * @type {string} * @memberof LeadsApiDeleteLead */ readonly id: string; } /** * Request parameters for getArchivedLeads operation in LeadsApi. * @export * @interface LeadsApiGetArchivedLeadsRequest */ export interface LeadsApiGetArchivedLeadsRequest { /** * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. * @type {number} * @memberof LeadsApiGetArchivedLeads */ readonly limit?: number; /** * For pagination, the position that represents the first result for the page * @type {number} * @memberof LeadsApiGetArchivedLeads */ readonly start?: number; /** * If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. * @type {number} * @memberof LeadsApiGetArchivedLeads */ readonly owner_id?: number; /** * If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. * @type {number} * @memberof LeadsApiGetArchivedLeads */ readonly person_id?: number; /** * If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. * @type {number} * @memberof LeadsApiGetArchivedLeads */ readonly organization_id?: number; /** * The ID of the filter to use * @type {number} * @memberof LeadsApiGetArchivedLeads */ readonly filter_id?: number; /** * The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). * @type {'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time'} * @memberof LeadsApiGetArchivedLeads */ readonly sort?: 'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time'; } /** * Request parameters for getLead operation in LeadsApi. * @export * @interface LeadsApiGetLeadRequest */ export interface LeadsApiGetLeadRequest { /** * The ID of the lead * @type {string} * @memberof LeadsApiGetLead */ readonly id: string; } /** * Request parameters for getLeadUsers operation in LeadsApi. * @export * @interface LeadsApiGetLeadUsersRequest */ export interface LeadsApiGetLeadUsersRequest { /** * The ID of the lead * @type {string} * @memberof LeadsApiGetLeadUsers */ readonly id: string; } /** * Request parameters for getLeads operation in LeadsApi. * @export * @interface LeadsApiGetLeadsRequest */ export interface LeadsApiGetLeadsRequest { /** * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. * @type {number} * @memberof LeadsApiGetLeads */ readonly limit?: number; /** * For pagination, the position that represents the first result for the page * @type {number} * @memberof LeadsApiGetLeads */ readonly start?: number; /** * If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. * @type {number} * @memberof LeadsApiGetLeads */ readonly owner_id?: number; /** * If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. * @type {number} * @memberof LeadsApiGetLeads */ readonly person_id?: number; /** * If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. * @type {number} * @memberof LeadsApiGetLeads */ readonly organization_id?: number; /** * The ID of the filter to use * @type {number} * @memberof LeadsApiGetLeads */ readonly filter_id?: number; /** * If set, only leads with an `update_time` later than or equal to this time are returned. In ISO 8601 format, e.g. 2025-01-01T10:20:00Z. * @type {string} * @memberof LeadsApiGetLeads */ readonly updated_since?: string; /** * The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). * @type {'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time'} * @memberof LeadsApiGetLeads */ readonly sort?: 'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time'; } /** * Request parameters for searchLeads operation in LeadsApi. * @export * @interface LeadsApiSearchLeadsRequest */ export interface LeadsApiSearchLeadsRequest { /** * The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. * @type {string} * @memberof LeadsApiSearchLeads */ readonly term: string; /** * A comma-separated string array. The fields to perform the search from. Defaults to all of them. * @type {'custom_fields' | 'notes' | 'title'} * @memberof LeadsApiSearchLeads */ readonly fields?: 'custom_fields' | 'notes' | 'title'; /** * When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @type {boolean} * @memberof LeadsApiSearchLeads */ readonly exact_match?: boolean; /** * Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. * @type {number} * @memberof LeadsApiSearchLeads */ readonly person_id?: number; /** * Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. * @type {number} * @memberof LeadsApiSearchLeads */ readonly organization_id?: number; /** * Supports including optional fields in the results which are not provided by default * @type {'lead.was_seen'} * @memberof LeadsApiSearchLeads */ readonly include_fields?: 'lead.was_seen'; /** * Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. * @type {number} * @memberof LeadsApiSearchLeads */ readonly start?: number; /** * Items shown per page * @type {number} * @memberof LeadsApiSearchLeads */ readonly limit?: number; } /** * Request parameters for updateLead operation in LeadsApi. * @export * @interface LeadsApiUpdateLeadRequest */ export interface LeadsApiUpdateLeadRequest { /** * The ID of the lead * @type {string} * @memberof LeadsApiUpdateLead */ readonly id: string; /** * * @type {UpdateLeadRequest} * @memberof LeadsApiUpdateLead */ readonly UpdateLeadRequest?: UpdateLeadRequest; } /** * LeadsApi - object-oriented interface * @export * @class LeadsApi * @extends {BaseAPI} */ export declare class LeadsApi extends BaseAPI { /** * Creates a lead. A lead always has to be linked to a person or an organization or both. All leads created through the Pipedrive API will have a lead source and origin set to `API`. Here\'s the tutorial for adding a lead. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields\' structure from deals. See an example given in the updating custom fields\' values tutorial. * @summary Add a lead * @param {LeadsApiAddLeadRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof LeadsApi */ addLead(requestParameters?: LeadsApiAddLeadRequest): Promise; /** * Deletes a specific lead. * @summary Delete a lead * @param {LeadsApiDeleteLeadRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof LeadsApi */ deleteLead(requestParameters: LeadsApiDeleteLeadRequest): Promise; /** * Returns multiple archived leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields\' structure from deals. * @summary Get all archived leads * @param {LeadsApiGetArchivedLeadsRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof LeadsApi */ getArchivedLeads(requestParameters?: LeadsApiGetArchivedLeadsRequest): Promise; /** * Returns details of a specific lead. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from deals. * @summary Get one lead * @param {LeadsApiGetLeadRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof LeadsApi */ getLead(requestParameters: LeadsApiGetLeadRequest): Promise; /** * Lists the users permitted to access a lead. * @summary List permitted users * @param {LeadsApiGetLeadUsersRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof LeadsApi */ getLeadUsers(requestParameters: LeadsApiGetLeadUsersRequest): Promise; /** * Returns multiple not archived leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields\' structure from deals. * @summary Get all leads * @param {LeadsApiGetLeadsRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof LeadsApi */ getLeads(requestParameters?: LeadsApiGetLeadsRequest): Promise; /** * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. * @summary Search leads * @param {LeadsApiSearchLeadsRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof LeadsApi */ searchLeads(requestParameters: LeadsApiSearchLeadsRequest): Promise; /** * Updates one or more properties of a lead. Only properties included in the request will be updated. Send `null` to unset a property (applicable for example for `value`, `person_id` or `organization_id`). If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from deals. See an example given in the updating custom fields’ values tutorial. * @summary Update a lead * @param {LeadsApiUpdateLeadRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof LeadsApi */ updateLead(requestParameters: LeadsApiUpdateLeadRequest): Promise; }