openapi: 3.0.3 info: version: 1.3.0 title: CRM API - Contract tests description: "Welcome to the CRM API from Apideck." contact: email: hello@apideck.com url: 'https://developers.apideck.com' x-logo: url: 'https://developers.apideck.com/icon.png' license: name: Apache 2.0 url: 'http://www.apache.org/licenses/LICENSE-2.0.html' servers: - url: 'https://unify.apideck.com' description: Production security: - apiKey: [ ] applicationId: [ ] consumerId: [ ] tags: - name: Leads description: '' components: schemas: UnifiedId: title: UnifiedId required: - id properties: id: type: string readOnly: true example: '12345' Lead: required: - name - company_name x-pii: - name - email - first_name - last_name properties: id: type: string example: '12345' readOnly: true owner_id: type: string example: '54321' company_id: type: string example: '2' nullable: true company_name: type: string example: Spacex nullable: true contact_id: type: string example: '2' nullable: true name: type: string example: Elon Musk first_name: type: string example: Elon nullable: true last_name: type: string example: Musk nullable: true description: type: string example: A thinker nullable: true prefix: type: string example: Sir nullable: true title: type: string example: CEO nullable: true status: type: string example: New nullable: true monetary_amount: type: number example: 75000 nullable: true currency: type: string example: USD nullable: true fax: type: string example: '+12129876543' nullable: true websites: type: array items: $ref: '#/components/schemas/Website' addresses: type: array items: $ref: '#/components/schemas/Address' social_links: type: array items: $ref: '#/components/schemas/SocialLink' phone_numbers: type: array items: $ref: '#/components/schemas/PhoneNumber' emails: type: array items: $ref: '#/components/schemas/Email' custom_fields: type: array items: $ref: '#/components/schemas/CustomField' tags: $ref: '#/components/schemas/Tags' updated_at: type: string example: '2020-09-30T07:43:32.000Z' readOnly: true created_at: type: string example: '2020-09-30T07:43:32.000Z' readOnly: true BankAccount: type: object properties: iban: type: string example: CH2989144532982975332 nullable: true bic: type: string example: AUDSCHGGXXX nullable: true Website: type: object required: - url properties: id: type: string example: '12345' nullable: true url: type: string example: 'http://example.com' type: type: string x-graphql-type-name: WebsiteType enum: - primary - secondary - work - personal - other example: primary Address: type: object properties: id: type: string example: '123' nullable: true type: type: string x-graphql-type-name: AddressType enum: - primary - secondary - home - office - shipping - billing - other example: primary name: type: string example: HQ US nullable: true line1: type: string example: Main street description: 'Line 1 of the address e.g. number, street, suite, apt #, etc.' nullable: true line2: type: string example: 'apt #' description: Line 2 of the address nullable: true city: type: string example: San Francisco description: Name of city. nullable: true state: type: string example: CA description: Name of state nullable: true postal_code: type: string example: '94104' description: Zip code or equivalent. nullable: true country: type: string example: US description: country code according to ISO 3166-1 alpha-2. nullable: true latitude: type: string example: '40.759211' nullable: true longitude: type: string example: '-73.984638' nullable: true SocialLink: required: - url type: object properties: id: type: string example: '12345' nullable: true url: type: string example: 'https://www.twitter.com/apideck-io' type: type: string example: twitter nullable: true PhoneNumber: required: - number type: object properties: id: type: string example: '12345' nullable: true number: type: string example: 111-111-1111 type: type: string x-graphql-type-name: PhoneType enum: - primary - secondary - home - office - mobile - assistant - fax - other example: primary Email: required: - email type: object properties: id: type: string example: '123' email: type: string format: email example: elon@musk.com type: type: string x-graphql-type-name: EmailType enum: - primary - secondary - work - personal - billing - other example: primary CustomField: type: object required: - id additionalProperties: false properties: id: type: string example: custom_technologies value: anyOf: - type: string example: Uses Salesforce and Marketo nullable: true - type: number example: 10 nullable: true - type: boolean example: true nullable: true - type: array items: type: string Tags: type: array items: type: string example: - New Meta: type: object description: Reponse metadata properties: items_on_page: type: integer description: Number of items returned in the data property of the response example: 50 cursors: type: object description: Cursors to navigate to previous or next pages through the API properties: previous: type: string description: Cursor to navigate to the previous page of results through the API example: em9oby1jcm06OnBhZ2U6OjE= nullable: true current: type: string description: Cursor to navigate to the current page of results through the API example: em9oby1jcm06OnBhZ2U6OjI= nullable: true next: type: string description: Cursor to navigate to the next page of results through the API example: em9oby1jcm06OnBhZ2U6OjM= nullable: true Links: type: object description: Links to navigate to previous or next pages through the API properties: previous: type: string description: Link to navigate to the previous page through the API example: 'https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D' nullable: true current: type: string description: Link to navigate to the current page through the API example: 'https://unify.apideck.com/crm/companies' next: type: string description: Link to navigate to the previous page through the API example: 'https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM' nullable: true NotFoundResponse: properties: status_code: type: number description: HTTP status code example: 404 error: type: string description: Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) example: Not Found typeName: type: string description: The type of error returned example: EntityNotFoundError message: type: string description: A human-readable message providing more details about the error. example: Unknown Widget detail: type: string description: Contains parameter or domain specific information related to the error and why it occured. example: "Could not find widget with id: '123'" ref: type: string description: Link to documentation of error type example: 'https://developers.apideck.com/errors#entitynotfounderror' Unauthorized: properties: status_code: type: number description: HTTP status code example: 401 error: type: string description: Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) example: Unauthorized typeName: type: string description: The type of error returned example: UnauthorizedError message: type: string description: A human-readable message providing more details about the error. example: Unauthorized Request detail: anyOf: - type: string - type: object description: Contains parameter or domain specific information related to the error and why it occured. example: Failed to generate valid JWT Session. Verify applicationId is correct ref: type: string description: Link to documentation of error type example: 'https://developers.apideck.com/errors#unauthorizederror' Unprocessable: properties: status_code: type: number description: HTTP status code example: 422 error: type: string description: Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) example: Unprocessable Entity typeName: type: string description: The type of error returned example: InvalidStateError message: type: string description: A human-readable message providing more details about the error. example: Invalid State detail: type: string description: Contains parameter or domain specific information related to the error and why it occured. example: State did not include unified_api ref: type: string description: Link to documentation of error type example: 'https://developers.apideck.com/errors#invalidstateerror' BadRequest: properties: status_code: type: number description: HTTP status code example: 400 error: type: string description: Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) example: Bad Request typeName: type: string description: The type of error returned example: MissingHeadersError message: type: string description: A human-readable message providing more details about the error. example: Invalid Params detail: anyOf: - type: string - type: object description: Contains parameter or domain specific information related to the error and why it occured. example: missing: - - foobar: required ref: type: string description: Link to documentation of error type example: 'https://developers.apideck.com/errors#missingheaderserror' PaymentRequired: properties: status_code: type: number description: HTTP status code example: 402 error: type: string description: Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) example: Payment Required typeName: type: string description: The type of error returned example: RequestLimitError message: type: string description: A human-readable message providing more details about the error. example: Request Limit Reached detail: type: string description: Contains parameter or domain specific information related to the error and why it occured. example: You have reached your limit of 2000 ref: type: string description: Link to documentation of error type example: 'https://developers.apideck.com/errors#requestlimiterror' NotImplemented: properties: status_code: type: number description: HTTP status code example: 501 error: type: string description: Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) example: Not Implemented typeName: type: string description: The type of error returned example: MappingError message: type: string description: A human-readable message providing more details about the error. example: Unmapped Attribute detail: anyOf: - type: string - type: object description: Contains parameter or domain specific information related to the error and why it occured. example: Failed to retrieve Widget tokenUrl from 'components.securitySchemes.oauth2.flows' ref: type: string description: Link to documentation of error type example: 'https://developers.apideck.com/errors#mappingerror' UnexpectedError: properties: status_code: type: number description: HTTP status code example: 400 error: type: string description: Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) example: Bad Request typeName: type: string description: The type of error returned example: MissingHeadersError message: type: string description: A human-readable message providing more details about the error. example: Invalid Params detail: anyOf: - type: string - type: object description: Contains parameter or domain specific information related to the error and why it occured. example: 'Missing Header: x-apideck-consumer-id' ref: type: string description: Link to documentation of error type example: 'https://developers.apideck.com/errors#unauthorizederror' CreateLeadResponse: type: object required: - status_code - status - service - resource - operation - data properties: status_code: type: integer description: HTTP Response Status Code example: 200 status: type: string description: HTTP Response Status example: OK service: type: string description: Apideck ID of service provider example: zoho-crm resource: type: string description: Unified API resource name example: companies operation: type: string description: Operation performed example: one data: $ref: '#/components/schemas/UnifiedId' UpdateLeadResponse: type: object required: - status_code - status - service - resource - operation - data properties: status_code: type: integer description: HTTP Response Status Code example: 200 status: type: string description: HTTP Response Status example: OK service: type: string description: Apideck ID of service provider example: zoho-crm resource: type: string description: Unified API resource name example: companies operation: type: string description: Operation performed example: one data: $ref: '#/components/schemas/UnifiedId' DeleteLeadResponse: type: object required: - status_code - status - service - resource - operation - data properties: status_code: type: integer description: HTTP Response Status Code example: 200 status: type: string description: HTTP Response Status example: OK service: type: string description: Apideck ID of service provider example: zoho-crm resource: type: string description: Unified API resource name example: companies operation: type: string description: Operation performed example: one data: $ref: '#/components/schemas/UnifiedId' GetLeadResponse: type: object required: - status_code - status - service - resource - operation - data properties: status_code: type: integer description: HTTP Response Status Code example: 200 status: type: string description: HTTP Response Status example: OK service: type: string description: Apideck ID of service provider example: zoho-crm resource: type: string description: Unified API resource name example: companies operation: type: string description: Operation performed example: one data: $ref: '#/components/schemas/Lead' GetLeadsResponse: x-graphql-type-name: LeadList type: object required: - status_code - status - service - resource - operation - data properties: status_code: type: integer description: HTTP Response Status Code example: 200 status: type: string description: HTTP Response Status example: OK service: type: string description: Apideck ID of service provider example: zoho-crm resource: type: string description: Unified API resource name example: companies operation: type: string description: Operation performed example: one data: type: array items: $ref: '#/components/schemas/Lead' meta: $ref: '#/components/schemas/Meta' links: $ref: '#/components/schemas/Links' parameters: applicationId: name: x-apideck-app-id in: header required: true description: The ID of your Unify application schema: type: string example: my-app-id serviceId: name: x-apideck-service-id in: header description: 'Provide the service id you want to call (e.g., pipedrive). [See the full list in the connector section.](#section/Connectors) Only needed when a consumer has activated multiple integrations for a Unified API.' schema: type: string example: pipedrive consumerId: name: x-apideck-consumer-id in: header required: true description: ID of the consumer which you want to get or push data from schema: type: string example: my-consumer-id raw: name: raw in: query description: Include raw response. Mostly used for debugging purposes schema: type: boolean default: true id: in: path name: id schema: type: string default: 123 example: 123 required: true description: ID of the record you are acting upon. limit: name: limit in: query description: Number of records to return schema: type: integer minimum: 1 maximum: 200 default: 20 cursor: name: cursor in: query description: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. schema: type: string nullable: true default: null responses: GetLeads: description: Leads content: application/json: schema: $ref: '#/components/schemas/GetLeadsResponse' GetLead: description: Lead headers: Content-type: description: 'URL to query for status of the operation. The operation ID will expire in 48 hours. ' schema: type: string example: 'application/json' Operation-Location: description: 'URL to query for status of the operation. The operation ID will expire in 48 hours. ' schema: type: string example: '{baseUrl}/operations/bbadbeef-b3ab-40af-b05c-c0ffee6544cd' content: application/json: schema: $ref: '#/components/schemas/GetLeadResponse' CreateLead: description: Lead created content: application/json: schema: $ref: '#/components/schemas/CreateLeadResponse' UpdateLead: description: Lead updated content: application/json: schema: $ref: '#/components/schemas/UpdateLeadResponse' DeleteLead: description: Lead deleted content: application/json: schema: $ref: '#/components/schemas/DeleteLeadResponse' NotFound: description: The specified resource was not found content: application/json: schema: $ref: '#/components/schemas/NotFoundResponse' Unauthorized: description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Unauthorized' Unprocessable: description: Unprocessable content: application/json: schema: $ref: '#/components/schemas/Unprocessable' BadRequest: description: Bad Request content: application/json: schema: $ref: '#/components/schemas/BadRequest' PaymentRequired: description: Payment Required content: application/json: schema: $ref: '#/components/schemas/PaymentRequired' NotImplemented: description: Not Implemented content: application/json: schema: $ref: '#/components/schemas/NotImplemented' UnexpectedError: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/UnexpectedError' securitySchemes: apiKey: type: http scheme: bearer description: | To use API you have to sign up and get your own API key. Unify API accounts have sandbox mode and live mode API keys. To change modes just use the appropriate key to get a live or test object. You can find your API keys on the unify settings of your Apideck app. Your Apideck application_id can also be found on the same page. Authenticate your API requests by including your test or live secret API key in the request header. - Bearer authorization header: `Authorization: Bearer ` - Application id header: `x-apideck-app-id: ` You should use the public keys on the SDKs and the secret keys to authenticate API requests. **Do not share or include your secret API keys on client side code.** Your API keys carry significant privileges. Please ensure to keep them 100% secure and be sure to not share your secret API keys in areas that are publicly accessible like GitHub. Learn how to set the Authorization header inside Postman https://learning.postman.com/docs/postman/sending-api-requests/authorization/#api-key Go to Unify to grab your API KEY https://app.apideck.com/unify/api-keys applicationId: type: apiKey in: header name: x-apideck-app-id description: The ID of your Unify application consumerId: type: apiKey in: header name: x-apideck-consumer-id description: The ID of the consumer which you want to get or push data from paths: /crm/leads: get: tags: - Leads x-graphql-field-name: leads operationId: leadsAll summary: List leads description: List leads parameters: - $ref: '#/components/parameters/raw' - $ref: '#/components/parameters/consumerId' - $ref: '#/components/parameters/applicationId' - $ref: '#/components/parameters/serviceId' - $ref: '#/components/parameters/cursor' - $ref: '#/components/parameters/limit' security: - apiKey: [ ] responses: '200': $ref: '#/components/responses/GetLeads' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '402': $ref: '#/components/responses/PaymentRequired' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/Unprocessable' default: $ref: '#/components/responses/UnexpectedError' post: tags: - Leads operationId: leadsAdd summary: Create lead description: Create lead parameters: - $ref: '#/components/parameters/raw' - $ref: '#/components/parameters/consumerId' - $ref: '#/components/parameters/applicationId' - $ref: '#/components/parameters/serviceId' security: - apiKey: [ ] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Lead' responses: '201': $ref: '#/components/responses/CreateLead' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '402': $ref: '#/components/responses/PaymentRequired' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/Unprocessable' default: $ref: '#/components/responses/UnexpectedError' '/crm/leads/{id}': get: tags: - Leads operationId: leadsOne summary: Get lead description: Get lead parameters: - $ref: '#/components/parameters/id' - $ref: '#/components/parameters/consumerId' - $ref: '#/components/parameters/applicationId' - $ref: '#/components/parameters/serviceId' - $ref: '#/components/parameters/raw' security: - apiKey: [ ] responses: '200': $ref: '#/components/responses/GetLead' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '402': $ref: '#/components/responses/PaymentRequired' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/Unprocessable' default: $ref: '#/components/responses/UnexpectedError' patch: tags: - Leads operationId: leadsUpdate summary: Update lead description: Update lead parameters: - $ref: '#/components/parameters/id' - $ref: '#/components/parameters/consumerId' - $ref: '#/components/parameters/applicationId' - $ref: '#/components/parameters/serviceId' - $ref: '#/components/parameters/raw' security: - apiKey: [ ] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Lead' responses: '200': $ref: '#/components/responses/UpdateLead' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '402': $ref: '#/components/responses/PaymentRequired' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/Unprocessable' default: $ref: '#/components/responses/UnexpectedError' delete: tags: - Leads operationId: leadsDelete summary: Delete lead description: Delete lead parameters: - $ref: '#/components/parameters/id' - $ref: '#/components/parameters/consumerId' - $ref: '#/components/parameters/applicationId' - $ref: '#/components/parameters/serviceId' - $ref: '#/components/parameters/raw' security: - apiKey: [ ] responses: '200': $ref: '#/components/responses/DeleteLead' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '402': $ref: '#/components/responses/PaymentRequired' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/Unprocessable' default: $ref: '#/components/responses/UnexpectedError'