@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Lead API
@base https://unify.apideck.com
@version 10.24.14
@auth ApiKey Authorization in header | ApiKey x-apideck-app-id in header | ApiKey x-apideck-consumer-id in header
@endpoints 5
@toc lead(5)

@endpoint GET /lead/leads
@desc List leads
@required {x-apideck-consumer-id: str # ID of the consumer which you want to get or push data from, x-apideck-app-id: str # The ID of your Unify application}
@optional {raw: bool=false # Include raw response. Mostly used for debugging purposes, x-apideck-service-id: str # Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API., cursor: str # Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response., limit: int=20 # Number of results to return. Minimum 1, Maximum 200, Default 20, filter: map # Apply filters, sort: map # Apply sorting, fields: str # 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.}
@returns(200) {status_code: int, status: str, service: str, resource: str, operation: str, data: [map], meta: map{items_on_page: int, cursors: map{previous: str?, current: str?, next: str?}}, links: map{previous: str?, current: str, next: str?}, _raw: map?} # Leads
@errors {400: Bad Request, 401: Unauthorized, 402: Payment Required, 404: The specified resource was not found, 422: Unprocessable}

@endpoint POST /lead/leads
@desc Create lead
@required {x-apideck-consumer-id: str # ID of the consumer which you want to get or push data from, x-apideck-app-id: str # The ID of your Unify application, name: str # Full name of the lead.}
@optional {raw: bool=false # Include raw response. Mostly used for debugging purposes, x-apideck-service-id: str # Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API., id: str # Unique identifier for the contact., company_name: str # The name of the company the lead is associated with., owner_id: str # The owner of the lead., owner_name: str # The name of the owner of the lead., company_id: str # The company the lead is associated with., contact_id: str # The contact the lead is associated with., lead_id: str # The identifier of the lead., lead_source: str # The source of the lead., first_name: str # The first name of the lead., last_name: str # The last name of the lead., description: str # The description of the lead., prefix: str # The prefix of the lead., title: str # The job title of the lead., language: str # language code according to ISO 639-1. For the United States - EN, status: str, monetary_amount: num # The monetary amount of the lead., currency: str(UNKNOWN_CURRENCY/AED/AFN/ALL/AMD/ANG/AOA/ARS/AUD/AWG/AZN/BAM/BBD/BDT/BGN/BHD/BIF/BMD/BND/BOB/BOV/BRL/BSD/BTN/BWP/BYR/BZD/CAD/CDF/CHE/CHF/CHW/CLF/CLP/CNY/COP/COU/CRC/CUC/CUP/CVE/CZK/DJF/DKK/DOP/DZD/EGP/ERN/ETB/EUR/FJD/FKP/GBP/GEL/GHS/GIP/GMD/GNF/GTQ/GYD/HKD/HNL/HRK/HTG/HUF/IDR/ILS/INR/IQD/IRR/ISK/JMD/JOD/JPY/KES/KGS/KHR/KMF/KPW/KRW/KWD/KYD/KZT/LAK/LBP/LKR/LRD/LSL/LTL/LVL/LYD/MAD/MDL/MGA/MKD/MMK/MNT/MOP/MRO/MUR/MVR/MWK/MXN/MXV/MYR/MZN/NAD/NGN/NIO/NOK/NPR/NZD/OMR/PAB/PEN/PGK/PHP/PKR/PLN/PYG/QAR/RON/RSD/RUB/RWF/SAR/SBD/SCR/SDG/SEK/SGD/SHP/SLL/SOS/SRD/SSP/STD/SVC/SYP/SZL/THB/TJS/TMT/TND/TOP/TRC/TRY/TTD/TWD/TZS/UAH/UGX/USD/USN/USS/UYI/UYU/UZS/VEF/VND/VUV/WST/XAF/XAG/XAU/XBA/XBB/XBC/XBD/XCD/XDR/XOF/XPD/XPF/XPT/XTS/XXX/YER/ZAR/ZMK/ZMW/BTC/ETH) # Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)., fax: str # The fax number of the lead., websites: [map{id: str, url!: str, type: str}], addresses: [map{id: str, type: str, string: str, name: str, line1: str, line2: str, line3: str, line4: str, line5: str, street_number: str, city: str, state: str, postal_code: str, country: str, latitude: str, longitude: str, county: str, contact_name: str, salutation: str, phone_number: str, fax: str, email: str, website: str, notes: str, row_version: str}], social_links: [map{id: str, url!: str, type: str}], phone_numbers: [map{id: str, country_code: str, area_code: str, number!: str, extension: str, type: str}], emails: [map{id: str, email!: str(email), type: str}], custom_fields: [map{id: str, name: str, description: str, value: any}], tags: [str], custom_mappings: map # When custom mappings are configured on the resource, the result is included here., updated_at: str # Date updated in ISO 8601 format, created_at: str # Date created in ISO 8601 format, pass_through: [map{service_id!: str, operation_id: str, extend_object: map, extend_paths: [map]}] # The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.}
@returns(201) {status_code: int, status: str, service: str, resource: str, operation: str, data: map{id: str}, _raw: map?} # Lead created
@errors {400: Bad Request, 401: Unauthorized, 402: Payment Required, 404: The specified resource was not found, 422: Unprocessable}

@endpoint GET /lead/leads/{id}
@desc Get lead
@required {id: str # ID of the record you are acting upon., x-apideck-consumer-id: str # ID of the consumer which you want to get or push data from, x-apideck-app-id: str # The ID of your Unify application}
@optional {x-apideck-service-id: str # Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API., raw: bool=false # Include raw response. Mostly used for debugging purposes, fields: str # 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.}
@returns(200) {status_code: int, status: str, service: str, resource: str, operation: str, data: map{id: str, name: str, company_name: str?, owner_id: str?, owner_name: str?, company_id: str?, contact_id: str?, lead_id: str?, lead_source: str?, first_name: str?, last_name: str?, description: str?, prefix: str?, title: str?, language: str?, status: str?, monetary_amount: num?, currency: str?, fax: str?, websites: [map], addresses: [map], social_links: [map], phone_numbers: [map], emails: [map], custom_fields: [map]?, tags: [str]?, custom_mappings: map?, updated_at: str?, created_at: str?, pass_through: [map]}, _raw: map?} # Lead
@errors {400: Bad Request, 401: Unauthorized, 402: Payment Required, 404: The specified resource was not found, 422: Unprocessable}

@endpoint PATCH /lead/leads/{id}
@desc Update lead
@required {id: str # ID of the record you are acting upon., x-apideck-consumer-id: str # ID of the consumer which you want to get or push data from, x-apideck-app-id: str # The ID of your Unify application, name: str # Full name of the lead.}
@optional {x-apideck-service-id: str # Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API., raw: bool=false # Include raw response. Mostly used for debugging purposes, id: str # Unique identifier for the contact., company_name: str # The name of the company the lead is associated with., owner_id: str # The owner of the lead., owner_name: str # The name of the owner of the lead., company_id: str # The company the lead is associated with., contact_id: str # The contact the lead is associated with., lead_id: str # The identifier of the lead., lead_source: str # The source of the lead., first_name: str # The first name of the lead., last_name: str # The last name of the lead., description: str # The description of the lead., prefix: str # The prefix of the lead., title: str # The job title of the lead., language: str # language code according to ISO 639-1. For the United States - EN, status: str, monetary_amount: num # The monetary amount of the lead., currency: str(UNKNOWN_CURRENCY/AED/AFN/ALL/AMD/ANG/AOA/ARS/AUD/AWG/AZN/BAM/BBD/BDT/BGN/BHD/BIF/BMD/BND/BOB/BOV/BRL/BSD/BTN/BWP/BYR/BZD/CAD/CDF/CHE/CHF/CHW/CLF/CLP/CNY/COP/COU/CRC/CUC/CUP/CVE/CZK/DJF/DKK/DOP/DZD/EGP/ERN/ETB/EUR/FJD/FKP/GBP/GEL/GHS/GIP/GMD/GNF/GTQ/GYD/HKD/HNL/HRK/HTG/HUF/IDR/ILS/INR/IQD/IRR/ISK/JMD/JOD/JPY/KES/KGS/KHR/KMF/KPW/KRW/KWD/KYD/KZT/LAK/LBP/LKR/LRD/LSL/LTL/LVL/LYD/MAD/MDL/MGA/MKD/MMK/MNT/MOP/MRO/MUR/MVR/MWK/MXN/MXV/MYR/MZN/NAD/NGN/NIO/NOK/NPR/NZD/OMR/PAB/PEN/PGK/PHP/PKR/PLN/PYG/QAR/RON/RSD/RUB/RWF/SAR/SBD/SCR/SDG/SEK/SGD/SHP/SLL/SOS/SRD/SSP/STD/SVC/SYP/SZL/THB/TJS/TMT/TND/TOP/TRC/TRY/TTD/TWD/TZS/UAH/UGX/USD/USN/USS/UYI/UYU/UZS/VEF/VND/VUV/WST/XAF/XAG/XAU/XBA/XBB/XBC/XBD/XCD/XDR/XOF/XPD/XPF/XPT/XTS/XXX/YER/ZAR/ZMK/ZMW/BTC/ETH) # Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)., fax: str # The fax number of the lead., websites: [map{id: str, url!: str, type: str}], addresses: [map{id: str, type: str, string: str, name: str, line1: str, line2: str, line3: str, line4: str, line5: str, street_number: str, city: str, state: str, postal_code: str, country: str, latitude: str, longitude: str, county: str, contact_name: str, salutation: str, phone_number: str, fax: str, email: str, website: str, notes: str, row_version: str}], social_links: [map{id: str, url!: str, type: str}], phone_numbers: [map{id: str, country_code: str, area_code: str, number!: str, extension: str, type: str}], emails: [map{id: str, email!: str(email), type: str}], custom_fields: [map{id: str, name: str, description: str, value: any}], tags: [str], custom_mappings: map # When custom mappings are configured on the resource, the result is included here., updated_at: str # Date updated in ISO 8601 format, created_at: str # Date created in ISO 8601 format, pass_through: [map{service_id!: str, operation_id: str, extend_object: map, extend_paths: [map]}] # The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.}
@returns(200) {status_code: int, status: str, service: str, resource: str, operation: str, data: map{id: str}, _raw: map?} # Lead updated
@errors {400: Bad Request, 401: Unauthorized, 402: Payment Required, 404: The specified resource was not found, 422: Unprocessable}

@endpoint DELETE /lead/leads/{id}
@desc Delete lead
@required {id: str # ID of the record you are acting upon., x-apideck-consumer-id: str # ID of the consumer which you want to get or push data from, x-apideck-app-id: str # The ID of your Unify application}
@optional {x-apideck-service-id: str # Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API., raw: bool=false # Include raw response. Mostly used for debugging purposes}
@returns(200) {status_code: int, status: str, service: str, resource: str, operation: str, data: map{id: str}, _raw: map?} # Lead deleted
@errors {400: Bad Request, 401: Unauthorized, 402: Payment Required, 404: The specified resource was not found, 422: Unprocessable}

@end
